Programmers love to write code
James Somers, a writer and programmer, wrote a fantastic essay on the state of software engineering called
The Coming Software Apocalypse. This is a TL;DR version of his essay.
The essay argues that the way most computer programs are made is unable to cope with the scale and importance software has in modern societies. The author interviews notable figures in computer science and programming, and outlines some of their ideas to improve software design.
I learned many things thanks to this essay. Below are the key pointers I took from the article.
1. Manually writing code is doomed. Focusing on typing code distracts software designers from thinking about higher level requirements. Software designers should be able to think and reason about what the software does, instead of fighting with implementation details.
2. Model-based design is a method for creating software through simulation and automatic code generation. A simulation environment which includes relevant components (for example electric motors, sensors, integrators, logic gates, etc.) is developed. System designers use that environment to specify, design and iterate on the system. The tool automatically generates machine code. This method was developed for critical missions in aeronautics and the military. It is largely ignored by the broad software community.
3. TLA+ is a formal language that describes what a computer program does in terms of a state machine. TLA+ claims to be:
- Precise enough (more than paper specifications) so the developer can spot problems and shortcomings in their thinking before starting to code.
- Abstract enough, so the developer can focus on the logic of their thinking without bothering with specific implementation details.
4. Cultural challenges. The adoption of such methods is culturally challenging among software developers. Possible explanations:
- A lack of education.
- Programmers avoid what looks formal or mathematical.
- Formal inspired tools look unfit to the eyes of pragmatic people like programmers, who are used to deal with messy situations, far removed from ideally defined problems in academia.
- Automatic code generation has a bad reputation.
- Programmers love to write code.
- James Somers, The Coming Software Apocalypse, The Atlantic, 2017.
- Hacker News thread about Somers’ article. It is possible to find interesting feedback in the comments.
- Leslie Lamport, TLA+. Official homepage with educational resources.
- What is model-based design? (PDF), 2013. Commercial brochure about model-based design.
- Airbus A380 Landing Gear Drop Test (YouTube). This video shows a real test of the A380 landing gears. It is safe to assume that such test is conducted only after many computer simulations. Conducting such tests without previous simulations would be costly and unpractical to say the least. As a side note, I wish there were documentaries about the specification, design and simulation stages of such engineering projects.