Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

In my C++ intro class last semester, all of our tests were paper/pencil and we had to write out code with a pen or pencil in order to answer questions. It seemed counterintuitive at the time, but also made sure students knew the answer down to the last semi-colon.

Given that handwriting notes is an essential practice in learning other topics both in the class room and at home, how productive is handwriting code examples and documentation?

share|improve this question

closed as primarily opinion-based by Corbin March, psr, MichaelT, Dynamic, GlenH7 Aug 15 '13 at 13:21

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.

From the perspective of someone who has taught, it was probably done to make cheating more difficult. The fact that yes people do retain knowldge better when they have hand-written it is a side benefit. –  HLGEM Aug 14 '13 at 14:33
Then try to compile it. –  user61852 Aug 14 '13 at 18:00
It allows for graphologists to identify who introduced bugs. –  user61852 Aug 14 '13 at 18:51
God... Good God, no. The mere thought horrifies me. –  asteri Aug 14 '13 at 22:44
I don't know much about theories. In my university time, there are 2 classes of fundamental programming. The class in which the professor requires students to write code to paper generally performs better to the other class. I think it has something to do with "you should think about the solution before you write code". –  Hoàng Long Aug 15 '13 at 9:10

10 Answers 10

Is handwriting out code an efficient way to learn a programming language?

It is an efficient way to learn and remember fundamentals of the programming language. In addition, it helps and improves your understanding on how code works, you get better understanding of inner-workings.

It is also a good block against copy-paste trend which tends to have quick results for newbies without a clue what is happening in the code.

However, for productivity reasons having a set of tools is must. As example, you may accomplish your tasks n times faster with Visual Studio IDE than a Notepad++ and C# .NET compiler.

Thus, right set of tooling is very important factor for productivity.

More about dangers of copy-paste discussed in this post.

share|improve this answer
perhaps you meant copy-paste? (I hesitate to make a one char edit) –  Dan Pichelman Aug 14 '13 at 14:19
grammar corrected :) –  Yusubov Aug 14 '13 at 14:20

I always found it to be a complete waste of time. You have no idea whether that code compiles or does what you expect, and measuring what you expect to work against reality, and then researching why the two might be different, is how we learn things.

When I was learning I kept detailed hand-written notes of common library functions, but then somebody invented something called the internet and all hell broke loose. Libraries are sometimes updated faster than my ability to write so my notes often got stale very quickly, not to mention that you can search online documentation but not handwritten notes.

Of course, everyone learns differently so perhaps this is the most effective method for you - your mileage may vary...

share|improve this answer

In my experience it's not that productive at all. For example, it's very hard to insert a blank like between two existing lines of code when it's written on paper!

However, it's not uncommon during an interview to be asked to write out code on paper in order to answer a question. I also make sure I take a pencil with an eraser on top, as this can be tough when you've only got a pen!

share|improve this answer
For sure, writing code on paper and then transcribing it to computer is not a very productive development habit. But for learning, the hassle of editing actually reinforces the learning. To get that blank line, you have to delete some of your code and rewrite it - forcing you to review it one more time. –  emory Aug 14 '13 at 20:08

I think it has pretty limited benefit. It may assist in learning the syntax of the language, but once you start actually using the language itself, writing code you can't execute doesn't help much. It's probably a useful exercise for the first couple of weeks of an introductory course, but after that I think you'll see more benefit from running your code through the compiler (or at least a syntax-checker).

share|improve this answer

I will note that when following a tutorial, typing out the code (rather than downloading it or copy/pasting it) is a better way to learn. It tends to generate more thought about what your typing. And every time you misread the code (and thus, trigger an error), it forces you to put in extra work. You can improve learning even further by never looking at the code you are copying while you type it. Aversion to wasted effort is a memory enhancer.

share|improve this answer

I completely second what Yusubov says: it might be a good way to teach you the fundamentals of a language. I would even say: it might contribute to teaching you the fundamentals of programming.

What I wanted to add here is that it helps make a clear distinction between the language you're learning and the tools you're using. Working in a modern environment doesn't necessarily make this distinction very clear.

Is handwriting code an efficient way of learning a programming language? Yes, it can contribute positively to learning the language in the early days. How productive is it? Not very much.

share|improve this answer

Being able to handwrite understandable code is an important skill for whiteboard meetings (explaining an alternate or better algorithm to the team, etc.)

Being able to write correct code without the compiler and unit tests to do the checks for you puts less of a load or dependency on those tools and their (theoretically imperfect and often many) holes in their coverage.

share|improve this answer

The main advantages of handwriting is it generally helps concentrate on what you are doing, so when you finally do the coding, you know exactly what you are doing. The downside is that it can be counter-productive. I find it better to handwrite algorithms and "type" the actual code.

share|improve this answer

For me, learning a new language also includes learning the environment you will be using it in.

And the best way for me to learn a new language is to actually program in it, and by that I mean actually program and run a small application, so I can see the results, not by trying to program on paper.

share|improve this answer

I think it's not about productivity, it trains programming mindset. Before a fairly easy problem (like count prime numbers in first n integers), 9 out of 10 students might think that they know the answer and start typing. But very likely, their solutions miss some edge-cases, or not the optimized way.

One of the benefit of writing code instead of typing is that it forces students to think before typing. It's easy to insert/delete a code line, but it isn't so easy to write between paper lines. Even if they do write between the lines, the imperfect writing gives hint about their imperfect approaches, which imply some space to improve.

As my comment above:

In my university time, there are 2 classes of fundamental programming. The class in which the professor requires students to write code to paper generally performs better to the other class (in a programming contest which uses real computer)

Of course, the above quote is only my observation, but it gives a hint about how it works.

share|improve this answer

protected by Yusubov Aug 20 '13 at 18:23

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.