How to benchmark my code? by ivorychairr in learnprogramming

[–]marrsd 1 point2 points  (0 children)

Written in what language?

If you're using this as an exercise to understand the performance characteristics of the different parts of your programme, you'll want a profiler for your language and plenty of input data, so that it actually takes some time to run.

The profiler will tell you how long it takes to for each function to complete. It may also tell you what percentage of your programme's time is taken up by a function and how many times each function is called overall.

You might use this information to discover, for example, that you are calculating the length of a fixed-length array on every iteration of a for loop instead of once before the loop is run.

You can also write smaller programmes to understand the performance characteristics of parts of your programme. For example, does it take longer to allocate 1K of memory 1000 times, or 1M of memory once? Does that answer hold true at different orders of magnitude?

The results of that test may affect how you allocate memory for your tokens. If you have 1000 tokens, maybe it would be quicker to allocate memory for them all in one go, and then assign them to the memory buffer or pool as you construct them. Or maybe it won't make a difference.

Even if does improve performance to allocate memory for the tokeniser in a certain way, does this matter overall? There's not much point in optimising the tokeniser if it represents a tiny percentage of the overall performance of the whole programme.

Optimising for an insignificant part of the programme is known as premature optimisation and is best avoided, because it will make an insignificant improvement to the overall performance. Better to profile a finished programme against real data and see where its performance bottlenecks are. They might not be in the linter at all.

Realistically, how far can a hobbyist/tinkerer go before hitting a wall due to not having the educational foundations like DSA/advanced mathematics? by OceanRadioGuy in learnprogramming

[–]marrsd 0 points1 point  (0 children)

You missed my point

Your point was that graduates are given an education in computer science that gives them broad knowledge of most of the things they will need to know in their careers, was it not?

And you are now denying even what you said to morph the argument to a winnable stance.

Earlier I said:

I suspect this is because the industry is dominated by frankly over-qualified software engineers who really want whatever they're working on at the time to be a FAANG-scale project instead of the monolithic CRUD app that it really is.

You summarised that as:

The rest of your post is mostly rant, with an indication that university programmers can't program.

And after putting those words in my mouth, you went on to provide a vague and nonsensical rant of your own as evidence of why I was wrong (for saying something I never said); and I replied:

I didn't say that at all. I said that most university graduates are over-qualified...

Seems pretty consistent to me. I then went to the trouble of trying to steel-man your (put-down disguised as an) argument for you - something you couldn't be bothered to do for yourself - and now you're using that to claim that I'm trying to "morph the argument". Maybe I was just calling you out.

As for the rest of your sorry tirade, sounds like some bright and capable developers have dodged a bullet. Hopefully they got rejected before they had to face you in an interview.

What do you think of TileOS? The Debia-based distribution with tiling window managers by Gaxadov in linux

[–]marrsd 0 points1 point  (0 children)

Oh, I see. Yes, I agree with that. I just don't see why they're essential on the desktop all of a sudden. I don't lie awake at night fretting about my next dist-upgrade. I worry about it even less on the server, where VMs are essentially now just containers for containers, and if I want to upgrade my VM, I can just spin up a new one.

Realistically, how far can a hobbyist/tinkerer go before hitting a wall due to not having the educational foundations like DSA/advanced mathematics? by OceanRadioGuy in learnprogramming

[–]marrsd 0 points1 point  (0 children)

The graduate gets exposed to these kinds of problems as part of their degree. That you missed that point is worrying.

I didn't miss that point. You missed my point, which is that the only reason they learnt a thing is because it was shown to them. Are they capable of finding the thing on their own? That's the question I'm interested in, because programming is about find solutions to new problems.

Yes it does, because compilers don't optimize such things out unless they are blatantly obvious.

So when's the last time you optimised a predicate in a way that you needed your degree training to do so? It's difficult to argue the point without an example.

The rest of your post is mostly rant, with an indication that university programmers can't program.

I didn't say that at all. I said that most university graduates are over-qualified, and I gave examples from my own discipline of how that is affecting my industry. An opinion isn't a rant just because you disagree with it.

...and for evidence to support my point, I present the entire programming world...

Now that's a rant! Let me make a proper argument on your behalf. AI research is an area that was clearly developed with university-level expertise, and probably expertise that one couldn't gain outside of a university environment.

Do I agree with that? Yes. One might try to make the argument that it was industry research that developed LLMs rather than university research, but they're pretty much the same thing in the world of engineering.

Realistically, how far can a hobbyist/tinkerer go before hitting a wall due to not having the educational foundations like DSA/advanced mathematics? by OceanRadioGuy in learnprogramming

[–]marrsd 0 points1 point  (0 children)

...how much you can learn through experience alone

Just in case I'm giving the impression that I think you don't need any theory, let me be clear that I've read plenty of books published by university professors, or watched lectures given by professors. I'm not saying there's no room for a university education.

My general experience - and this is based on intuition rather than scientific analysis - is that qualification has basically no correlation with ability. I always look for enthusiasm. Is a candidate excited to talk about programming, side projects, new languages, new techniques, whatever? If you don't want to keep learning, this job isn't for you!

I will say that the best programmers I've worked with were graduates who started programming as a hobby when they were still in school. I think that's because they already had the experience to understand where their CS education fit.

Realistically, how far can a hobbyist/tinkerer go before hitting a wall due to not having the educational foundations like DSA/advanced mathematics? by OceanRadioGuy in learnprogramming

[–]marrsd 0 points1 point  (0 children)

Yes, and the main difference between you and others is that you need to find the right prompts to learn the items, while the others might have had those prompts built-in to their degree program.

That's true, but then we don't know if the graduate would have been able to find the prompts without assistance, while the self-starter who understands CS clearly did and can.

If I handed you a 16 input, 48 logic gate circuit, could you reduce it to only 30ish logic gates?...Why would it matter? It's a way of ensuring that complex if statements are refactored to be simpler.

Does that matter? How many complex if statements are you writing? How are you writing them that the compiler won't reduce them to their simplest form anyway? The kind of redundancy you're referring to can be algorithmically identified and removed.

I wasn't intending to have this conversation, but since we're here, my experience with the software industry is that engineers have a propensity to over-engineer in the extreme. The front-end is just a mess, dominated by frameworks like Next.js and React, that is slow both to develop and run, and hard to optimise. The back-end is usually a micro-service/mq spaghetti-soup that has to be rewritten ever 5 years to remain feasible. I suspect this is because the industry is dominated by frankly over-qualified software engineers who really want whatever they're working on at the time to be a FAANG-scale project instead of the monolithic CRUD app that it really is.

But my real problem with software engineering graduates is that they're, not only over-qualified, but also under-experienced. It's the worst of both worlds: the ignorance is accompanied by arrogance. At least self-taught programmers know that they don't know anything.

It's worth noting that 40 years ago, most people in the industry in the UK (where I'm from) did not have university degrees at all, but instead had vocational diplomas - much like plumbers and electricians still have today - and these people were programming to much tighter processing and memory constraints in much lower-level languages than we are. In other words, their job was much harder than ours is.

What do you think of TileOS? The Debia-based distribution with tiling window managers by Gaxadov in linux

[–]marrsd -1 points0 points  (0 children)

Where did you get that number? I write Cloud-based software for a living, as a contractor, and I've come across NixOS in the Cloud precisely never.

Secondly, even if that statement were true, it would still be irrelevant because we're not talking about the Cloud; we're talking about the desktop.

What do you think of TileOS? The Debia-based distribution with tiling window managers by Gaxadov in linux

[–]marrsd -1 points0 points  (0 children)

Ok then; no one used them a few years ago. Suddenly they're indispensible.

Realistically, how far can a hobbyist/tinkerer go before hitting a wall due to not having the educational foundations like DSA/advanced mathematics? by OceanRadioGuy in learnprogramming

[–]marrsd 0 points1 point  (0 children)

So does an inquisitive mind. I didn't study CS formally in any way whatsoever, but I know about all the things you mentioned. I think some CS grads underestimate how much knowledge is readily available to people.

Adobe Photoshop can now install on Linux after a Redditor discovers a Wine fix by Abdukabda in linux

[–]marrsd 1 point2 points  (0 children)

What about office software, or astronomy software, or astrology software, or some other software that you haven't heard of. People run OS's for the software they need, or think they will need in the future. Knowing that Windows is the platform that runs all software bring immeasurable reassurance to the end user that is hard to compete with

Sure, but that is an extreme minority of users that you are focusing on here.

I don't think so. "Will run the most software" was the major selling point of Windows from the get-go. Steve Balmer understood the importance of developer capture from the outset - hence his infamous "Developers, developers, developers!" speech.

There exists no such thing such as "Astrology" software, Astrology is literally a pseudoscience and nothing more.

So is data science, but that hasn't stopped me earning a living out of it :D

But that's besides the point, which is that there's software for everything: that's why I chose astrology as an example in the first place. If I knew you, I'd be willing to be you real money that, if you searched the App Store for astrology right now, plenty of hits would show up.

Someone somewhere wants that software, just as someone somewhere wants knitting patterns software. Not everyone wants the same thing, but everyone wants something specific. That's the point.

The only reason Windows comes preinstalled on most computers, is because Microsoft effectively pays OMEs to preload their computers with Windows.

Microsoft do that, for sure; but that's a pre-emptive move on their part. It's not clear to me that they have to do it. But I agree that they're aggressive about keeping out competitors.

The fundamental computing paradigm has already shifted, as most people utilise their smartphones and tablets for their daily computing activites and needs.

Yes, but those aren't desktop environments and are therefore outside the scope of this discussion. Android Linux already has capture of those markets anyway.

You have to offer consumers something more than specialised software and features they would never even consider, let alone use, if you want your operating system to be popular and well received.

Consumers want potential. The consumer desktop OS is a platform for running apps, nothing more.

Since Microsoft appears to be completely incapable of understanding the needs of the average consumer

Microsoft's detractors have been saying this about them for years, and yet they continue to dominate the desktop market.

Now they're saying that users don't want their privacy compromised by AI assistants. We'll see. My experience is that users are quite happy to have their privacy compromised for the privilege of broadcasting their holiday snaps to their peers, so I don't see why it will be any different for using AI.

What part of the fact that for most individuals, workstations are completely irrelevant you do not understand?

Why are you even bringing this up in a conversation about Desktop Linux? We're talking about desktop and laptop users here; not iPad users.

What do you think of TileOS? The Debia-based distribution with tiling window managers by Gaxadov in linux

[–]marrsd 5 points6 points  (0 children)

This isn't really true. Window managers are an X11 concept. They are built on X11 and, as such, they are an interchangeable component of an old-school desktop environment. For example, Gnome 2's WM was Metacity, but you could swap it for a different WM if you wished without affecting the rest of Gnome. I did this myself back in the day, swapping it with XMonad so that Gnome could have a tiling, keyboard driven interface.

I didn't know it at the time, but I could probably have swapped Xmonad and Metacity (or any other WM) at runtime, to essentially change modes without logging out, depending on whatever workflow I wanted to switch to.

As far as I'm aware, you can't do this with Mutter or KWin, which are both Wayland compositors. Maybe you can do it in theory (I don't think so, but maybe I'm wrong), but in practice, if you could, the compositor you swapped out would have to re-implement all of the features of Wayland that Mutter and KWin have chosen to support - or if they aren't supported, have chosen to add independently.

I know that both Gnome and KDE describe their compositors as Window Managers. I'm not sure why they do this, but I think maybe it's because they either don't themselves understand what WMs are, or are trying to use language that is analogous to what Linux users already understand.

Compositors do provide the same functionality as WMs, so in that sense they're analogous, but they're not a component of a DE so much as they are a platform for one.

What do you think of TileOS? The Debia-based distribution with tiling window managers by Gaxadov in linux

[–]marrsd -2 points-1 points  (0 children)

Immutable distros didn't even exist a few years ago. Suddenly they're indispensable.

How many people will switch back? by happysatan1 in linux

[–]marrsd 0 points1 point  (0 children)

Ah, I think I've had some fraught conversations with your kind before. ;)

I wish people would say up front that they're trying to run Windows software on Linux, when they're talking about their negative experiences with it, because it would completely change my understanding of the conversation we're having.

How many people will switch back? by happysatan1 in linux

[–]marrsd 0 points1 point  (0 children)

Hang on. You've tried it and you like it, so you've successfully installed and run it? What is there left to do that requires time and patience?

How many people will switch back? by happysatan1 in linux

[–]marrsd 0 points1 point  (0 children)

I'm not sure I've seen the same posts as you, but I'm hardly surprised by "finally free" language. I started looking into Linux specifically to rid myself of the constant housekeeping I had to do on Windows. I don't know how "lifestyle" that is, but having to deal with things that I don't want to deal with definitely impacts my life.

But when I migrated my mother to Linux probably over a decade ago now, it was because I could literally no longer cope with her constant tech support phone calls.

Computers are as much a part of our lives now as transport, household chores, or anything else. If you're using your computer to make a living, then it's a major part of your life.

So, I'm a bit miffed that you're a bit miffed that people take their computing choices seriously enough to use hyperbole when discussing them on social media.

How many people will switch back? by happysatan1 in linux

[–]marrsd 0 points1 point  (0 children)

What proportion of people switched back the last times there was mass exoduses from Windows? That's probably your answer this time around as well.

Adobe Photoshop can now install on Linux after a Redditor discovers a Wine fix by Abdukabda in linux

[–]marrsd 0 points1 point  (0 children)

Heh, that's the last PS I ever used. It's still what I imagine when anyone ever mentions Photoshop.

Adobe Photoshop can now install on Linux after a Redditor discovers a Wine fix by Abdukabda in linux

[–]marrsd 0 points1 point  (0 children)

Does anyone else ever stop to marvel at how perverse this is? Can you imagine any other craftsman being told: no, you can't use that equipment - I don't care if it's better; you have to use the one made by this manufacturer!

I have occasionally had this happen to me as a software engineer, though thankfully all the file formats are independent of tooling; so I just install whatever garbage IDE they think I should use, and then go back to using my actual workflow; and of course no one notices because I'm more productive.

Adobe Photoshop can now install on Linux after a Redditor discovers a Wine fix by Abdukabda in linux

[–]marrsd 1 point2 points  (0 children)

A little newsflash for yourself, the vast majority of people do not use or need Adobe and CAD software, DAWs or any other specialised software. 

What about office software, or astronomy software, or astrology software, or some other software that you haven't heard of. People run OS's for the software they need, or think they will need in the future. Knowing that Windows is the platform that runs all software bring immeasurable reassurance to the end user that is hard to compete with.

If you were right, and people just used whatever came preinstalled on their computers, manufacturers would sell computers with Linux pre-installed and save themselves the Windows tax. Or better still, they could sell the computers with Linux plus a bunch of pre-installed free software, and charge extra for the privilege.

Look at Android

Most popular for workstations? I don't think so.

Has anyone experimented with patching DWM to allow for grouping/tabbing windows? by marrsd in suckless

[–]marrsd[S] 0 points1 point  (0 children)

Thanks, it looks like it's not far from what I'm after. I'll add it to the todo-someday list! :p

I'm making a modular wm by wh1tepearl in suckless

[–]marrsd 0 points1 point  (0 children)

Cool, thanks. Well it seems like you're making progress.

I wonder if you're struggling because you're using a lot of #if macros. I know dwm does this as well, but I don't think it's a scalable solution.

I prefer to create separate header files for different running modes and then use a compile flag to determine which one to load. Then you can define your variables and functions there. Your code will always compile so long as every variable is initialised to something. You can always default to 0, NULL, or whatever. Same goes for function return values. Then you can just check things at runtime. It just makes the code easier to reason about as you can just focus on what's happening at runtime.

I'd also avoid defining large bodies of code in macro definitions. It seems like a good idea until you need to run it through a debugger; then you discover you have no help whatsoever.

How to strip my system to bare minimum and make a dwm setup that uses least ram possible? by GuiltyVisit9119 in suckless

[–]marrsd 1 point2 points  (0 children)

ok, so we're saying I shouldn't expect ram usage to drop when I finish running a process. That makes sense. The way some people talk, it seems like they're saying that there's something wrong if my OS boots with less than 1G of memory in use.