HACKER Q&A
📣 codinglearner

Learning how to code?


Hey everyone, I need your help!

I am beginning to learn how to code. I was wondering what peoples secret weapon resources here are and what you all can recommend.

E.g. I know about freecodecamp and other more mainstream sources, but was wondering if people have other recommendations as well.

As I am unable to rank the quality of the content I normally find online, it would really help to hear some suggestions.

E.g. someone recommended https://fullstackopen.com/en/, is that any good?

All the best and thanks in advance!


  👤 atomicnature Accepted Answer ✓
I'd like to focus on the "secret weapon" part of your question :)

I teach students, and I've seen all manner of people, and one thing that distinguishes those who get better vs those who don't is: consistency.

Show up every day to practice, to improve. Put in the effort. Try to do, try to be active. Listen to more experienced/accomplished people.

In the early days, it matters less exactly what you do. Most things will help, tutorials, courses, building your own thing. The difficult part is sticking with the process.

If you do these things *consistently*, you'll grow quickly.

PS: The second most important thing in my opinion is, managing discomfort/negative feedback.


👤 mdwalters
Learn X in Y Minutes[1]. Shows you all of the things you need to know in a programming language in code, with fully commented examples. I use it mostly as a reference, but I used it to learn some languages, such as C++, Rust, and Vala. When I was young, I was given a "Get Coding!"[2] book (the first one), which covers the basics of web development, HTML, CSS, and JavaScript, which really jumpstarted my programming career.

[1]: https://learnxinyminutes.com/

[2]: https://getcodingkids.com/


👤 sn9
Harvard's CS50x on edx is probably the best free and online introduction to CS and programming. It will give you an incredibly strong foundation. [0]

teachyourselfcs has a solid list of canonical resources that are common across many university programs. [1]

The Art of Problem Solving books are great if you want to learn math to a high level, though it isn't strictly necessary. [2]

[0] https://www.edx.org/learn/computer-science/harvard-universit...

[1] https://teachyourselfcs.com/

[2] https://artofproblemsolving.com/store


👤 jodrellblank
Three ways to learn to code:

"I want to mod Minecraft, write Quakescript, automate my Blender 3D models, make my job processing spreadsheets easier, make a check which alerts me when my internet drops out or my aquarium overheats, etc.". Task based. Desire for a solution. Google tutorials for the things you need to work with and move step by step forward. Learn as you go. Doesn't want to be a rockstar, wants to build something, solve a problem, play with tech. Will learn something practical.

"I want lots of money / a new career". Search for high paying jobs in your area, find what skills they need, target tutorials on those skills. Study hard, maybe bootcamp, grind leetcode, build showcase demonstrations of your ability, as necessary. Repeat until jobs start wanting to hire you. Will learn something marketable, may learn something practical, may not enjoy it. Accountant model.

"I heard about AI ML crypto bitcoin l33tcode red teaming cybersecurity I want to be a l33t hacker omg how do I make dark mode can I do this in a week what's the best bootcamp I have a great idea for an iPhone app which will be like Facebook but without the ads, I watched 30 YouTube videos on coding last night but today I can't write FizzBuzz in React am I not cut out for this??". ADHD. Not interested in code or tech, wants to be a rockstar without interest in music or wanting to learn an instrument. Probably won't learn anything.

Even though 3 is a parody of a panicked desperate teenager looking for an ego and your question is a lot calmer, the fact that you aren't using any of the zillions of existing tutorials, or any of the zillions of existing "how do I learn to code?" questions and answers on the internet, and haven't specified anything that you actually want to build or want to work with or want to achieve, puts you most likely in group 3.

You almost can't go wrong. If you're plotting a rocket course to orbit the moon, it matters which direction it goes in down to quite fine tolerances. If you're standing still and refuse to move 5 steps in any direction until you have the 'best' direction and 'secret weapon direction finder' that's just ... well, what it needs is a psychologist not an expert direction finder.


👤 ivan_ah
I would recommend you learn Python or JavaScript first and use an interactive coding environment like a Jupyter Notebook, because it will allow you to try different inputs and see the outputs (or errors) immediately. Learning/exploring through trial and error is very powerful.

For learning Python, you can check out this blog post I wrote recently, which makes an analogy between Python prompt and a regular calculator you are already familiar with. I go over some basic topics like assignment + for-loops + functions: https://minireference.com/blog/python-for-stats/ There is a lot more to programming than this, but if you learn these three concepts you'll have done a big chunk!

There are A LOT of good resources for Python beginners. I think you should try a few of them out and see which ones you like best. Here is one example https://www.youtube.com/playlist?list=PLbFHh-ZjYFwGeYhQ2yIQF...

Good luck with your learning. Remember that seeing errors every few seconds is normal... this is how everyone learns, and even advanced programmer run into errors all the time. It's part of the game, so don't be discouraged.


👤 rodolphoarruda
Define something you want to build to yourself or to other people.

Learn the tools necessary to rapid prototype it.

Learn the tech needed to implement the prototype. You'll see yourself having to learn a handful of things in parallel, but try to make your project move in a linear fashion, one step after the other. Every time you hit a barrier, learn only the necessary to overcome it. Celebrate every progress you make. Make notes to somewhere public like a personal website/github. Manage your motivation, expectation, anxiety.


👤 andsoitis
Besides freecodecamp, here are some additional avenues you can explore:

* W3Schools - https://www.w3schools.com

* MIT's introduction to computer science and programming using Python https://www.edx.org/learn/computer-programming/massachusetts...

* UCLA Extension's Coding Bootcamp - https://bootcamp.uclaextension.edu/coding/landing/

* Harvard’s Introduction to Computer Science course on edX (https://www.edx.org/learn/computer-science/harvard-universit...) and the CS50 YouTube channel (https://www.youtube.com/channel/UCcabW7890RKJzL968QWEykA


👤 enumjorge
You mentioned freecodecamp, which although I haven't gone through myself I've seen recommended many times. Is there a specific reason why you're looking for more resources?

The reason I ask is that a common newbie mistake I've noticed with people who want to learn to code is bouncing around from learning resource to learning resource without going deep with any one of them. Nothing wrong with getting different perspectives, but at some point, it's going to get hard because you're learning something hard.

It's a little hard to give specific suggestions without more information. If you've tried freecodecamp, was there something about it that didn't work for you? That would help in giving you more actionable advice.


👤 MarketingJason
Web Dev or Software Engineering? For web, I'd recommend starting with some basic youtube tutorials on building a clone of X. The goal here is not to really learn the concepts, but to learn if you enjoy it. There will be alot alot of learning and effort involved throughout this career. You need to learn if you can stay motivated because you genuinely enjoy it or if it will be a slog.

Then I'd recommend FreeCodeCamp. Don't worry about languages/frameworks/etc - you'll get there.

Don't go the codecamp/paid course route until you've tried building a bunch of things.

Software, start with CS50 MIT course.


👤 ChrisMarshallNY
As always, "it depends."

What does "code" mean?

It sounds like you want to code front/backends for HTTP/Internet stuff.

If that's the case, you'll get lots of help, here, and you won't need much, in the way of equipment and software.

If you want to write stuff for devices (Droids, i-devices, computers, IoT, etc.), then there's no substitute for actually having the device, and the development environment (often, one and the same).

Also, "coding" != "software engineering," but that's something that you'll learn, down the road. For now, getting some "hello world" stuff going, is a start.


👤 pjm331
My advice (based on my own experience) would be to try everything you can find until you find something that clicks with you.

When I’m trying to learn something new having a bunch of different perspectives and explanations is important because for one reason or another, some will click with me right away, and some won’t.

Sometimes one persons explanation won’t make sense to me until I’ve learned the concept from someone else - so it’s not only about trying a lot of sources but also going back and retrying ones you may have bounced off of initially.


👤 tsingy
Here is my bootcamp https://github.com/Lesabotsy/bootcamp, which if you are serious about learning is the best to learn imo. There is a link to a discord group where people hangout and discuss the courses. Everything is free and open btw.

👤 theoneandarjun
I recommend this: https://cscircles.cemc.uwaterloo.ca to learn Python and the basics of programming. Then Angela Yu's web development bootcamp on Udemy

👤 equilibrium
CS50

👤 greenyouse
Check out the Upwind section of this PG essay (and the rest of the essay). http://www.paulgraham.com/hs.html

What do you want to do with coding? What's going to give you the most leverage in the long term?

That course is going to dump you into the deep end for modern web dev. You'll probably struggle with it because it's taking on a bunch of things all at once. Some of the technology is also temporary. Will MongoDB or GraphQL still exist in 30 years? Will HTML, CSS, and JS exist in 30 years? Focus first on fundamentals that will give you a leg up.

I know professional frontend devs that still struggle with HTML because they went straight into React without learning semantic HTML first. If you can master the basics early on, then learning React and other frontend frameworks later becomes way easier.

Start with building web pages rather than web apps. You can do apps later but there's a lot more stuff going on. It's like trying to ride a unicycle while juggling flaming torches and balancing a spoon on your nose. Maybe you could sort of figure it out but it's better to split up the tasks and handle each in turn. That course is for people that already know the basics and want to try balancing on a new unicycle.

If you want ways to practice frontend, try building copycats of websites. Read the DOM, look stuff up, make lists of HTML elements or JS built-ins and memorize them. Play games to learn CSS flexbox or grid. Do whatever as long as you like it and it's teaching you the way.

There's lots of other stuff like frontend challenge sites that are good too. You'll always be "challenged" going forward for professional projects. Some might be really easy tasks, others will be hard. Get used to being resourceful and learning how to figure things out. It's an infinite game.

This style of learning isn't unique to frontend. If you wanted to be a backend dev, learning Spring Boot before design patterns, networking, etc. would probably be a bad idea. It's better to start as a beginner and embrace learning the basics. Go slow and master things step by step. Eventually it pays off.

You could also zoom out and abstract things to help with programming languages. Popular languages are pretty similar. Familiarize yourself with basic control flow syntax in one language and chances are it carries over into others. The same goes for "paradigms" like imperative, OO, and functional programming (others exist but they're more niche). Learning a paradigm is like rebuilding the thought process for your brain. If you learn different paradigms, then your thinking gets more flexible and you can approach problems differently. You might like the "aha" moments you get when things finally connect too!


👤 chriswarbo
Enthusiasm is usually the key, so it's important to aim for some small, achievable goal that you'd like to achieve. For example, making a game; or automating something on your computer; or doing something interactive/visual on a Web page; or analysing some dataset; etc. If you pick a project you care about, it makes the required reading, trial-and-error, etc. much less tedious. Likewise, if you're not at all interested in some sub-field, then no amount of hand-holding, gamification, drag-and-drop tooling, etc. will make up for that!

If your chosen task seems daunting, feel free to break it into something simpler (e.g. for a game, turn-based may be easier than realtime; text interaction may be easier than graphics; 2D easier than 3D; etc.)

Your choice of project will then determine your learning path. For example, Web stuff is all about Javascript; but data analysis may be better in Python; and automation may be easier with Applescript; etc.

I would avoid starting with something "overly ceremonial"; e.g. Java forces everything into a "class hierarchy", Rust requires references to be "borrowed", C requires memory to be manually allocated and freed, etc.

So-called "scripting" languages are a good way to avoid such complications, e.g. Python, Scheme, Javascript, etc. That way you can focus on one thing at a time (you can learn class hierarchies, borrow-checking, memory management, etc. later!).

Avoid languages/systems which have a bad reputation, e.g. Perl, PHP, C, Bash, etc. When learning, it's hard to know what's fundamental and what's just a quirk of that particular system; learning with a particularly-quirky system can make this harder.

When learning a concept, try it in a few different languages (again, to work out what's fundamental)

Don't bother too much about "good practice" or "bad practice" when learning. Make a note if you come across such recommendations, but they can lead to second-guessing oneself and unneeded complexity that obscures what's going on. Focus on "minimum viable projects". Also, following advice that you're not yet able to understand can lead to "cargo culting". Once you're confident/competent enough that you can hack together some solution, you can revisit that advice to see why some approaches may be better than others.

Once you start to feel comfortable, try playing with some big new idea. Sometimes it can help to use a radically different language which forces you to think in that new way; good examples include Prolog (logic programming), Pure (term rewriting), Haskell (pure functional), Smalltalk (message-passing), Forth (stack based). This is good for making you think more deeply, and gain a better understanding of what's going on.