Live data from Hacker News

Ask HN: Will programmers write more efficient code during the memory shortage?

news.ycombinator.com

161–170 of 264 posts

Re: Ask HN: Will programmers write more efficient code during the memory shortage?

#161
I would say that in most cases you dont need fancy algorithms and data structures, you just need to stop treating RAM as a rough notebook. Allocating in a loop, not reusing buffers and pointer chasing are a performance killers and are quite easy to avoid before they are introduced to code. Other than that, just be more thoughtful about network and disk usage and nested loops. Its a sum of stupid things that make your program slow.

Re: Ask HN: Will programmers write more efficient code during the memory shortage?

#162
post #114

Earlier quoted context omitted.

Who determines the specs?

Specs are business requirements. Choosing a programming language is not a business requirement; it's a technical one.

> Choosing a programming language is not a business requirement; it's a technical one.

Technical decisions like this have to take into account a lot of factors outside of just the language itself.

Is the language you want to use easy to hire for? Will we have to pay a premium for engineers with a specialised background in the language? Do all our 3rd party dependencies maintain SDKs for the language? Do libraries that meet various certifications we might need (i.e. FIPS) exist for the language?

Something like Typescript or Java is going to win out over Rust/Erlang/FP-of-your-choice on a number of these criteria.

Re: Ask HN: Will programmers write more efficient code during the memory shortage?

#163
post #106

Earlier quoted context omitted.

I disagree. Engineers choose the technical stack based on the specs. With LLMs, it's faster to ship even in a more verbose language like Go or Rust.

The language doesn't matter much if you have memory-hungry workloads. Whether it's Rust or C or C#, you can write quite memory efficient code in either.

And Java? Language matters.

Re: Ask HN: Will programmers write more efficient code during the memory shortage?

#164
Realistically, the impetus here will come from the platform holders, not the individual programmers.

Apple recently released an 8GB MacBook Neo, which bucks the previous trend of increasing RAM in low-end SKUs, and signals that software needs to be prepared to run in that configuration for a long time to come. I expect we'll see similar moves in smartphones if RAM prices stay elevated.

Re: Ask HN: Will programmers write more efficient code during the memory shortage?

#165
We sill probably see an increase in the use of OS-level memory compression tricks instead - things like zwap on Linux, for instance. Because the trend is usually to cure the symptoms, not the cause, as it is generally easier to set up and good enough. Makers who already have invested on memory-careless tech such as Electron won't rewrite; at best they'll just be replaced by better alternatives.

Re: Ask HN: Will programmers write more efficient code during the memory shortage?

#166
You must be joking.

Niklaus Wirth wrote his A Plea for Lean Software in 1995. Pdf at https://people.inf.ethz.ch/wirth/Articles/LeanSoftware.pdf

People did not bother and then the Web made everything worse. We are now so used to layers and layers of abstraction, humongous libraries and frameworks that most do not know anything about how to write "lean" software.

Nothing is going to change in the application/services layer.

Re: Ask HN: Will programmers write more efficient code during the memory shortage?

#167
I might be wearing my tinfoil hat too tight, but I think that market pressure will continue prioritising shipping worse code faster, especially now that with AI it's possible to ship code really fast. The "solution" to expensive hardware will be way less capable hardware and we'll end up with "thin clients" and all compute will happen in centralised "clouds". I hope I'm wrong

Re: Ask HN: Will programmers write more efficient code during the memory shortage?

#168
I don't believe so do for two reasons:

- everyone assumes their program / website is the only thing running at the machine at a given time, and dev machines are always more powerful than user machines

- it's not really lack of advanced data structures and algorithms that result in the bloat most of the time but the fact that programs and websites are delivered by large teams, there are dozens of submodules that are often loaded even when not needed, and doing it properly is hard to architect to without getting into big complexity and gnarly bugs waiting to happen when someone from other team modifies something and does not know full picture. So it's cheaper to just keep things the way they are to reduce complexity of architecture and fragility.

Re: Ask HN: Will programmers write more efficient code during the memory shortage?

#169
post #145

Earlier quoted context omitted.

The programming language can have definite business impacts. It can impact hiring, salary costs (if the skill is rare), ramp-up costs (if it needs to be taught), etc. Even bus-factor comes into it.

Software engineering is an important skill to recruit for. Too many times I see "Java Developer"... Like, do they only know Java and are absolutely incompetent when it comes to something else? I don't even want to recruit or be recruited with such a title.

Yes, but even then there are people who will ramp up faster.

If the company is using Common Lisp, do you have the 6-12 months to wait for them to ramp up, or do you hire someone who has done Lisp before? That is downstream from the technical decision to use Common Lisp, but it is a huge business impact.

Post reply on HN