Want to learn to code? Don't copy and paste, type out other people's code
141–150 of 184 posts
Re: Want to learn to code? Don't copy and paste, type out other people's code
#142In a different domain, the journalist Hunter J. Thomson was known to type entire novels to learn the style of master novelists ( http://en.wikipedia.org/wiki/Hunter_S._Thompson ): "During this time he worked briefly for Time , as a copy boy for $51 a week. While working, he used a typewriter to copy F. Scott Fitzgerald's The Great Gatsby and Ernest Hemingway's A Farewell to Arms in order to learn about the writing st…
Re: Want to learn to code? Don't copy and paste, type out other people's code
#143In a different domain, the journalist Hunter J. Thomson was known to type entire novels to learn the style of master novelists ( http://en.wikipedia.org/wiki/Hunter_S._Thompson ): "During this time he worked briefly for Time , as a copy boy for $51 a week. While working, he used a typewriter to copy F. Scott Fitzgerald's The Great Gatsby and Ernest Hemingway's A Farewell to Arms in order to learn about the writing st…
Re: Want to learn to code? Don't copy and paste, type out other people's code
#144When learning code out of a book for a new language, one trick I found that worked really well was to read the code, then close the book and try to type as much of it from memory as I could. I would futz with it for several minutes exploring various ways of making it break, seeing if I could 1) predict how I was breaking it, and 2) use the error messages to fix my mistakes. Then I would open up the book again and com…
I'm a high school computer science teacher, and this is a WONDERFUL idea. I'm totally going to steal it and create a few assignments based on the concept.
Suggestion: code fragment on your interactive whiteboard. Ask students what each line does, how the loop works &c.
Then blank the screen and get them to replicate....
Re: Want to learn to code? Don't copy and paste, type out other people's code
#145This is how I taught myself mathematical problem solving (and math as a side effect). I would read the problem statement, instead of looking at the solution, try to solve it for upto 15 minutes or sometimes even for several days depending on how much value I am planning to get from the solution.
The Brachistochrone problem(http://en.wikipedia.org/wiki/Brachistochrone_curve) is an example of a problem that I tried to solve for several days. Newton solved it in 3 hours, and when you learn math like that you don't take things for granted. You can admire the amount of insight that went into the steps. You can also internalize the knowledge obtained thus exponentially more effectively than you would by listening(and falling asleep).
Re: Want to learn to code? Don't copy and paste, type out other people's code
#146Re: Want to learn to code? Don't copy and paste, type out other people's code
#147open up your favorite library on Github, go back to the very first commit and start reading, commit by commit. If you don't understand something, just copy the difficult section, line by line, on a repl, inspecting variables and/or function results.
Re: Want to learn to code? Don't copy and paste, type out other people's code
#148So one thing that I want to point out, many, many tutorials and books for coding teach bad design practices or provide code that is overly verbose, to make instruction in a particular element clearer. Java is particularly troubled by this imho. So if you are going to use code you find, you should look at good code. I recommend code from a mature open source product.
Re: Want to learn to code? Don't copy and paste, type out other people's code
#149I agree with this especially when you are doing tutorials for this reason: when you type out code, you inevitably make typos that cause bugs. This forces you to learn what some of the common possible error conditions are and forces you to learn to find and resolve them. Learning these things when you have the safety net of a tutorial is ideal, because if you can't figure it out you can always compare with the tutoria…
Can anyone else relate to this? Back in the day (early 90s), I would go down to the public library, pick out a thick book full of computer games written qBASIC, and of course I had to type them in all by hand. We didn't have internet yet, the idea of copy-and-paste from somewhere did not even exist in my mind. So I would copy these 10,000-line BASIC programs in by hand into our 386 computer, one line at a time. For s…
Re: Want to learn to code? Don't copy and paste, type out other people's code
#150When learning code out of a book for a new language, one trick I found that worked really well was to read the code, then close the book and try to type as much of it from memory as I could. I would futz with it for several minutes exploring various ways of making it break, seeing if I could 1) predict how I was breaking it, and 2) use the error messages to fix my mistakes. Then I would open up the book again and com…
One thing that has really sped up my my learning over the past few months on Code Academy -- complete a lesson, then in another tab open their scratch pad feature and try to retype the code not only from memory, but also while thinking through the logic. Has really been effective for me as I feel like I now have a pretty good (beginner) grasp on JS and Python