Live data from Hacker News

Ask HN: Is average code getting worse?

news.ycombinator.com

41–50 of 86 posts

Re: Ask HN: Is average code getting worse?

#41
Maybe it's not the quality of code that has slipped but the quality of the sources you're relying on?

I tend to rely as much as possible on the standard library of the languages I'm using (especially for Python and C++, which ships with a pretty good set of libraries already), and when I have to go beyond that, I try to vet libraries as carefully as possible.

If a library deals with problems I know are going to be tricky, I try to take a peek beforehand at how it approaches dealing with those problems. If the approaches look obviously simplicistic/broken, I can save myself some time.

But when I want to deal with truly hellish code problems, I let my 8-year-old sweet-talk me into installing just one more mod into his Minecraft installation...

Re: Ask HN: Is average code getting worse?

#42
I think we are seeing code stick around longer than ever before in the personal computer/mainstream era of computing, which has led to more ways to hit buggy, unmaintained code than ever before. Hear me out:

If you wrote code for desktop computers in the 1980s, the platform you wrote code for probably didn't exist for longer than 5-10 years and the code had to target the CPU/arch directly because anything else was too slow. Your C64 library wasn't going to be reused on an Amiga or IBM. So any code older than ~5 years old just sort of died off. No support needed.

If you wrote code in the late 80s/early 90s, the hardware platform was starting to stabilize around the IBM PC, but the GUI layer was in rapid flux and languages were relatively immature - Windows 3 or OS/2? Protected mode? Windows 95? 16bit vs 32bit? Would C++ win? Even basic stuff like playing sounds (Adlib? Soundblaster?) or what graphics card to target (EGA? VGA? etc.) was in constant flux. Software lived a short life.

By the mid/late 1990s, the OS was stabilizing (mostly around Windows 16-bit) and basic hardware for video and sound had shaken out, but now we have the internet on the scene and a whole new round of immature and one-off tools. Remember WinSock? Netscape Navigator 4? Java applets?

By the early 2000s, 32bit Windows and OSX were on the scene and desktop software was mature in a way we rarely see anymore, but we were in the last days of single-user desktop software. Momentum was moving towards the web and software designed with the internet in mind. The mature desktop software of the early 2000s would mostly be abandoned as people moved to the internet and expected different things from computers.

By the late 2000s, we have the full-on mobile device wars with iOS, Blackberry, Android, Windows Phone, Palm, etc, all fighting over new ways of presenting software to users and all using different software approaches to make that happen. Iteration was incredibly rapid. APIs and languages changed quickly. The UI bar was raised significantly.

But around 2011-ish (10 years ago), things really started to shake out. The internet was relatively mature. iOS and Android became a duopoly. Linux became the standard for deploying web backends. Desktop software is largely dead at this point except in niche/creative industries. Rapid development moved toward new areas (AI/ML, etc) but the foundation was pretty stable.

The difference between now and 10 years ago is OSX Lion vs. Big Sur and Windows 7 vs. Windows 10. Hardly a fundamental change. People used Chrome to browse the web then and they still do, now. People mostly used iOS and Android then and they still do.

In 2011, web devs were mainly targeting Linux to run Python, Ruby, PHP, and Javascript. HTML 5 was finally a real thing. MySQL and Postgres were hot. Memcached and redis were cool. Some people used Mongo. The Windows crowd was using C# on .Net 3.5. All of those things have evolved over the last 10 years, but aside from Javascript, they are just iterations and are basically what we still use today. (Javascript of course has gone crazy, but that's a different story.). Maybe now you target a container instead of a bare machine, but the ideas are basically the same.

So my premise is that mass-market computers have broken compatibility less over the past 10 years than ever before. Along the way, more open source code has been released than ever before by a huge factor.

We have a situation now where new generations of developers are coming up and writing their new code for the same basic platforms as the previous generation. The old code still more or less works fine, but may have lapsed into unsupported territory. The new code more or less does the same thing, maybe in a slightly different way. There's more code than ever to maintain and not enough time to maintain it.

So now the number of libraries you can choose between to solve any problem has multiplied to the point where the surface area needing bug fixes and maintenance has become untenable. The hottest Django library that everyone used for file attachment uploads in 2011 has been replaced by 10 newer libraries that half-work and then those were replaced by 400 javascript versions of the same idea. And all that half-supported code is still sitting on Github, just waiting for you to include it in your project and cause yourself headaches. There's often no good way to know which library is mostly likely to work reliably and sometimes none of them do.

Another symptom of this phenomenon is that when you google about a bug or error, you often get 10 year old Stack Overflow answers that sort of apply but are also totally out of date and lead you down the wrong path. Attempts to update the question get deleted as "already answered". So now we not only have bugs to fight, but we have the endless perpetuation of wrong answers to long-since fixed bugs getting copy/pasted into new code forever.

In the past, the constant platform churn let us avoid this problem because the old software would just break and be obviously useless. But now that the basic platform is more stable and software is sticking around longer, we need to figure out better ways to deal with gradual change.

Re: Ask HN: Is average code getting worse?

#43
> Have you experienced something similar?

In 99% of cases when I noticed that they were third-party libraries.

Quality of first party ones, like Microsoft, Apple or Linux system APIs, is IMO mostly good.

Some third-party libraries are good as well. The problem is some others are not. For this reason I review at least public API, and ideally source code, before introducing new third-party dependencies.

Re: Ask HN: Is average code getting worse?

#44
post #6

I generally assume code is broken from the start now, but I don't think that this is because average code is getting worse. I think it's because there are more "solutions" to problems online (also, I'm more critical than I was a decade ago). In the past, I had to write almost everything from scratch, and that meant I'd have worse code than what is open-sourced nowadays for the time period that I was implementing (and…

> you can't just assume that because their solution solved their problem without running into edge-cases

I agree in general, but there’s a class of general problems with good solutions. Such libraries tend to just work. Like database engine, XML/JSON parser, multimedia codecs. If you pick the most popular and compatible one, like sqlight or libpng, you’re very likely get your problem solved without too many edge cases.

Re: Ask HN: Is average code getting worse?

#45
This is why I laugh about all those articles predicting the rise of "no code" and that developer roles would be taken over by click-together apps or some AI. With devices, use cases, privacy, userbase expanding the industry can't even keep up with hordes of actual professionals working on bespoke solutions. Even as the engineering market really exploded in the 2010s.

Re: Ask HN: Is average code getting worse?

#46
I don't think code has changed. Definitely not in the last 10 years. Sturgeon's law is much older than that :)

• Visibility and accessibility of software has increased. Repositories like npm and GitHub mean you can see anyone's weekend project. If you only got code from distros, curated repositories, that would have been a filter.

• It's a surviorship bias. Old libraries that survived must have been good enough. New half-baked libraries written today will either get polished and survive, or be forgotten.

Re: Ask HN: Is average code getting worse?

#47

Yes. Average code quality is objectively worse than it used to be, and there is an objective reason why. The barrier to entry is much lower. In 1995, getting a C++ program compiled, tested, shrink wrapped and shipped (in waterfall fashion) required a lot more work. The "survivor" software you bought on your floppy disk or CD-ROM at the store meant it was high enough quality to jump through all those hoops. Some of th…

I think a lot of it has to do with higher education as well. Most courses focus solely on theory rather than teaching the best industry paradigms for writing clean code.

Re: Ask HN: Is average code getting worse?

#48

This is why I laugh about all those articles predicting the rise of "no code" and that developer roles would be taken over by click-together apps or some AI. With devices, use cases, privacy, userbase expanding the industry can't even keep up with hordes of actual professionals working on bespoke solutions. Even as the engineering market really exploded in the 2010s.

The same could be said in the 1800’s where mills were popping up all over the place. Nothing was standardized and everything was designed and built by craftsmen.

Re: Ask HN: Is average code getting worse?

#49
post #16

Extended pool of engineers, as the field has grown, has diluted the quality of software. Post "Social Network" (the movie), and the economic downturn of 2008-2012 there is a new generation of engineers that started programming/entered the field because that's where the money is.... There is also proliferation of the code-academies, who often encourage trainees to create a 'github portfolio', often with low quality li…

If you suspect that greater expectations for easy money and prestige in the industry have lead to lower quality code, what else might fall from that? Would you also expect pockets of the industry where money and prestige were hard to come by (such as video games or experimental open source operating systems) to have better code on average?

Well certainly video games are much harder than what most software engineers are doing. And game developers have a strong incentive to carw about performance and efficiency and really push the machine to its limits.

I am currently working at a FAANG company and doing game programming on the side. The problems I am facing at my day job are mostly trivial compared to the game and graphics programming I am doing on nights and weekends.

Re: Ask HN: Is average code getting worse?

#50
I'm in the camp that would answer "yes" to your question.

For me, it went like this:

- The nerds did their nerd shit in the garage. Nobody saw them.

- Then the nerds figured out how to revamp many business processes with computers.

- Then those businesses needed more of that, so they started hiring other nerds.

- Not too many nerds existed because they're nerds and who wants to be a nerd? So therefore demand was high. What happens to the nerds' salaries when demand is high? Salaries are high.

- Now the nerds are making money. Tons of it. People started to notice that the nerds could sit all day and type at a computer (hey I can do that too!) but they make 100k more than I do.

- Eager to cash in on that nerd money, I start to google "how to code". Codeacademy, Kahn Academy, Udemy, and a plethora of highly expensive code camps show up. I pick my poison and begin.

- A Github profile is set up, my LinkedIn is updated, I have a few webapps under my belt, I'm ready for my interview.

- I get a job at Big Tech company as a junior position. A few weeks go by and I'm asked if I could help interview another candidate. Of course, I'm qualified enough right?

And the cycle continues.

This is how I perceived the shift happen. Code Camps were really detrimental since it became very difficult to vet actual skills vs. ability to pass coding interviews. When I worked at Uber this was a huge deal - a lot of people that had just finished code camps nailed the interviews but only lasted a few months because they had no idea how to actually do anything.

Of course it's all very nuanced and this isn't the only thing that happened (making programming "easier" certainly hasn't helped). But this was a large factor.

Post reply on HN