Live data from Hacker News

A Plea for Lean Software (1995)

liam-on-linux.dreamwidth.org

51–60 of 136 posts

Re: A Plea for Lean Software (1995)

#51
I would argue that the bloat comes when the performance impact is not perceivable compared to the development time.

The easiest optimization strategy is just to load it all up into the memory. Compare that to other strategy like catching partial file data, and it's obvious why the simpler solution is often chosen.

Another example that comes to mind is vector art vs baked art. You can render nice icons as vector art. Or you could ship perfect baked icons for all possible size variations. There are clear trade-offs here. One of them wastes more CPU cycles, and another one wastes storage space and download time.

Re: A Plea for Lean Software (1995)

#52
post #29

Earlier quoted context omitted.

You presume one option when the other option is a bundled but smaller renderer. The truetype renderer my terminal uses is about 700 lines of code. The C it's a translation of is about 1500. There's a sweet spot that might well be a bit higher to e.g. handle ligatures etc., but the payoff from going from that to some huge monstrosity is very small.

As somebody who actually works on a pretty large program, no, I'm absolutely not going to use your 700 LOC TTF renderer. I'm going to use the 128K LOC FreeType. Why? Well, because it's the one everyone else uses. It's what comes with everyone's Linux distro. Therefore, if there's something wrong with it, it's pretty much guaranteed it'll break other stuff and somebody else is going to have to fix that. Also it probab…

I'm not suggesting you should. I'm pointing out that these things can be done with a whole lot less code. And a lot of the time so much less code that it is less of a liability to learn a smaller option. Put another way, I've had to dig into large font renderers to figure out problems before because they didn't work as expected and it became my problem, and I'd much prefer that to be the case with 700LOC I can be intimately familiar with than a large project. (I'm old enough to have had to figure out why Adobe's Type1 font renderer was an awful bloated mess, and in retrospect I should have just rewritten it from scratch, because it was shit; that it was used by others did not help us at all)

I ended up with this one in large part because it took less time to rewrite libschrift (the C option I mentioned) and trim it down for my use than figuring out how to make Freetype work for me. I now have a codebase that's trivially understandable in an hour or two of reading. That's what compact code buys you.

No, it won't do everything. That's fine. If I need Freetype for something where it actually saves me effort, I'll use Freetype. It's not about blindly rewriting things for the sake of it, but not lazily default to big, complex options whether or not they're the appropriate choice.

A lot of the time people pick the complex option because they assume their problem is complex, or because it's "the default", not on the merits.

There are tradeoffs, and plenty of times where the large, complex component is right, but far too often it is picked out of laziness and becomes a huge liability.

Re: A Plea for Lean Software (1995)

#53

Electron entered the chat.

I blame Firefox and other web browsers which deny loading JS files if your page was loaded from file://. If you could simply run an HTML file from your hard drive and have a fully functional web application, you wouldn't need Electron.

Re: A Plea for Lean Software (1995)

#54
post #6

I've come to suspect the normal way large companies are organised makes performant software almost impossible. Features are celebrated and make money - whereas performance can be gradually salami-sliced away, with nobody advocating for it. If you can add a feature and it adds just 50ms to a 300ms pageload - it's unlikely anyone is going to block its release on performance grounds. And once the feature is released, th…

>If you can add a feature and it adds just 50ms to a 300ms pageload - it's unlikely anyone is going to block its release on performance grounds. And once the feature is released, there's no removing it.

Unfortunately this is happening, because compute power is cheap these days. It allows programmers to be lazy, take short cuts and not think about good software architecture. There is no economic incentive to optimise, because human perception won't perceive a difference and thus nobody complains. It's wild to think that we have basically supercomputers in our home and yet developers managed it to bring it down to a crawl with things like electron apps.

Re: A Plea for Lean Software (1995)

#55
Related:

“A Plea for Lean Software” by Prof. Niklaus Wirth (Non-PDF Version) - https://news.ycombinator.com/item?id=33203181 - Oct 2022 (2 comments)

A Plea for Lean Software (1995) [pdf] - https://news.ycombinator.com/item?id=27661559 - June 2021 (137 comments)

A plea for lean software by Niklaus Wirth [pdf] - https://news.ycombinator.com/item?id=27617277 - June 2021 (1 comment)

A Plea for Lean Software (1995) [pdf] - https://news.ycombinator.com/item?id=24059704 - Aug 2020 (137 comments)

A plea for lean software (1995) [pdf] - https://news.ycombinator.com/item?id=17872400 - Aug 2018 (100 comments)

A Plea for Lean Software (1995) [pdf] - https://news.ycombinator.com/item?id=8537970 - Oct 2014 (3 comments)

Niklaus Wirth: A Plea for Lean Software (1995) [pdf] - https://news.ycombinator.com/item?id=8301511 - Sept 2014 (12 comments)

Re: A Plea for Lean Software (1995)

#56
Huh. That's my transcribed/edited version of Prof Wirth's paper from my blog.

Thank you, @thunderbong. I just thought it might be more readable than the various PDFs floating about. I have had emails from blind readers of El Reg saying that some PDF versions are inaccessible.

Not my own writing, obviously. All I did was transcription.

Re: A Plea for Lean Software (1995)

#57
Very few people ever even attempt to write "lean software". The definition is a little nebulous, but "software without bloat" is a good one. This means that you have few dependencies, and the ones you have themselves have few dependencies, for a starter. But right there you have the first problem, which is that dependencies grow stronger with the number of users, and the number of users grows with applicability, hence the rise of dependencies that no-one uses more than 20% of, but everyone uses a different 20%. Even if you do tree-shaking or something so that you at least don't pass on the complexity you're not using, it still doesn't feel lean, because you're cognitively bloated, so to speak. Then, if you rewrite the library (because extracting your 20% is going to be very painful) you can make it simple and small, but no-one is going to use it but you and so it will remain weak, tightly coupled to the one project that uses it, because it doesn't offer the breadth of features people need.

The other reason software bloat persists is because knowing enough about the runtime of your software to even be offended by the presence of bloat is exceedingly rare. Repetitious and pointless tasks abound in modern software, where work is done at one layer and then thrown away and redone by another, repeated N times. But to even know about this requires that you understand your runtime and what its doing in your case, and in our industry, ignorance is (economic) bliss, where "go along get along" is richly rewarded and any aesthetic or moral objection to how things are done is harshly punished.

Strong and real social and economic forces drive bloat and punish the individual that would combat it. Which is why those who make the (at some level, doomed) attempt to fight bloat deserve at least our respect and some honor, since they will not only not receive thanks, they will be actively attacked by those who (correctly) perceive their work as a challenge to the status quo, and hence dangerous, unwanted, and a target.

Re: A Plea for Lean Software (1995)

#58
post #54
post #6

I've come to suspect the normal way large companies are organised makes performant software almost impossible. Features are celebrated and make money - whereas performance can be gradually salami-sliced away, with nobody advocating for it. If you can add a feature and it adds just 50ms to a 300ms pageload - it's unlikely anyone is going to block its release on performance grounds. And once the feature is released, th…

>If you can add a feature and it adds just 50ms to a 300ms pageload - it's unlikely anyone is going to block its release on performance grounds. And once the feature is released, there's no removing it. Unfortunately this is happening, because compute power is cheap these days. It allows programmers to be lazy, take short cuts and not think about good software architecture. There is no economic incentive to optimise,…

> compute power is cheap these days. It allows programmers to be ecobomical, take short cuts and select appropriate software architecture for the business problem

Just an alternative take that I don’t entirely agree with but I often find rephrasing a problem in alternative tone it can help to understand it in non adversarial terms.

In this case I see strong parallels with the auto industry and food distribution

Re: A Plea for Lean Software (1995)

#59
post #45

Earlier quoted context omitted.

Back in 2014 my company switched from Skype to this hot new tool called Slack for messaging. On my £10,000 workstation with dual xeon processors, 64GB memory and a 1TB SSD, you know what was the second most resource intensive app after my c++ compiler, and above my IDE? Slack. We used to close our chat program to compile to save the 1GB memory it was using. > It's a bit theoretical because no editors exist that are s…

Since your time is so valuable and you are obviously very upset about this, your company should pay Spotify to write a more efficient app. Or your company should buy you a new 96 core Threadripper 1 TB RAM system so that when you use Spotify/Slack/Postman it doesn't impact your productivity.

If your only response is a personal attack, don't say anything at all.
Post reply on HN