Live data from Hacker News

Ask HN: Any Tips on Learning to Code?

news.ycombinator.com

11–18 of 18 posts

Re: Ask HN: Any Tips on Learning to Code?

#11

I'm working on a set of basic projects with step by step walkthrough guides for beginners. I expect most people to do this alongside a more traditional course but some people do it first to get a "feel" for coding. It doesn't cover a lot of theory but you get to make a variety of things that show the potential of learning to code (and are hopefully fun). If you take a look I'd be very interested to hear feedback. htt…

Okay when I finish, I’ll try to get back to you lol

Re: Ask HN: Any Tips on Learning to Code?

#12

So I’m just kinda wondering if y’all have any tips, or if y’all want to recommend any websites, apps, or books.

I highly recommend FreeCodeCamp https://www.freecodecamp.org/ Feel free to DM me on Twitter @_shakeel, I'm happy to give a more exhaustive list if you're interested!

Re: Ask HN: Any Tips on Learning to Code?

#14
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?

#15
If you had all the skills you needed, what program would you write? What problem would it solve?

Now start writing that program and pick up the skills to solve little pieces of the big problem you want to solve.

Does your program need to fetch something from the Internet? Learn to do that. Does it need to read a file? Learn to do that.

Break up the problem into small manageable pieces.

Learn git to version your code. Invest one day to learn how to commit and push your changes into GitHub or GitLab. It will save you a lot of time and will avoid breaking your heart by not losing your code.

If you have a language in mind, learn the syntax quickly and to do the most basic stuff, then get a cookbook that shows you how to do useful things, like reading or writing to a file, or sending something to a server. These will help you solve the little pieces of your problem.

Software can be useful to people. What do you want your program to help you with? Imagine you can do anything in a computer, find a problem you're passionate about, and set out to solve it. You'll be way ahead.

You can also do that when you pick an nth language. When I wanted to learn Python, I started to write a program that would allow you to send airtime (mobile money) from one SIM card to other SIM cards of different operators. You can't do that, but I essentially did impedance matching.

The service would expose n mobile numbers corresponding to n operators. You send money to the number from your same operator, and then send an SMS specifying the amounts and the recipients. The service then would use its own SIM cards for the target networks and send money.

Learning can be accelerated doing a real project.

Then you can refine your programming.

Re: Ask HN: Any Tips on Learning to Code?

#16
post #14

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…

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.
Post reply on HN