News for hackers. Stuff that matters.
Re:Ask HN: Any Tips on Learning to Code? by hath995 on Monday August 10, 2020 @03:59PM (#24113369)
Studies of college students learning CS showed that students who built a consistent mental model of what the code was doing did considerably better in classes.

To that end when I was teaching students I would print out snippets of code and have them evaluate the code in their head/on paper and then have them run the code to see if there was anything wrong. Repeat this process until your mental model matches what the computer does.

Re:Ask HN: Any Tips on Learning to Code? by sciencewolf on Monday August 10, 2020 @06:34PM (#24114885)
Totally, 100% agree with this. I would even take it one step further, and say that there are really good tools for developing this mental model nowadays. I didn't really feel like I understood what code was doing until I used tools like chrome devtools, pythontutor.com, or algodaily.com to visualize and step through iteration. It's helpful to know what's happening at each line with the call stack, variables, references, etc. -- but it can be intimidating to start. Drawing it out on paper first might be a better way to begin.