Hacker News new | ask | show | jobs
by blasdel 5776 days ago
I intentionally program in that style all the time, especially in the absence of a REPL. It's really not much different than writing it out with pen + paper first.

It lets me get the idea out of my head and on to the screen where it can be criticized. Tracking down syntax errors, missing includes, compiler flags, etc. is enough of an independent activity that I often want to do it all at once at the end of the first brain dump. At the beginning I want to be shitting out code, not googling for solutions to GCC's vague neuroses. After that first dump is done and validated, I use it as the first commit and iterate from there.

2 comments

I prefer to write it out with pen and paper. After all, most of what you do when you code is come up with a solution to a problem and then implement it. It's a lot easier to play with your solution when you're still forming it than after you've already typed it up.

Code is also difficult to read. It's much easier to understand a code flow diagram, or something similar, than it is to comprehend the 100 or so lines that the diagram represents.

I do too (and wow isn't it a wonderful feeling on the rare time when you write a whole page of code and it compiles and runs right the first time?) but I certainly couldn't do that when I first started, and trying to do so just made me get lost in a morass of logic mistakes and compiler error messages. It seems like lots of beginning programmers naturally want to write a ton of code right out of the gate and they have to be taught to do otherwise.