Does programming suck?
This blog post is a reply for Luis Solano’s post “Why Does Programming Suck?” that you can find at Medium. The original is a very long read so I summarise it here for convenience.
Luis’ main point is that computers and programming wasn’t really meant for what we use them now when invented. He describes the origins and evolution, the increasing complexity of our technology stack and some problems he sees with the current state of affairs.
To some extent I do agree with the core tenet of the piece. I too think we are unnecessarily hampered by legacy in our current work and that modern development could be made a lot nicer/easier/cleaner than it is.
But the wholesale idea that programming has to be remade, hardware and everything, feels a bit flawed to me. It’s like saying that cars, since they were derived from earlier forms of transportation likes horse drawn carriages, have to be remade from the ground up.
Sure, there are probably a few things we would change if we could start over with cars, mainly safety and environment related I’d think. But these things, the things we would change, though always present are never the same.
For cars there was a time when safety was not an issue. Environmental impact has not been a huge issue in the past. What will be an issue in 10-20 years I don’t know, but that is the point, we can’t know.
Gradual evolution of one form into another might not produce optimal forms at each step but is economical over time compared to starting from scratch every 10 years or so.
I can, and might in a future post, provide concrete examples of what I think should be improved and why. Luis doesn’t provide any solution example or even scope, even though it sounds a lot like he wants to start over at the hardware level.
If he wants to start over at that level it would be nice with some preliminary model of how we could do hardware better? He says that it’s pitiful that we don’t have first class support for strings for example. I for one have a hard time seeing how one would support something like UTF-8 in hardware? I might just be limited by my many years of thinking in our current solution though…
Basically it boils down to that “discussing” or bringing up a problem and saying it needs solving, without providing a suggested solution, is just complaining in my book. Even if that starts to sound a bit too much like “get off my lawn” even for me :)
I’d also like to address some specifics for the wrap up part of the piece that I think highlights some problems with it.
Software caused airplane crashes
How many more airplane or car crashes caused by software bugs do we need to convince ourselves that programming is a problem worth solving?
I know we have some really crap software in cars, and that is something we should REALLY get some regulatory body on right away. (Especially with the upcoming price wars on self driving cars. I bet not every manufacturer will keep to Google’s testing standards.) But airplane crashes?
As far as I know aircraft software is in the category of having to be provably correct, which mathematically eliminates any possibility of a bug in the software. This only leaves human error as the cause, either by an error in the spec or configuration of the finished software.
As for the Airbus A400M crash: It’s a military transport plane, not sure if they fall into the same category as public airliners. Also investigations show it’s the configuration of the software, not the code itself, so human error …
And for JAS, since I’m from Sweden, it was an experimental aircraft at the time. It might not have been the best idea to fly it over Sweden’s most populated city during a festival, but still not release software so …
Those are the only two incidents commonly quoted when googling this issue so I assume no passenger jet crashed and killed everyone due to a software problem. I think we would have heard of it.
Creating bug free software
If we invent better tools to create bug-free software that were easy to use, you could do twice as much for the rest of time.
So this one comes down to tradeoffs. We can already create provably correct software, it’s done for airplanes, traffic control software, power plant control systems etc. But it is expensive, time consuming and exponentially so the more complicated the system you are trying to prove.
You can trivially create tools to solve trivial problems in a guaranteed bug free way. The more complex the problems the more complex the tools and finally, to solve arbitrary problems, you have infinite complexity.
It’s just not mathematically possible, in the current paradigm, to do this and no indication that you can do it at all unless you reduce the primitives of the system to very few and restrict the syntax greatly.
It’s the same problem you get when trying to create secure systems. To make the system secure you have to reduce its usability and user friendliness. Just think of two factor authentication. It’s a great improvement over simple username and password, but it is an extra hassle.
If we reduced the need for communication …
Ok, but how? If we look at information theory we can prove that if you have a project that requires more than one person to execute we will have need for information exchange. We can theoretically create models for reducing the amount of information that needs communicating but we have several uncertainties here:
- Who are you communicating with? Different persons need different information, even for the same task. Some back and forth is needed or you will have to give the most information possible to ensure the receiver can perform his/her task.
- When are you communicating? Written documentation is for example communication with the future so it’s impossible to know the information needs when you write the documentation. Again you end up with having to give the maximum.
- How are you communicating? Different methods have different overheads.
So there is no way to eliminate communication and some forms of communication is very ineffective. We have also tried to minimise communication for decades now, with mixed success. So if Luis has an idea here let’s just try it? It’s not like it requires a new hardware design or anything.
Everyone is a programmer!
“Additionally, if we made programming so accessible that regular users could make modifications, you could spend less time adding and shipping features for only a small subset of users — they could do that by themselves.”
Ok, first thing first: Normal users do not WANT to be programmers. I know us programmers can’t really get this sometimes but ordinary users just want shit to work, WITHOUT having to hack or script or do any damn thing!
So they don’t want to, and they really can’t … This is the whole complexity vs. usability thing again. For something to be easy to use it has to be simple. Complex tasks require complex interfaces. Programming, at least as it is today, is an infinitely complex task.
I think that the point that is missed, often, is that you can solve any problem in an infinite number of ways… It’s like results in math; you want 42 (who doesn’t :)), how many ways can you get to 42 using any formula on the left hand side of
= 42? Any number of ways, trivially provable by the series:
42+1-1 = 42,
42+2-2 = 42 …
42+x-x = 42.
So if you have something where you can model pretty much anything, or at least a VERY large class of problems, and you can model any one of these problems an infinite number of ways, how do you make that simple?
We are talking about reducing infinity to a small fixed number without losing expressiveness. I just don’t think you can.
Solving the problem problem
Now from a qualitative point of view. Back in the day math was slow and error-prone and we created the computer. Now, it’s software development that is slow and error-prone. Back in they day math powered innovation. Today it’s software that powers innovation. Solving the problem of programming is the next logical step.
… the reversal of our problem-solving approach …
That’s like saying we need to solve problem solving. It makes no sense. It sounds good, in a politician kind of way, but what does it mean?
I agree that we still suffer from some of the reversal of direction that Luis mentions. Instead of solving a problem in the best way possible we model the problem so that it fits the solution, computers.
When you start looking at today’s solutions you generally find that they are pretty good as is and wouldn’t have happened without all the old, crufty hacks that they build on. It would have taken faaar too long to build it all from scratch in code, not to talk about trying to solve it with special hardware in every case.
I do get that if we had other means of solving problems we could solve other problems. But we are actively working on that as well. Quantum computers will allow us to tackle the realm of NP complete problems that we can’t touch today.
But engineering a new solution from scratch for every problem is too expensive to even be considered and engineering a new general solution will only end up in the same place: good for some things, less so for others. It’s the nature of the world that most things adhere to the no free lunch theorem (if some solution is optimal for one problem it’s also the worst solution for some other problem).
Imagine that we managed to make AI with the level of intelligence of a monkey––that would certainly be a huge technological breakthrough. Now imagine that we all went to play with the AI monkey and we completely stopped all development in the field of AI. You’d be pissed, right? You’d expect some people to keep working on improving AI because it could be much better, right?
Yeah, but that is claiming that no one has continued developing programming since the analytics engine? Which, reusing a metaphor from earlier, is like saying that a Bugatti Veyron is the same thing as a horse drawn carriage… This is simply not true, and not even what Luis claims in the rest of the article.
He is calling for a NEW look at the problem, like trying to solve the issue of transporting goods and people a different way from cars. So what we are looking for is the railway or airplane solution to the programming problem.
As pointed out in the comments to the original piece, and ironically Luis even links to “No silver bullet”, it is ALWAYS about trade offs. I bet we COULD find another way of solving these problems, probably several other ways. But would it be better?
Is airplanes better than cars? Or trains? They all have their respective strengths and weaknesses, they all solve part of a multifaceted problem. But is any one of them better? I know Jeremy Clarkson thinks so, but for the rest of us?
I think this is part of the trap that Luis falls into. This is not ONE problem. Computers are STILL used to do math fast and without errors. They are used to run automated control systems, robots, factories, trade stock, play games, post on facebook, make and connect phone calls and thousands and thousands of other things.
This is clearly not one problem, it’s a large number of different problems. The fact that we have on solution for all of them is pretty fracking amazing :)
It might be cobbled together, hackish and have plenty of faults. But we are also laying new chips, not on top of but next to older ones. Look at things like X.org replacing Xwindows to drop legacy support. Or musl libc that replaces the legacy libc. Nginx or httpd as an alternative to Apache. We are creating entirely new things on a very low level, not only paving over old crud.
I too think that there is a great many things we can do to make programming more enjoyable and easy, less error prone and more productive. I favour languages with an introspective runtime for that reason. I do not think we need to start from zero and I know we can’t, it’s just too expensive.
Only $0.02 as usual
There are many ways to look at this and without anything more concrete, like a proposed solution, to discuss it’s hard to get anywhere.
But I did think it worth pointing out that many parts of the problem Luis talks about are either being actively worked on by a lot of people or they have deep limitation on their solutions.
Some things are, unfortunately, not possible in the real world. One of the amazing things about computers and programming is that everything seems possible there :) I know it isn’t, but it hasn’t dampened my enthusiasm for the craft of programming in 20 years. And I don’t think it will.