Ask HN: What is your best way to learn a new programming language?
I want to learn Python for web development. Programming is totally new to me.
So what's the best way to learn it and maybe the fastest?
What would be your learning methods? Do you have any tips/hacks etc that works for you?
8 comments
[ 2.4 ms ] story [ 16.3 ms ] threadAvoid any hacks, shortcuts or methods more appropriate for less practical subjects.
Find a good and definitely not concise book or a good MOOC that explains all the basic concepts with lots of examples you can try in a Jupyter notebook. The more you code the more you learn.
2. Follow the content, make sure you understand the concepts. Don't just read the material, it's recommended to code what you're reading so you spend time understanding what you're coding.
3. Solve some exercises.
4. Once you've covered the fundamentals, go and start off with a project. Start with a small project, then create bigger ones.
Essentially, cover the fundamentals and understand them, then go ahead with a project. The real learning is in the projects you'll build as you'll find gaps in your knowledge that you'll cover on the way. But it's good to study the fundamentals so you have a starting point and aren't completely lost.
There are a lot of good books for an introduction to Python, "Automate the boring stuff"[1], "Think Python"[2], and many more. These two are actually available for free online. Someone here can probably recommend some better books or you can look up other recommendations online.
EDIT: formatting
[1] https://automatetheboringstuff.com/
[2] https://greenteapress.com/wp/think-python-2e/
You don't need to take CS50, but it's the probably the best introduction to programming available online and will give you a strong foundation that will make the later books easier to work through.
After that, depending on whether you like getting your feet wet or taking a more formal approach my two go to methods are either: 1) reading through a "code by example" for the lang or 2) finding a cool relatively simple project written in the lang and stepping back to the very first commit and reading diffs from there (I also recommend this technique for picking up design pattern / design strategies in general)