Ask HN: Have coders made stuff complicated on purpose?

46 points by ziggyzecat ↗ HN
Are we embracing imperfection and variations of it deliberately?

Or is it some kinds of fallacy to believe that simplicity has a rather obvious form?

It's more like "simple" isn't "simple enough", isn't it? The latter of which one can get to faster and from his own POV alone while true "simplicity" takes time and consideration.

62 comments

[ 4.6 ms ] story [ 144 ms ] thread
YAGNI has an acronym for a reason. Engineering, and over-engineering, is a mentally stimulating activity for many.
Which is strange, because I tend to feel like minimalism both avoids over engineering and is more mentally stimulating in practice.
To avoid making a complicated response, the answer is "Yes".
Modern day Kubernetes and React feels like a make work program
It’s amazing that we’ve flipped from “put the workload on the server to make it faster” to “run the workload on your midrange laptop over WiFi so it finishes in a quarter the time the server would take”.

That’s entirely due to “the cloud” and k8s and friends.

You're doing cloud and k8s very wrong if your midrange laptop can beat it. Don't blame tools for your lack of knowledge. It's a complex tool for complex situations, it's not its job to make everything super easy for you. Just don't use it or let someone who knows how handle it.
The thing about Kubernetes is: Its a cloud in a box. It re-implements a ton of the functionality that cloud platforms already offered. But, no one wants to host their own kubernetes, so you go to AWS/GCP/Azure, and you just end up duplicating everything.

But I think the industry is waking up to this; there's just a lot of sunk cost. Kubernetes makes a ton of sense, for some organizations, but if you're not hosting your own machines in a data center somewhere, its probably not for your organization and you'll always be better off just using the highest abstraction level non-k8s primitives your cloud provider offers.

React: Is in a different league. React solves legit problems. UI is hard. React doesn't create zero problems of its own, and some of those problems are of the "we thought redux was the best way to think about this, we were wrong, but now there's a billion lines of redux out there" variety, which sucks because it was self-inflicted. Also, you've got the Vercel folks entirely convinced they're God's Gift to Humanity steering the ship in directions no one really wants. But the core of React is really good: fn(state)->ui.

React at its core is great. Redux is great too, as vanilla React becomes messy even for moderately complex single page apps.

Whatever it’s evolved into now is a different monster.

> is it some kinds of fallacy to believe that simplicity has a rather obvious form

There definitely aren't enough people deliberately obfuscating to make it a generally visible cause of complexity; your quote here rings far more true to me.

For example, "refactoring" as a task very frequently just trades one set of things, often aesthetic things, for another -- it is rare to find any obvious best expression.

I recently talked with a colleague about documentation. We both studied math and were frustrated about the lack of documentation from our predecessors. I discussed with them very often the topic but both we resisted. One was claiming he writes "self documentated code" and the other one was smart but wrote none approachable code.

I guess the difference that (in Germany) math exercises cares more about reasoning and explaining while in CS / informatics solution is only the tested result. So yes, coder make the world more complicated ;)

"self documentated code" is probably the biggest lie that the Clean Code gang has managed to indoctrinate generations of programmers who just don't know any better.
Given enough experiences of documentation diverging from reality - the system does not behave how the docs claimed it should - people lose faith in the documentation.

That may explain the sentiment that the code is the documentation. There may be some html or pdf with "documentation" in the name, but if it's inaccurate, you're going to end up looking at the code anyway.

If that's your experience it makes writing documentation hard to justify. It's a poor approximation to reality which becomes steadily less true over time. So really what's the point.

We need something closer to live documentation which runs the examples against the codebase and fails CI when they stop working to have a chance. Some projects do that. Deriving docs from comments helps a little but comments are often wrong too.

People unfortunately do this all the time for job security.
Q: "Why was this written in such a way that this logic that could have been one function is spread across 3 libraries using 3 different frameworks, one of which requires me to run a JAR file to install an Eclipse plugin before it will even compile?"

A: "Job security ha ha ha"

(paraphrasing of an actual conversation I have had multiple times with coworkers)

I think it's a fallacy to believe to that simplicity has a rather obvious form. From the view point of a SaaS developer, at some point you have to add a bunch of business logic that is determined by what's needed to satisfy requirements. Those requirements can be pretty complex.
Do you have an example of what you mean to make this a bit less abstract?
Some of it is deliberate. The quickest thing to hit the current deadline often involves leaving complexity behind.

Some of it is incompetence.

Occasionally there are claims that it's deliberate attempts to make the author look more valuable though I haven't seen that in practice. Hopefully it's a myth.

Some of it is indifference. You're sufficiently beaten down by the environment that you no longer care about the product.

Also the underlying problems are sometimes very complicated in which case there may be no way to make the solution simple.

All of your points are quite valid, although unfortunately I have seen attempts to make the author look more valuable; not a myth.

But all of your points are still valid and important parts of the problem.

The "job security" joke is probably rooted in reality. Lots of jokes are. I may be fortunate to have not run into it, or merely not observant enough to distinguish it from incompetence.
I think most people are in a position where coding more productively only makes then more secure in their career as opposed to thinking about how they can be deliberately counter-productive.
There are two forces at odds with each other that are making things overly complicated.

1. A need for standards

2. The industry being too immature for standards to exist and those that are created rarely stand up to the test of time

Look at standards from the late 80s / early 90s, most of it was not prepared for what software has NEEDED to change to.

Look at most programming languages, designed to only run on one machine, when a vast amount of software is designed with high-availability in mind.

Look at most databases, designed to have only one writer which is a huge bottle neck.

Now we need software to coordinate all this software that was designed to run by itself...

Finally, in the pursuit of perfection, we test new ideas in the open, the latest UI framework, a new database, a new paradigm... We are doing the scientific method on NPM and your organization is a part of it :)

Look at how much small teams accomplished in the 80s and 90s. I don’t mean rockstar teams where you know the names of some of the developers on them, today—normal-ass boring line of business stuff, applications that you maybe know but with no famous names attached, that kind of thing.

Consider how much more efficient we should be with allegedly-better processes and allegedly much better tools.

Look at some of those and estimate the team size and time to complete it now. Consider whether you could even deliver the same thing (say, native applications on two or three platforms) with double the team size and thrice the time, or whether you’d have to compromise and deliver something worse to make that happen.

There’s your answer.

[edit] though actually I think part of this is also because we’re on-average worse at managing companies overall, too.

I was part of such team. We supported one target only - Windows NT 3.5 and better, full-screen resolution 4:3 between 800x600 and 1280x1024, and database was the client's problem - we told them what version of Oracle they have to buy. Is it slow? Probably because your network or server is slow, have fun troubleshooting. Yeah, we were a very performant team because we constrained the project a lot and pushed quite a big chunk of it to the client.

Today I work in a team that supports a wide array of operating systems, device form factors, resolutions and aspect ratios, input methods; we maintain the backend and it's up to us to make it secure, performant and fast for users from anywhere in the world; and of course API access. Customer data doesn't fit on one disk and their processing can't be done with one machine, and they have a globally distributed workforce. We are slower because we do much more.

Yeah I feel like people just don’t understand that the efficiency gains have not kept up with the scope of problems we’ve been tackling and that’s why it feels people used to be great.

Games yesterday: worked on certain HW, sound probably required you to jump through hoops to get working, and networking maybe worked on a LAN. If things crashed it was fine because that’s the only thing you ran anyway. Cutting edge graphics for the time but at that time showing an image or playing a video was also an achievement.

Games today: supports HW from at least 2 GPU vendors, an insane amount of resolutions and typically basically the same code for PC, PlayStation, XBOX and maybe even Linux and Mac. Sounds and graphics just works. Networking lets you play with people across the continent over the public internet. Oh and the time and effort invested in graphics quality is insane.

Teams yesterday: highly motivated engineers who were extremely talented and new every part of the machine

Teams today: a mix of highly motivated engineers who are extremely talented with many more who just want their paycheck and to go home of very varying quality of talent. Same expectations of excellence. Machines have gotten very complex that cutting through abstractions is challenging

Infrastructure yesterday: sell a database and the business is responsible for maintaining it and having it run well with onsite domain experts to help

Infrastructure today: sell almost anything so that you need almost no understanding and expertise of the software you’re utilizing.

> Teams today: a mix of highly motivated engineers who are extremely talented with many more who just want their paycheck and to go home

These two are not mutually exclusive.

> of very varying quality of talent

You missed a key part of that sentence. Also, there’s a huge difference between two engineers when one is super motivated and engaged by the work vs someone phoning it in.

    We are slower because we do much more.
Yeah. Ultimately, two or three people could still write a "simple" single threaded single user app with constraints similar to the Windows NT app you describe.

But hardly anybody would buy it or want it.

With today's technology I can do myself in hours what used to take our team weeks or months. But indeed, nobody buys stuff like that anymore.
Even things like games! Some great games were developed by single programmers back in the 80s and 90s. And then maybe ported by one or two other programmers to computers like the C64, Amiga, Apple II, Atari 2600, ZX Spectrum, Amstrad, Atari ST, NES, and/or Sega Master System.

Today, a team of 40 struggles to release a workable game on one system that has to be patched on day zero because of all the bugs. And porting it to even one other system (with the same CPU architecture)? Forgetaboutit.

Is this real? You’re comparing AAA games of the Atari era to AAA games today?

You can argue that the game companies are focusing on hyper realism at the cost of fun games, but the games we’re playing today are orders of magnitude more complex than in the Atari days. Those Atari games built on today’s technology would take comparatively little time and could be as easily ported. That likely also explains why the game industry is focused on limit pushing AAA titles. It’s a defensible market position of technical advantage whereas competing on “most fun” puts investment dollars at risk because you can be undercut by an underdog more easily. So the big companies just focus on the places where it’s harder for upstarts to compete and why almost all games look and feel very similar.

I don't get why more AAA games aren't available on Mac & Linux. For those that use Unity, Unreal or Godot: you just change the build target! Though for bespoke engines, I can imagine creating a new platform backend would be a lot of work.
Yes, managing software projects had changed, I think. In particular, I see a lot of companies and software projects got influenced by Google Style of Software engineering. Which is a uniquely good fit inside Google and a bad fit outside.

Once they bring Basel, Go, Tensorflow and C++ into projects and start refactoring and perfecting theseNamesThatJustHaveToBeCorrectAtTheLevelOfExcellenceThatCanGetAPlusTwoOfXooglerPrinciple then their complexity and costs get to the level of a software engineering project at Google. Without having the quality of engineering workforce and infrastructure that Googlers enjoy.

Not a change to the better in the software sector management, in my opinion.

Yes, and, with a handful of them being mouthpieces backed by cloud providers, they've actually convinced most people that complexity is the way.
It’s hard to do anything on purpose. While certainly possible, people tend to spend time on what they view as actually important, and I suspect most people don’t view creating something intentionally overcomplex as being important. So I’d say it’s unlikely.
No I don't believe so. After a ridiculous amount of time thinking about this over the last couple of decades, I really think that it's just harder to see and think the simple, especially when corner cases start showing up. Combine this with the fact that we have (and continue to produce) abstraction layers over in order to "simplify" it to a manageable level, and you quickly get to high complexity even when you don't want to.

It takes more effort and time to produce simpler solutions, and generally speaking as an industry, we're way balacned toward speed over quality. We basically only care about "quality" as far as it has direct customer impact. It's relentless optimization for the short-term over the long-term, and it leads to complexity.

Embracing imperfection is part of having simpler systems. Even for the simplest of domains, a perfect solution will be complex.
I don't think simplicity has a rather obvious form without experience. In my opinion, one needs to go through many years of experience to be able to predict when something is too simple for the purpose, and when it's not simple enough.

That gut feeling only comes through pain, aka experience, botching a refactoring you thought was brilliant to simplify code, and realise there were reasons for it to be overly complex. Experience working with overengineered code that takes a while to realise it's actually much simple than what the code is telling you, and can be thoroughly simplified.

Over many cycles of those experiences I believe one can start developing a sense of form for what's good simplicity.

Another point is it comes from the experience of reading vast amounts of code, from many different skill levels/sets.

Simplicity takes time and consideration from experience, I don't think you can jump the step of building experience to be proficient at it.

Typically what I’ve see most often is: considering coding as a satisfying hobby, combined with the tendency to generalize into a properly sorted ontology, which leads to prioritizing the pleasingness of the code rather than the fitness of it to the current purpose. This is excellent, if the coding is in fact for a hobby, but it is often misapplied in other contexts. https://xkcd.com/974/

“Simplicity” can also be defined any number of ways, but is most often defined as “Maximally pleasing simplicity” rather than “Fewest moving parts simplicity”, in part due to misestimating how total volume of moving parts is an exponential complexity modifier when one is not already familiar with the mechanisms. https://xkcd.com/2501/

I have personally been in teams where, when I questioned whether or not we really needed Shiny New Thing, I got a ton of pushback, most of it not very persuasive. I have even heard programmers criticize the state of the code when they joined the company, saying "there just wasn't much code...".

You get what you reward. Our industry rewards more keywords in your CV. Therefore, people try to get as many keywords as they can.

Sadly, it ends up going pretty deep, too.

6 or 8 years ago, I was a second level manager looking to find the next managers in my group. There was an engineer who was great at mentoring and was exceptionally practical. What do I mean practical? I repeatedly saw her going to her PM and saying things like, "If we can skip this one feature, we can get the other dozen done in a week instead of a month and there will be less than half the code to maintain." The PM was more than happy to do this because he had a lot more features in the pipeline that he wanted to get to, and giving up that one meant getting a bunch more.

That engineer initially turned down becoming a manager (a couple of years later, she became a great manager!). Her reason was that she felt she was the least capable engineer on the team, and she wouldn't know how to coach the better engineers. This confused me, so I asked why she felt she was the worst. She literally said, "[name redacted] can stay late and write a 1,000 lines of code in an evening. I haven't written a thousand lines of code in the last quarter." I had to explain that it's entirely possible that that person is a better programmer, but not a better engineer - they are not the same thing. And, that prolific programmer hadn't shipped a feature in months.

Features, at least good ones, are an asset. Lines of code are a liability. You need the features to be valuable enough to pay for the ongoing cost of the lines of code. This engineer understood this intuitively, without realizing it consciously. The prolific programmer did not get it at all.

So, even as I was trying to build a culture of better engineering (i.e., finding better trade-offs, including limiting complexity), these broad ideas about complexity==good were in the way, deep inside people's heads. Being able to foresee and head-off complexity is an incredibly valuable skill. Sometimes the complexity is worth it, but so often it's not.

Complexity stems from ignorance.

if someone isn't knowledgeable about the problem they're not going to be able to select the most simple solution.

if someone isn't knowledgeable about the available solutions there's a higher chance they'll implement an unnecessarily complex solution.

now multiply this over time and you get a code base that is really good for everyone's job security.

multiply this by millions of code bases and you get a really good tech economy.

I think complexity slowly developed over time to address certain needs of the time. Partly because software has been needing to do more. People and institution have become completely dependent on ease-of-use. When that happens software needs to be coded to be dummy proof and to have a large feature set. The second part is time. Programmers have need to find ways to decrease the amount of time programming takes to have free time to do other stuff, that causes programmers to rely on frameworks that are already established and creates a new market for coders to want to save time. Frameworks need to be complex to address a myriad of needs.
It comes down to the power of incentives. As a developer, there is no incentive to make code simple. It's subconscious. Coming up with near-optimal solutions that are more maintainable in the long run takes time and effort. Most developers will happily sacrifice long-term maintainability to deliver fast short term results... Anyway, if the developer churns out code at an impressive rate for a few months, they'll probably be promoted to management and someone else will have to take over the mess they created.
Depends upon what system you work on. I always worked on "large" systems that do not have a GUI type environment.

But today's "get it done now" outlook encourages complexity. That was always around, but ....

About 20 years ago or so, it was OK to get things done right and be a little late. Now seems this "get it in now, do worry about consequences", then "Well we have issues, create a request and will will get to it later". But later hardly ever comes, so the users are stuck.

So here we are, everything is complex, no time to think about what you are doing.

Unix had the KISS principle for a reason -- people weren't "keeping it simple, stupid".

In the '10s, everyone was talking about "webscale". VCs noticed that we could write software for hundreds of thousands of occasional users instead of a core group of a few thousand users.

We thought we were making UIs to help people do stuff, but we were really making little feeler apps for vertical integration for corporate interests.

Stuff like big-data and kubernetes looks overcomplicated if you believe the sales pitch. The "tech set" is negotiating for control over business.