Remix.run Logo
datameta 2 days ago

Even re-typing code verbatim will teach you much more than copy-pasting.

zer0tonin 2 days ago | parent | next [-]

There used to be a series of book called "Learn code the hard way". It was basically exactly this, you would have a bunch of code, and you were expected to retype it. The examples would progressively increase in complexity.

It helped me learn C 10 years ago when I was a student. Sadly, I doubt it's still relevant nowadays.

dingnuts 2 days ago | parent [-]

on the contrary it's probably more relevant than ever as LLMs rot the brains of half your peers

jedimastert 2 days ago | parent | prev | next [-]

When I was tutoring freshman computer science, I used to do some live coding demos on their computer, but use swear words for pretty much every variable and string. They saw the code, they would have to attempt at least to understand the code, and then they would have to destroy the code so they wouldn't accidentally send the professor something laden with swear words. Good times

sunrunner 2 days ago | parent | prev | next [-]

I've always wondered how much is gained through the act of re-typing (in a positive sense). For example, does the process itself help embed the concepts?

I've always liked the idea that familiarity doesn't breed repetition, rather repetition breeds familiarity (I think this is a quote but can't find the source now) and it's always made me wonder how much is gained from some of the repetitive parts of re-typing, such as does this help embed concepts?

datameta 2 days ago | parent | next [-]

There was a study somewhere that proved handwritten notes encoded into memory more effectively than typed notes, but both were still vastly superior to just reading.

So I think it depends on how much the person is thinking through what they are typing?

dhosek 2 days ago | parent [-]

In my creative writing practice, I retype a piece at least once in the process of revision¹ which forces me to consider every word along the way. I’ve heard of people doing this with other peoples’ writing, something I’ve never had the patience for, but I can imagine that again, the process of getting words (or code) from the page through the eyes→brain→fingers to the keyboard does require some mental consideration of what you’re doing.

1. This has its roots in my high school writing practice where I wrote using a manual typewriter (sitting on the floor of my bedroom in my parents’ basement) and the only way to revise my copy was to retype a clean version of it.

poulpy123 a day ago | parent | prev [-]

> I've always wondered how much is gained through the act of re-typing

The obvious theory is it is better because you are going slower and are more focused.

Less obvious theory: I also think that the activation of the muscles stimulate the brain (that's why we have muscle memory)

layman51 2 days ago | parent | prev | next [-]

I was wondering about this because there is a part in the blogpost that specifically says his developer friend would not even do real-time copying from the other screen. Personally, I think that makes more sense to try to learn because I think if I am good enough at typing, I can get into a flow state where I’m just typing code that I’m not really making much sense of. There are moments where I realize that I don’t understand what I’m typing and that’s when I have to decide to keep transcribing or to slow down and read documentation.

It is also just a little bit tricky to do this if you are working with an LLM that is able to add additional code or do some other kind of refactoring.

dhosek 2 days ago | parent | prev | next [-]

That was what we had to do back in the day: Most computer magazines would have pages of code listings that you were expected to type into your computer to get the software to work. When SoftTalk came out in the mid-80s, it was revolutionary in that it only talked about software, it didn’t include program listings.

nonhaver a day ago | parent | prev | next [-]

100% - mixed with intellisense you get to explore a lib a lot more than just pasting a whole section

svaha1728 2 days ago | parent | prev [-]

I grew up in the Amiga era when we would type code from magazines to write games. I learned a ton debugging those programs.