Earlier quoted context omitted.
No, the author is actually writing code using pen and paper. It's not just a high-level or organisational sketch. It's not just planning. What happens at the computer afterwards can best be described as transcription and debugging.
I find it pretty unlikely that this entry: > I opened my laptop, created a new Github repository, typed in the code, added some tests and wrote the README. It was probably all done in 4 or 5 hours of concentrated work. Means handwritten code verbatim went into the repo. The focus on iteration is great - it would be unusual to stop at this point. But if we say the written word is canon, my response is that's inefficie…
How I Write Code: Pen and Paper
61–70 of 110 posts
Re: How I Write Code: Pen and Paper
#62I used to code in pencil during the day at school, so I could test when I got home (and avoid boredom). These days I'll still sometimes use paper if I'm trying to optimize some inner loop assembly, easier to draw the code and the data side-by-side when both are changing. Edit: This line resonated with me: > Maybe someday I’ll be able to handwrite code on an e-Ink device and then run it. Are there successful projects…
Re: How I Write Code: Pen and Paper
#63It's pretty cool how the comments are divided between "I write code on paper/I used to write code on paper" and "Nobody could ever write code on paper, she must be speaking metaphorically." It's kind of like China Mieville's "The City and the City": somehow these two populations in the same place don't see each other at all, or they pretend not to, in order to avoid conflict.
I have an easier time writing code on paper than on a computer when it's "algorithmic" and its problems are internally generated, or when it's in a domain I already understand really well. I wrote a Soma cube in OpenSCAD once in a text editor on an internetless iPhone, which is more or less the same thing; Naomi Wu mentions that this is one of the benefits of OpenSCAD for people in poor countries, where they maybe don't have access to sit in front of FreeCAD or Blender all day, but they can totally type text on their cellphone while they're on the bus. Or write it on paper, maybe, but that takes two hands.
On the other hand, I also write a fair bit of code where the relevant unknowns are things like "What kind of user interaction will feel responsive?" and "What will this API do if I invoke it with these arguments?" and "How many public recursive DNS resolvers are there on the internet?", which are not things I can find out by thinking and writing things on paper.
Re: How I Write Code: Pen and Paper
#64I like doing this in notion -- here you can write code with the syntax highlighting and attach all sorts of stuff to the document -- once you've crystalized exactly what you want to build, you can fireup your IDE and get to work.
I think it ties with the theme -- A programmers work is not to type things -- the main input is thoughts and ideas that can be interpreted by a computer to do correct things. A notebook helps with the thoughts and ideas part.
Re: How I Write Code: Pen and Paper
#65But it was a simple algorithm and it didn't specify a language so I wrote it in 386 assembler. I think that to this day is the only program I wrote by hand, and I know it compiled and ran correctly as they made me type it and execute it (only for fun they knew I knew what I was doing)
Re: How I Write Code: Pen and Paper
#66I may be living in the future then. :D
Re: How I Write Code: Pen and Paper
#67Earlier quoted context omitted.
As someone who's worked a fair bit now - coding has absolutely no value to any company. What delivers results is deploying solutions - whether those solutions are powered by hotpockets and red bull at 3AM or whether they are entirely composed of meetings discussing how to inform customers of the change - it is never "coding" that solves a problem. "Coding" is at most the effort of transcribing a solution from your br…
Coding often gives feedback on your plan and design. You may not see its flaws as long as its only in your head or on paper. When you write the code and try to run it on your computer you often realize something is wrong with it. Architects do a similar thing, they visualize in their heads and on paper, but then they also actually build 3D small-scale prototypes to get feedback on their design. So I would say that co…
Re: How I Write Code: Pen and Paper
#68This may seem pedantic, but this is an aspect of project management. The pen and paper aren't in the coding, they're in the design. You may be doing some abstractions/pseudo code on paper but you're not coding. You're planning. There's nothing wrong with this! I think it's a great way to operate. But it's less sexy to say "How I Plan: Pen and Paper" then to conflate it with coding. Everyone does planning. Some people…
My cs classes in college gave quizzes via webpage or email, but the actual exams were on paper, hand writing actual code. Multiple pages of it. It actually helped make things stick better, after initially adjusting to it. Afterwards, I would end up typing code more deliberately, and found myself tapping delete far fewer times. Very similar experience to learning drafting-by-hand before CAD.
feel bad for the T/As that had to grade all those exams.
Re: How I Write Code: Pen and Paper
#69Similarly I sometimes code review by printing out diffs and writing on them.
I like the tactile side of writing, and the spatial freedom. Also I just find it easier to think away from a screen somehow -- coding on a computer is still my majority case, and it's essential where it's the type of work that involves stitching things together. But for algorithm or code-design style work, if I get stuck I write it down.
One theory I have is that because I have a very spatial/location-sensitive kind of memory, scrolling on a screen messes with my internal mental map of where things are.
I mean that if I'm designing something or trying to understand someone's code, my working memory built up of the things that I'm reading or writing down is linked to where I read or wrote it, and I think a single screen space in which anything and everything can appear messes with that and makes my brain have to work harder to remap things.