in reply to Questions from "Coders at Work"
- Having learned programming by myself, I have no idea of any book which is an absolute "must have" for programmers. I do have Knuth though and read volume 1 and parts from volumes 2 and 3. Some parts of it are now very much outdated, but the underlying assumptions and ideas are still valid.
- I tried literate programming, but it did not sit well with me. Never proved my code correct in a formal way. I do write tests of course.
- I'm a lawyer, but with an interest in mathematics and science. Actually lawyers will make good programmers as we are trained to analyse cases, then synthesize a solution and "language" is our main tool. Whether it is "natural" language or computer language doesn't make a bit of a difference. Also lawyers are trained to apply rules (the rules of syntax and grammar of a computer language are much easier to apply than the rules of a code of law).
- I rarely had to do that, but I first try to get a broad view of what the code is doing --grokking it as it were-- and then going into details where needed. I only (read) code because I find it fun to do.
- No set way of doing it. Most of the time I get a mental picture of the program I need to write and then just start writing it.
- I have no idea.
- Powers of analysis and synthesis, are in my opinion the major skills needed.
- A combination of a craftsman and an artist, but isn't that true for anything?
A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James