Yeah I just open two panes in Sublime Text, with the source on the right and then I type it out verbatim on the right.
I make an effort to keep the line numbers synced. Sometimes I skip long repetitive blocks or comments. But I do type out like 80% of the actual characters in the file.
It's about 500 lines per hour fot me, so I can estimate reasonably well how long it'll take.
It's not necessarily an efficient thing to do — you'd get way more bang for your buck just poking around, asking questions, trying to make small changes. But for reasonably small projects, you can type it out in a few hours, or a day or two. Then you've "round-tripped" every single token through your brain (though sadly not with a meaningful amount of conscious reflection) -- unless you pause and ask questions along the way.
Not to offend you, and you've already pointed out the better way to do it, but I don't think there is too much to gain from this approach. When I was learning Vulkan for example, the only thing this helped me learn was which functions they were calling from the API. Their variable names and ifdefs and wrapper functions were completely useless to me. I was able to get their 5000 lines down to just 1000-- and that was for a single untextured cube with direct memory management and simple surface handling. Imagine if it had been more complex? 20,000 lines of typing for little reason. My neck aches thinking about it :)
I make an effort to keep the line numbers synced. Sometimes I skip long repetitive blocks or comments. But I do type out like 80% of the actual characters in the file.
It's about 500 lines per hour fot me, so I can estimate reasonably well how long it'll take.
It's not necessarily an efficient thing to do — you'd get way more bang for your buck just poking around, asking questions, trying to make small changes. But for reasonably small projects, you can type it out in a few hours, or a day or two. Then you've "round-tripped" every single token through your brain (though sadly not with a meaningful amount of conscious reflection) -- unless you pause and ask questions along the way.
See also my other comment above.