←back to thread

190 points baruchel | 9 comments | | HN request time: 0.207s | source | bottom
1. gwbas1c ◴[] No.44424165[source]
One thing that's surprised me throughout my career is just how inefficient most of the code that I've inherited is. I suspect we could do a lot more with the hardware we have if we simply became better at programming.

(Perhaps more AI coaching could help?)

replies(3): >>44424202 #>>44424776 #>>44428402 #
2. HideousKojima ◴[] No.44424202[source]
AI is trained on the same shitty code you're inheriting, so probably not.
replies(1): >>44424294 #
3. humanfromearth9 ◴[] No.44424294[source]
It's also trained on all best practices and algorithms that you don't know exist, so it is able to do better - provided you know to ask and how to ask/what to ask.
replies(1): >>44424721 #
4. HideousKojima ◴[] No.44424721{3}[source]
It's not simply a matter of knowing what/how to ask. LLMs are essentially statistical regressions on crack. This is a gross oversimplification, but the point is that what they generate is based on statistical likelihoods, and if 90%+ of the code they were trained on was shit you're not going to get the good stuff very often. And if you need an AI to help you do it you won't even be able to recognize the good stuff when it does get generated.
5. jiehong ◴[] No.44424776[source]
I'm also surprised by how many developers just don't seem to care much.

Yet, the general population isn't behaving like scouts most of the time, so I suppose it's only fair that developers also aren't.

"Leave the world a better place than you found it" (s/world/code/g)

replies(1): >>44426571 #
6. Agingcoder ◴[] No.44426571[source]
I’ve spent many years working on hpc problems, and most people simply don’t have , or don’t care about, or don’t know what to do with performance problems.

Don’t have to because they usually have a full machine, and unless they saturate it, the problem doesn’t exist.

Don’t care, because many people think it’s alright if things are slow, or inefficient ( the user can wait, or will live with 100ms instead of 1ms).

Don’t know what to do - this one is interesting : many people don’t realize it’s actually possible to get the same result , but faster.

replies(1): >>44426721 #
7. gwbas1c ◴[] No.44426721{3}[source]
> Don’t care, because many people think it’s alright if things are slow, or inefficient ( the user can wait, or will live with 100ms instead of 1ms).

It's not that.

I've encountered code where someone wrote complicated "scale out" code instead of learning how to use a database and fix the n+1 problem; or another case where someone wrote complicated caching code instead of learning how to avoid cartesian explosion.

replies(1): >>44431849 #
8. utopcell ◴[] No.44428402[source]
Given your username, I'm sure whoever inherits your codebase would share the same sentiment.
9. Agingcoder ◴[] No.44431849{4}[source]
Ah that’s nice a one - it’s ’do the wrong thing’!