5 ms·
The article went in a different direction from what I was expecting, but leaving aside J, the original motivation — the topic of writing programs by hand (I mea
by svat 9y ago
The article went in a different direction from what I was expecting, but leaving aside J, the original motivation — the topic of writing programs by hand (I mean with pen/pencil on paper) is interesting to me.
The only person I know to regularly write even large programs by hand is Donald Knuth. This includes the early heroics of his college days ([1][2][3][4]). It includes TeX and METAFONT which he wrote in the 1980s over several months, before typing them in. (Corroborated right here on HN [5] by David Fuchs [6] who worked very closely with Knuth on TeX.) I'm pretty sure from looking at some his recent programs [7] that he still writes by hand.
Of course as a programmer Knuth is sui generis and has developed his own idiosyncratic style of programming over the decades, different from the rest of the world (consider his idea of Literate Programming). He thinks differently, tends towards monolithic rather than modular, and is always in book-author mode even when writing programs. He has some abilities and disciplines that more than make up for what some others would consider defects. What works for him may not work for others. Still, it would be interesting to hear of more people's experiences writing by hand.
A couple of months ago I wrote a small program in an assembly-like language for fun, and I felt that writing out the first couple of drafts by hand was quite helpful, and prevented me from jumping to an implementation too quickly.
[1]: http://ed-thelen.org/comp-hist/B5000-AlgolRWaychoff.html#7 http://ed-thelen.org/comp-hist/B5000-AlgolRWaychoff.html#7
[2]: http://archive.computerhistory.org/resources/text/Knuth_Don_X4100/PDF_index/k-8-pdf/k-8-u2779-B5000-People.pdf#page=8 http://archive.computerhistory.org/resources/text/Knuth_Don_... (Note "half-true" on the cover page is penciled by Knuth!)
[3]: http://www.metafilter.com/122701/STORIES-ABOUT-THE-B5000-AND-PEOPLE-WHO-WERE-THERE-By-Richard-Waychoff http://www.metafilter.com/122701/STORIES-ABOUT-THE-B5000-AND...
[4]: http://archive.computerhistory.org/resources/text/Knuth_Don_X4100/PDF_index/k-2-pdf/k-2-c1039-ALGOL-B205.pdf http://archive.computerhistory.org/resources/text/Knuth_Don_...
[5]: https://news.ycombinator.com/item?id=10172924 https://news.ycombinator.com/item?id=10172924
[6]: https://www.tug.org/interviews/fuchs.html https://www.tug.org/interviews/fuchs.html
[7]: http://www.cs.stanford.edu/~knuth/programs.html http://www.cs.stanford.edu/~knuth/programs.html (I've generated PDF versions: https://github.com/shreevatsa/knuth-literate-programs/tree/1b86fdc/programs https://github.com/shreevatsa/knuth-literate-programs/tree/1...)
- melling 9y agoWriting small programs with pen/pencil would be useful. Then have my phone scan in my work to continue writing it. I’d like some sort of shorthand then refactor to longer vars, etc on a computer.
- antispew 9y agoSurely you meant "The only person I know to regularly write large programs in the present-day..." Writing code with pencil and paper was a normal undertaking well into the 80s. The alternative required either unreasonable hours at a console for days on end or an unreasonable number of unproductive hours each day.
- coliveira 9y agoKnuth is from a time when professors had secretaries who would type their handwritten manuscripts (maybe he still has one). That's why he thinks it is OK to handwrite all his papers and even code. Normal people (us) may even think that handwriting is easier than typing, but very few of us are willing to spend the time it takes to both handwrite and later type the same document. So, in my opinion, the reason for the choice is pragmatic, given the way we need to prepare software.
- melling 9y agoIdeally, you should be able to scan in what you wrote using your phone, then have it OCR’ed. With the recent advances in deep neural nets, this should be close to possible.
- coliveira 9y agoMaybe this will be easier in the future, but nowadays there is still the issue of scanning, running OCR, and fixing the many errors that the OCR process generates.