by combatentropy · 6y ago · 0 comments
Same here, and I suspect the same for most people: "due to a series of historical accidents the teaching of writing has gotten mixed together with the study of literature" --- http://www.paulgraham.com/essay.html Toward the end of high school I found The Elements of Style by accident and it changed my life. Yes, it changed my life!
I was always more interested in art than science. So I didn't become a programmer until I was almost 30. What struck me was how similar it was to prose.
1. There are many ways to write a program
2. Your first draft of a program is usually bad, but you can steadily improve it by rewriting it over and over and over. This unglamourous technique is the secret behind good prose too, as Graham points out.
3. As you rewrite it, you find you can do the same thing in half the space.
4. The programs that are most pleasant to use are ones where the programmer first wrote it for himself. Likewise, as Graham said here, a good strategy for useful essays is to write it first for yourself.
https://norvig.com/sudoku.html
This is my all time favorite programming book, both for the prose and the code within it:
https://github.com/norvig/paip-lisp
Interestingly, I find that the set of Lisp programmers also contains many of the best writers about programming: Norvig, Graham, Stallman, McCarthy, Steele, Abelson, Sussman, etc.
In addition, I design my programs such that I can confidently rewrite important sections. This is OOP encapsulation's main purpose. In practice, everyone writes getters and setters until every object is an ugly struct.