Live data from Hacker News

Ask HN: Is average code getting worse?

news.ycombinator.com

31–40 of 86 posts

Re: Ask HN: Is average code getting worse?

#31
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?

Re: Ask HN: Is average code getting worse?

#32
post #9

Preface: I've worked on code ranging between FORTRAN 77 to a rather nuts react, typescript, webpack,... combination. From my experiences, what I have observered first and foremost is that the problems that software is solving are getting more complex as time progresses, causing software complexity. That is often proportional to the number of bugs. Many popular FORTRAN packages out there solve a particular (or set of)…

I see TypeScript more as a bandaid patch which solves small problems but causes bigger future problems than it solves. TypeScript and its many dependencies add to the kinds of compatibility problems you allude to.

I'm a strong believer that the language's type system doesn't matter that much. Statically typed or dynamically typed. It's possible to write equally good quality code in both paradigms. The key to good code is logical separation of concerns (high cohesion) and simple interfaces which have simple parameters and return values (loose coupling). Also, having well defined concurrent event loops is important if your system requires a lot of async logic.

The obsession with TypeScript now is mostly the result of the fact that people have a tendency to blame tools (dynamically typed languages in this case) for their own incompetence.

Re: Ask HN: Is average code getting worse?

#33
post #22

Earlier quoted context omitted.

Interesting that you should mention device support as a cause of more complex code, as the best way to support the devices you list is generally to use LESS code. Bare HTML is supported by pretty much everything...

But for some reason it's not cool to use HTML. We throw on megabytes of code just to bypass the page reload so that we can better control the user experience. This is why we end up with complex and bloated libraries like React and end up with a frontend and backend state that have to be kept in sync. I wish we went back plain HTML, especially for sites that don't need to be dynamic.

Browsers shouldn’t let you bypass reloads outside of the window unload event, and that is standardized and doesn’t leave much room to mess with. Can you elaborate if that was a real thing you are referring to?

Re: Ask HN: Is average code getting worse?

#34
post #26

Here are some quotes of people complaining about "youngsters these days". 1. The world is passing through troublous times. The young people of today think of nothing but themselves. They have no reverence for parents or old age. They are impatient of all restraint. They talk as if they knew everything, and what passes for wisdom with us is foolishness with them. As for the girls, they are forward, immodest and unlady…

OP's comment has nothing to do with "youngsters these days" but with how code is nowadays vs at the past. Unlike humans, there are changes in how code is produced, what it targets, where it runs, the motivations behind writing it, etc.

E.g. to expand on what others have mentioned, having to target Windows on a desktop PC with regular monitor at around 800x600 or at most 1024x768 resolution and a mouse for English is a bit different than having to target any desktop OS, any tablet OS, any mobile OS, perhaps also provide a web-based version, with a UI that works under resolutions ranging from ~1366x768 up to ~5120x2880 on monitor sizes ranging from 5" to 55" (or above) and inputs handling that includes keyboard, mouse, touchscreens, TV remotes, etc while having support for unicode, multiple languages, emojis, etc.

Even with the exact same people (which certainly isn't the case) writing the code, the latter is going to have much higher likelihood for bugs and other issues to crop up.

Re: Ask HN: Is average code getting worse?

#35
Not sure what you are doing but i don't think things got worse. They just changed.

Compare the situation on the web.

The days of Ie 6, polyfills and all that garbage are mostly gone. Browsers are an order of magnitude better than ever.

On the other hand you got the frontend js situation which is broken beyond belief. I dare you to pick any js framework and try to update it a version...

If you skip that and use the old and tested stuff, things are just way better than 10 years ago. Just compare Rails or Django to Jsp...

The god awful PHP std lib is still the same, but they clobbered some sort of object orientation and static typing onto PHP. So its as bad as ever and the libraries reflect that.

But in general whole library situation improved massively. Nowadays i can file a bug report on Github, or just fork it, get it fixed and make a merge request.

Back in the day you had to join someones IRC, talk to someone else who had the stuff on its cvs or whatever (hopefully) and then you wasted your day just fiddling around waiting for some random person to build a binary with some obscure version of a c compiler.

So there is more crap but the good old stuff matured and got way better.

There are better ways to discover problems for example it became quite the norm to use version control, a CI and automated tests..

Re: Ask HN: Is average code getting worse?

#36
Talking about averages is really tricky when the total amount of code/libraries is growing rapidly. In general though I think all of the following are true:

1. The number of high-quality libraries available has increased substantially. 2. The variance has also increased substantially. 3. The AVERAGE quality of polished libraries has gone down.

Basically, the number of open source libraries has exploded over the past decade or so but the majority of new libraries are of low quality because they are slapped together or only half-baked and then abandoned. But it is easier than ever to find high-quality open source libraries for any use case you can think of. In other words, things have never been better but you cannot assume that a library is of a reasonable quality just because it is published as an open source library.

Re: Ask HN: Is average code getting worse?

#37
post #26

Here are some quotes of people complaining about "youngsters these days". 1. The world is passing through troublous times. The young people of today think of nothing but themselves. They have no reverence for parents or old age. They are impatient of all restraint. They talk as if they knew everything, and what passes for wisdom with us is foolishness with them. As for the girls, they are forward, immodest and unlady…

This misses the mark, for reasons I can't see why. Maybe let's compare code 8 years ago to 4 years ago to today.

I did Android dev. 8 years ago it was a nightmare. To download an image, you had to build your own async thread, transfer the bits, resize the image, and then make sure there aren't any memory leaks and keep it small enough that it doesn't suck up all the RAM and crash the device.

4 years ago, it was easy. Just plug in the URL, and where you want it to go and it'll handle all the above + caching.

Today we have Android Jetpack. Now MVVM architecture is the default. Everything is cleanly handled - we make sure that there's no memory leak when someone makes a call within the half second it takes to download the image.

But for some reason, code is more tiresome to write. A single page used to be 2-3 files, now it's easily 12 files. Trying to debug a problem means sifting through those parts. The fact that we can code a full feature in 5 min means that very little thought is going into whether this feature is necessary, has side effects, or the responsibilities of the different parts. Budgets have gone up too, and now you can expect to deal with a freelancer from Qatar or Ukraine or whatever who builds a piece just fine, but nobody remembers how it works or whether this part was built correctly.

I'd say that the individual parts work fine but as a whole, they go together poorly.

Re: Ask HN: Is average code getting worse?

#38
post #22

Earlier quoted context omitted.

But for some reason it's not cool to use HTML. We throw on megabytes of code just to bypass the page reload so that we can better control the user experience. This is why we end up with complex and bloated libraries like React and end up with a frontend and backend state that have to be kept in sync. I wish we went back plain HTML, especially for sites that don't need to be dynamic.

Browsers shouldn’t let you bypass reloads outside of the window unload event, and that is standardized and doesn’t leave much room to mess with. Can you elaborate if that was a real thing you are referring to?

I assume the parent is referring to the rise in popularity of single-page applications.

Re: Ask HN: Is average code getting worse?

#39

Not sure what you are doing but i don't think things got worse. They just changed. Compare the situation on the web. The days of Ie 6, polyfills and all that garbage are mostly gone. Browsers are an order of magnitude better than ever. On the other hand you got the frontend js situation which is broken beyond belief. I dare you to pick any js framework and try to update it a version... If you skip that and use the ol…

It seems like you're comparing the current situation to more like ~20 years ago than ~10 years ago.

In 2011, both Rails and Django were well established and used heavily.

And in 2011, not too many people cared about IE6 either (some did, but even the big sites didn't support it anymore).

Even GitHub was used quite a lot in 2011, and was well known.

Still, I think you're right, it's just a different time scope...

Re: Ask HN: Is average code getting worse?

#40
Hum... Probably 10 years ago you were using a highly curated and very small set of dependencies, written by some of the top experts on your ecosystem, while nowadays you are using that same set plus a huge amount of code you download at random from the internet.

The many different communities of programmers made that transition at different times, but very few dependencies was basically the only model available at the 80's, while the tons of dependencies is the model basically everybody uses nowadays (the amount of stuff embedded software imports nowadays would surprise a desktop GUI developer at the 90's).

Post reply on HN