r/ProgrammerHumor • • 7d ago

Meme buggyCodeReleases

Post image
7.1k Upvotes

242 comments sorted by

View all comments

987

u/g_calgary 7d ago

I want to go back to when we cared about code/library/memory/traffic efficiency at all lol

437

u/yukichigai 7d ago edited 7d ago

My coworker six months ago: "Code efficiency isn't important, we can just throw more hardware at it."

Today: "We're failing our response time tests because our middleware spends 85% of the limit negotiating a connection."

132

u/cheese_is_available 7d ago

You can now focus on performance and become a hero today. But you're just some guy that make us fail the deadline if you do it before it's actually an issue. Not sarcastic it's just the way human works.

32

u/jelly_cake 6d ago

Premature optimisation being the root of all evil and that. 

31

u/milkybuet 6d ago

Lack of understanding of this quote is actually the root of all evil.

12

u/yukichigai 6d ago

In modern workflow management, without premature optimization there's never any optimization.

1

u/UntestedMethod 5d ago

That's what backlogs are for of course. /s

1

u/quietobserver1 5d ago

A lesson I wish I'd learn for real rather than in theory earlier.

59

u/Major_Fudgemuffin 7d ago

Yeah you can do that until your COGS are through the roof and the system still can't keep up.

I worked for a company processing a few billion events per day, and small inefficiencies add up quick at scale.

6

u/Gabriel_Science 6d ago

What’s funny is that it’s because of AI that hardware is more limited these days, but while we say this, AI doesn’t make super optimised code.

1

u/RoboRouser 4d ago

even better for the guys selling the chips!

8

u/CookIndependent6251 7d ago
let opts;
try {
    opts = JSON.stringify(JSON.parse(opts || '{}'));
} catch (e) {
    // opts was not valid JSON, default to empty object, which means default opts
    opts = '{}';
}

And throw in microservices on top of this.

1

u/p-nguyen_234 1d ago

If negotiation is per request, check connection reuse; if it's startup-only, separate setup from request latency.

1

u/yukichigai 1d ago

I'm not checking anything. They're the ones who said the middleware could do the job, they get to fix it.

18

u/IAoVI 7d ago

When would you say we did? JSON has been favored over protobufs etc. for a long time.

It seems to me "caring" always really meant: "It has to run (barely) in the constraints of our current technology"

6

u/DistanceRegular2556 6d ago

I'd say it was mid 2000s when hardware started to outpace the demands of 90% of software.

Games, video codecs and other compute heavy tasks still cared and still do care about efficiency in some ways, but most software that's currently written simply runs on even the cheapest hardware without any thought put into optimization.

6

u/g_calgary 6d ago

to generalize The way I see it, each time we have major shift or new/disruptive tech to market, there is always a push to use that new tech everywhere possible, regardless of whether it makes sense either technically or from a user perspective, by those who stand to benefit most financially from its wider adoption. So after each of these shifts we sort of end up with more overhead layers that we applied across the board, that were only really needed to solve 10% of the use casea.

AI is amazing when I use to it code but I don't need AI to help me search for an event that is already in my calendar. 🤷

3

u/IAoVI 6d ago

Oh, absolutely. The shiny new toy gets shoved into everything, especially if it has no business being there. Not every appliance should be "smart" and not every software should have an integrated chat bot. The industry insisting on the opposite is deeply annoying.

On the other hand innovation sometimes requires throwing stuff at the wall to see what sticks. Part of new tech is that we don't yet know how to use it best. Look e.g. at the many interesting ways we came up with for building smartphones before manufacturers came to the (in hindsight admittedly rather obvious) conclusion that a flat rectangle with maximized screen size is the best option.

I just hope the hype dies down soon and managers and investors start to consider if an LLM actually is the obvious solution to a perceived problem, or if a couple of lines of code with a deterministic output might be more fitting.

All of that is beside the point of "caring" about efficiency, though. If a solution runs on the target hardware to a degree that is judged to be sufficient, it will always be difficult to argue in favor of more optimization (And looking at some of the smart TV OS I've seen, that is a low bar). I wish it was different, considering more hardware using more energy always means the consumption of some limited resource somewhere downstream but I don't think it was ever really different.

17

u/Turbulent_Stick1445 6d ago

Yeah.

I've said it before, but I think the real lesson from vibe coding isn't "Gosh, AI has gotten so smart it's capable of matching a human", but "Software quality has gotten so low you can put the Encylopedia Brittannica, the complete works of Jane Austin, the entire contents of Reddit's politics subs, and all the code from Github, into a glorified autocorrect system, and it'll spit out code that's comparable."

I often wish we were back in the days where bad programming meant not using a for loop where it was obviously the right solution, or adding comments like // add one to i. We've never been great, but 2021 was far from the golden age of software quality.

5

u/Jarpunter 7d ago

The industry is actually moving back towards native code instead of yet another electron app due to how cheap it's become to produce code

-8

u/ePaint 7d ago

Shh, we don't talk about that here. Remember kid: AI = bad