In this letter, Dijkstra talks about readability and maintainability in a time where those topics were rarely talked about (1968). This letter was one of the main causes why modern programmers don’t have to trouble themselves with goto statements. Older languages like Java and C# still have a (discouraged) goto statement, because they (mindlessly) copied it from C, which (mindlessly) copied it from Assembly, but more modern languages like Swift and Kotlin don’t even have a goto statement anymore.
For such an influential letter, I don’t find his arguement all that compelling. I agree that not using
go to
will often lead to better structured (and more maintainable) programs, but I don’t find his metric of “indexable process progress” to satisfyingly explain why that is.Perhaps it’s because at that time people would be running the programs in their heads before submitting them for processing, so they tended to use more of a computer scientist mindset - whereas now we’re more likely to use test cases to convince ourselves that code is correct.
I think it’s convoluted way to describe it. Very technically-practical. I agree it’s probably because of historical context.
The argument I read out of it is that using
goto
breaks you being able to read and follow the code logic/run-logic. Which I agree with.Functions are similar jumps, but with the inclusion of a call stack, you can traverse and follow them.
I think we could add a goto stack / include goto jumps in the call stack though? It’s not named though, so the stack is an index you only understand when you look at the code lines and match goto targets.
I disagree with unit tests replacing readability. Being able to read and follow code is central to maintainability, to readability and debug-ability. Those are still central to development and maintenance even if you make use of unit tests.
I wasn’t saying that unit tests replaces readability, I was saying that back in the 60s they’d reason and debug using their brains (and maybe pen and paper), with more use of things like formal proofs for correctness. Now that we write more complicated programs in more powerful environments, it’s rare to do this (we’d use breakpoints, unit tests, fuzzing, etc).
Removed by mod
Ah yes, the good ol’ days when developers programmed for efficiency.
Removed by mod
I get that but it seems as though no one cares at all about efficiency these days.
Removed by mod
Does the catchphrase “blazing fast” ring any bells? Some people care.
(Arguably that’s just the pendulum swinging the other way; Ruby, Python, and Java ruled the software world for a while, and I think that’s a large part of why the Go and Rust communities make such a big deal about speed.)