Discussion about this post

User's avatar
Guidothekp's avatar

Let me add a few more reasons.

1. Static analysis and ownership. Almost nobody talks about this. When you write by hand, you know right away if the code you are reading will compile and work. You can catch the errors and typos long before the compiler. This leads to attention to detail. You also learn to read the code and start wondering why some parts cannot be just cut out. You then realize that you did not think about the edge cases. This is where using an LLM to write the first cut is outright dangerous. Using an LLM once you are ready (and before running against tests -- we are still in static regime), exposes your blindspots.

2. Writing by hand makes you curious about the design decisions. Try to write a template with move and copy constructors with noexcept and pretty soon you will realize that you do not understand how things work.

3. Writing by hand creates a recall. Recall involves observing patterns from naming to understanding the authors themselves. You can then predict what a method name will look like when you are in a new part of the language.

4. Slowing down also makes you wonder how a certain function was implemented. Numpy deserves a mention here because of broadcasting and other shortcuts. I will bet you that most people do not understand what those access by row, column, or any other axis in a tensor mean, so they cannot write the code with pen and paper.

5. To build on your attention to detail: Example: in binary search, when does one use while(low < high) vs while(low <= high).

Eventually, you learn to read the code as if it were a novel and without any comments and any other crutch. This is the owning part.

No posts

Ready for more?