TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Writing code with pencil and paper (2022)

164 点作者 raytopia超过 1 年前

39 条评论

faeriechangling超过 1 年前
I only use pen and paper for sketching diagrams and graphical relationships between things. This is probably the main use for paper &amp; whiteboards - they are MUCH cheaper than their digital equivalents for drawing regardless of size.<p>Writing out pseudocode on paper is… okay… although not my preference. It’s okay if you get stuck and want a context switch.<p>Writing out syntactically correct code, including commands like “sudo” on paper on the other hand is an enormous waste of one’s own time. God help this man if he ever takes up Java programming. Just type actual computer code like this on computers so you can run it and see if it works. Then if it doesn’t you can just use backspace instead of an eraser.
_AzMoo超过 1 年前
So while I&#x27;m not going to disagree that writing with pen and paper can be a valuable exercise, the assertion that it&#x27;s inevitable is utterly false. I am far more effective in sketching out my code design in an IDE than I am on paper, and never in my professional career of 23 years have I had to write out code in pen and paper for a job interview, or even in the job.
ZoomZoomZoom超过 1 年前
Any discussion of handwritten code is incomplete without mentioning Edsger Dijkstra&#x27;s approach, demonstrated in this beautiful interview: <a href="https:&#x2F;&#x2F;youtu.be&#x2F;mLEOZO1GwVc?t=246" rel="nofollow noreferrer">https:&#x2F;&#x2F;youtu.be&#x2F;mLEOZO1GwVc?t=246</a><p>I&#x27;m surprised no one has mentioned it here yet.
评论 #37825214 未加载
评论 #37828311 未加载
评论 #37834318 未加载
mcluck超过 1 年前
&gt; If you’re unsure, think about the last job interview you did, and remember how there was no computer around in the interview room — just your interviewers, a blank sheet of paper, and a blue ball-point pen.<p>I haven&#x27;t had an interview like this in about 10 years
评论 #37818657 未加载
评论 #37818924 未加载
评论 #37818139 未加载
评论 #37834335 未加载
beached_whale超过 1 年前
When I was learning to code, I didn&#x27;t have a computer of my own. So I wrote the code out on paper. This worked because fundamentally, it&#x27;s a way to communicate ideas in a way that is generally unambiguous and precise. It&#x27;s rare these days, but something like the act of moving a pencil&#x2F;pen over the hand written code and working through the state can be helpful at times too.
评论 #37825738 未加载
评论 #37825662 未加载
totetsu超过 1 年前
Its amazing how useful it is to slow down and just write out some problem with pen(cil) and paper. This has help me get unstuck form some bad habits after year of speeding past them.
xnorswap超过 1 年前
I couldn&#x27;t disagree more.<p>If you&#x27;re finding yourself reaching for pen and paper to write actual code, then your tooling sucks.<p>Your IDE isn&#x27;t suitable for prototyping, or something else is going wrong.<p>I&#x27;m not suggesting that nothing in the planning phase should be white-boarded, but pen is the wrong medium for code.<p>You should have a tool where you can fire up your tooling and be writing the same thing you would write on paper, but with autocompletion, error feedback and browsable interactive output.<p>In my experience that&#x27;s far more appropriate an environment for rapidly getting something down and working through the problem.<p>By all means, start with pen and paper to get a feel for the problem domain, but that process should stop short of actual code, and this article doesn&#x27;t really sell me on the benefits.<p>I&#x27;d rather test my assumptions in something like LinqPad, where I&#x27;ll get real feedback not just a &quot;feeling&quot; about what I&#x27;ve written.
评论 #37819998 未加载
评论 #37820310 未加载
评论 #37817816 未加载
评论 #37819722 未加载
评论 #37818571 未加载
评论 #37820503 未加载
评论 #37821957 未加载
评论 #37822674 未加载
评论 #37818208 未加载
评论 #37818995 未加载
jgrahamc超过 1 年前
I mean people are free to do that but the last time I had to was in 1985 and that&#x27;s because I was programming a KIM-1 by typing in hex codes through the keypad and I didn&#x27;t have any sort of terminal.<p><a href="https:&#x2F;&#x2F;blog.jgc.org&#x2F;2013&#x2F;04&#x2F;how-i-coded-in-1985.html" rel="nofollow noreferrer">https:&#x2F;&#x2F;blog.jgc.org&#x2F;2013&#x2F;04&#x2F;how-i-coded-in-1985.html</a>
评论 #37817587 未加载
onetimeuse92304超过 1 年前
When I was growing up, my family was too poor to afford any kind of computer. Finally, I built a computer from scrap parts but I could not run it because we could not afford electricity to run it.<p>For many years the only way I could program was pen and paper, and a bit later a Citizen SRP-175 programmable calculator with mind-blowing memory to run 128 instructions. I would go to a library, borrow a bunch of books some of which were programming, and knock myself out writing programs on paper that I could only ever &quot;execute&quot; in my mind.<p>If you have an old computer, there probably is a child who would give an arm and a leg to have a chance to have fun with it.
GuB-42超过 1 年前
To each his own. I went the opposite route, now, I don&#x27;t even have a pen and paper on my desk. I still carry a pen in my bag for signing documents and stuff, but I don&#x27;t remember the last time I scribbled something on paper.<p>I usually take notes or lay my thought using a text editor, I find it easier to edit, manipulate, and store. I occasionally use a graphics tablet or my phone with a stylus when I need more than text (ex: drawing schematics), essentially like paper, but more editable and I can save it as a file.<p>But if you find that pen and paper works best for you, go for it. Maybe one reason I went the opposite route is that the author likes to think in advance before going for the implementation, that&#x27;s a top down approach. Mine is very bottom up, I go straight to coding, sometime even before reading the specs. It feels like putting ideas into code makes me think more clearly. I can always scrap that code later, I often do, it is cheap when things are just getting started. And pen and paper is not really suitable for that kind of rapid prototyping.
nilslindemann超过 1 年前
I upvoted the &quot;I couldn&#x27;t disagree more&quot;-post, but now I regret it (edit: oh, there&#x27;s an &quot;unvote&quot; button). One can do a lot more with a pencil and a piece of paper than with a blank text entry. Drawing figures, arrows, etc. There is even undo, thanks to rubbers. But it sucks that one can not insert lines in between.
评论 #37819677 未加载
评论 #37819133 未加载
Madmallard超过 1 年前
I grew up drawing a lot and doing a lot of stuff on paper for thinking so it&#x27;s natural for me to solve harder&#x2F;more complex programming problems on paper before writing up the code. It helps me wrap my head around it.
shmde超过 1 年前
I got blacklisted from an MNC in India because I was writing up the logic for the algorithm problem on paper and the camera flagged me as cheating on the coding test. Its weird cause since childhood we were forced to use pen and paper to solve math&#x2F;physics&#x2F;chemistry problems and now you get flagged on online tests for using it. I just cannot do the &quot;thinking&quot; part of the code with my keyboard and IDE.
评论 #37819035 未加载
WalterBright超过 1 年前
During Christmas vacation while in college, I didn&#x27;t have access to a computer. So I&#x27;d fill spiral notebooks with code.<p>Even in college, the computer was in the computer center. So in the dorm I&#x27;d still code in spiral notebooks, listening to ELP and Jethro Tull.<p>I kinda miss that a teensy bit.
评论 #37818812 未加载
absrec超过 1 年前
I&#x27;d argue it&#x27;s even more valuable to learn to code without paper. Many of us formed habits of thinking with paper in school and freeze up a bit in front of the screen. I think it&#x27;s better to work to eliminate that freezing up than to accommodate it.
评论 #37819550 未加载
CSMastermind超过 1 年前
In mentoring engineers I&#x27;ve found that some are doing what amounts to advanced pattern matching. They memorize the syntax for a for loop but never really internalize what it does (they just seem to know write these letters if you want things to repeat). Not dissimilar to what I suspect LLMs are doing when they generate code.<p>By contrast when I write code I see in my minds eye what the code should do, tinker with it, formulate an algorithm, and only then do I try to translate what&#x27;s in my head into syntax.<p>When asked how people can learn this skill (or get better at algorithms in general) I always say they should practice writing code by hand.
评论 #37826091 未加载
tomohawk超过 1 年前
The expressivity of pencil and paper are so much better than data input on a computer. It&#x27;s great for creative thinking. Between humans, it&#x27;s so much faster than anything that is intermediated by screens.<p>The main benefit is getting things generally straight in your head before committing to data entry into a tool or coding.<p>It&#x27;s a false saving to spend days &#x2F; weeks at a computer to save a few hours of design time.
renegade-otter超过 1 年前
It IS useful - for interviews. I have a whiteboard at home just for that. It&#x27;s amazing how stressful it is to write code by hand <i>without</i> someone breathing down your neck.<p>Outside of that - life is short, and this is waste of it.
Phenix88be超过 1 年前
Last time someone try to interview me with a pen and paper, I walk the door laughing... It shows how little they know about the job, major red flag!
Almondsetat超过 1 年前
He doesn&#x27;t seem to use pen and paper to actually write the code, more to design the algorithm and logic he wants to achieve instead.
zubairq超过 1 年前
I mostly work with a whiteboard and then photo and print out the board, and work from the paper to see if I can then make further refinements by writing on the board again, and so on and so on, until I feel like I understand the problem&#x2F;solution and then get started working on the computer to code.
blueveia超过 1 年前
Agree it has its usefulness.<p>Job interviews with pen and paper are hardly a selling point for me, I had one 10years ago and still dreaded it. My 2 cents are, if a company hires you to work on a computer in X environment then that&#x27;s what they should test you on - or as close to it as they can.
dave333超过 1 年前
Due to having to share a small number of refrigerator size computers amongst all the programmers I started out writing assembler on coding forms by hand. The natural unit of what you can get done in 30 or 40 lines of assembler on one page was quite a good way of modularizing code into functions or subroutines as we called them.<p>Later when code was typed in at the terminal, I used a notebook and pencil to record bugs one per line which is still the best bug tracking system for initial development IMHO. Checkmark on the line when it is fixed, and capital T when it has been tested as fixed.
mock-possum超过 1 年前
&gt; If the thought of handwriting code seems silly, it might surprise you to know that it’s inevitable. If you’re unsure, think about the last job interview you did, and remember how there was no computer around in the interview room — just your interviewers, a blank sheet of paper, and a blue ball-point pen.<p>This was written in 2022??<p>Such a complete turnoff right off the bat, how out of touch do you have to be to write something like that? Maybe the author should have spent some time hand-writing their article first. &#x2F;eyeroll
lysecret超过 1 年前
I can relate to this. IMO in the title there is a WHEN. Missing. If you are using pencil and paper every time (even for the 100th little API variation) you are doing too much planning haha
absoluteunit1超过 1 年前
“If the thought of handwriting code seems silly, it might surprise you to know that it’s inevitable“<p>It doesn’t seem silly but saying it’s inevitable does seem silly…<p>I do not remember the last time I or someone else has had an in-person interview; saying impossible would have been more accurate than saying inevitable<p>However, I do see this being possible and beneficial for students who are at the whims of the professor and if the professor prefers the old-fashioned approach; you will end up writing some logic by hand
intrasight超过 1 年前
I &quot;write&quot;code in my head. On walks&#x2F;runs. In the shower. At the gym. Mostly at the keyboard but for hard problems, I benefit from stepping away from it.
ourmandave超过 1 年前
This is why I keep a dry-erase in the shower next to the soap-on-a-rope.<p>I can use the tub surround as a white board for my &quot;ah-ha!&quot; shower moments.
评论 #37826056 未加载
评论 #37836204 未加载
sgjohnson超过 1 年前
&gt; If you’re unsure, think about the last job interview you did, and remember how there was no computer around in the interview room — just your interviewers, a blank sheet of paper, and a blue ball-point pen.<p>I haven’t done this a single time in my life and I’ve interviewed for no less than 25 positions.
marcyb5st超过 1 年前
Throwback to my Functional Programming course during Uni years. Writing OCaml code on paper wasn&#x27;t fun. I think it helped to cement some concepts, but the extent of said help it&#x27;s not clear to me. In fact, I also believe the same could have been achieved using a text editor.
whateveracct超过 1 年前
I write Haskell on paper all the time! Especially very type-oriented stuff. When you get that all looking good, usually the actual implementation is trivial. You just black out and build it without thinking. Because the design was so provably good on paper in types.
评论 #37822934 未加载
KingOfCoders超过 1 年前
A friend of mine, in the 80s, wrote machine code on paper (calculating offsets in his head) having memorized all op codes, and drawing the graphics for a game for a Sharp MZ-800.<p>I always admired his patience and skills, me using an assembler on an Amstrad to write my games.
a_c超过 1 年前
I think better in pen and paper somehow. I don&#x27;t know why. Whenever I need some serious thinking and designing, I reach out to paper and pen. My brain just wire differently on keyboard. I&#x27;m surprised to learn many feel differently
al_be_back超过 1 年前
Pencil? you can easily Ctrl-Z.<p>nah, wanna go old-school, use inkwell pen, or better still feather + ink for hard-core hackers! focuses the mind, you&#x27;ve gotta know your grammar, syntax etcetera. non of that autocomplete sorcery for me
_glass超过 1 年前
I think it is crucial to learn how to code with pen and paper. All computerization adds a mental burden, that shouldn&#x27;t be there. Also this is a nice way to connect computer science with mathematics.
评论 #37819444 未加载
评论 #37817944 未加载
ekanes超过 1 年前
I&#x27;m not much of a programmer but also find this much better for my <i>thinking</i> process. I&#x27;m much more creative and likely to think bigger-picture.
jappgar超过 1 年前
But then i can&#x27;t use copilot
ChrisMarshallNY超过 1 年前
My first code was done with a graph paper notebook, and a pencil.<p>It was Machine Code.
eigenhombre超过 1 年前
Am surprised by all the negative comments about writing code by hand. Many of the comments here speak about moving or thinking faster, but where I have always found pen and paper most helpful is when I&#x27;ve needed to slow down, focus, feel out edge cases, and give my intuition and experience more chances to engage with the problem. Occasionally for purely algorithmic things I&#x27;ve written out an entire function or loop, but more often it&#x27;s a table of the program state during an iteration, or a diagram of how two things talk to each other, or what calls what in what order... just the little bits I need to think about, get clear on, before I go back to my editor for the next steps to address the problem. If you&#x27;ve ever driven a manual transmission, it feels a little like downshifting to get extra power on a steep hill climb.<p>It has been suggested ([1],[2]) that writing by hand helps with memory retention and probably other aspects of cognition; in my case, it may just be that writing [edit: by hand] &quot;feels calmer,&quot; so, if I have a hard problem to think through, the pen usually comes out.<p>[1] <a href="https:&#x2F;&#x2F;pubmed.ncbi.nlm.nih.gov&#x2F;33815075&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;pubmed.ncbi.nlm.nih.gov&#x2F;33815075&#x2F;</a><p>[2] <a href="https:&#x2F;&#x2F;journals.sagepub.com&#x2F;doi&#x2F;abs&#x2F;10.1177&#x2F;0956797614524581" rel="nofollow noreferrer">https:&#x2F;&#x2F;journals.sagepub.com&#x2F;doi&#x2F;abs&#x2F;10.1177&#x2F;095679761452458...</a>
评论 #37820931 未加载
评论 #37821179 未加载
评论 #37824509 未加载