stricter compilers
I just started reading The Best Software Writing I: Selected and Introduced by Joel Spolsky. The first article led me to Ken Arnold’s Style is Substance:
I’ll state it right out: For almost any mature language (C, Java, C++, Python, Lisp, Ada, FORTRAN, Python, Smalltalk, sh, javascript, …) coding style is an essentially solved problem, and we ought to stop worrying about it. And to stop worrying about it will require worrying about it a lot first, because the only way to get from where we are to a place where we stop worrying about style is to enforce it as part of the language.
Yup. I’m really saying that. I’m saying that, for example, the next ANSI C update should define the standard K&R C programming style into the language grammar. Programs that use any new features should be required to be in K&R style or be rejected by the compiler as syntactically illegal.
I really like that.
Of course I am all for creativity. Having spent way too much time in the past weeks (months) working through source codes that appear to follow all kinds of different style variations, I am getting tired of it though. Very tired. This is the wrong kind of creativity.
Being able to enforce a style guide directly via the compiler would be extremely helpful in this case. No more dragging everyone in a poorly ventilated conference room and trying to convince people that following a consistent style convention is A Good Thing.
No more arguing the merits of one style over the other. I mean - please!
In short: That article made my day. I am already looking forward to other gems in the book and I think I am going to look more seriously into Python. Maybe there might even be a point in at least considering a pre-compiler of sorts, some routine that checks the input source code for correct style, before sending it on to the actual compiler. Hm …
Leave a Reply