HACKER Q&A
📣 southernbelle02

Any Tips on Learning to Code?


Any Tips on Learning to Code?


  👤 hath995 Accepted Answer ✓
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.


👤 Jugurtha
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.


👤 Solstinox
Rule #1 of All Coding: Keep it simple. If it's not simple, simplify it.

Once you've got that rule down, pick a popular language (Python's good because you can ask questions and get answers), pick a simple program that'd be useful to you, and then figure out what you need to make it work. Then make it work, applying rule #1. Rinse and repeat.


👤 dschuessler
This is hard to answer without any information on your motivation and prior knowledge.

You will sure have noticed that there are tons of free tutorials on the internet for all kinds of programming languages. If you're just curious about coding, pick one and go with it. If it doesn't suit your style of learning, pick another one.

This is the one that got me started: http://aelinik.free.fr/c/

The setup part is a bit dated. For programming basic little C programs just visit: https://www.tutorialspoint.com/compile_c99_online.php


👤 sixhobbits
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.

https://codewithrepl.it/python-projects-for-beginners.html (still WIP website and not mobile resposive yet)



👤 he11ow
I've written an article for people who aren't developers, but are looking to pick up coding skills to apply to their domain.

It covers super practical stuff step-by-step, and links to the resources you need.

Making Coding Skills Useful as a Non-Developer: https://code.likeagirl.io/making-coding-skills-useful-as-a-n...


👤 pryelluw
Write code every day. Ive been programming for decades and I still write code every day.

👤 gt2
Think of something you want for yourself or to exist, and then build a simple version of it by researching each objective in simple terms, and you will learn by doing.

👤 ChrisBode
keep the code simple. Writing code without thinking of its architecture is useless in the same way as dreaming about your desires without a plan of achieving them.

👤 frompdx
Consider picking up a copy of Grokking Algorithms. It assumes no prior knowledge of programming and has lots of illustrations. Read it and implement the algorithms yourself.

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