Live data from Hacker News

Ask HN: What is your best way to learn a new programming language?

news.ycombinator.com

41–45 of 45 posts

Re: Ask HN: What is your best way to learn a new programming language?

#41
I don't seek to learn new languages - they sort of come by when I have a specific problem that I want to solve.

This where I write a few paragraphs about the various languages I learned, realize none of you people have time for reading this and delete it in favor of getting straight to the point:

Not having enough problems(challenges) to solve is usually a major hurdle. Ask yourself why do you want to learn this specific language? Does it solve a specific problem you have? If so, try to solve that problem using this language.

Recent example: I wanted to process audio in realtime and my default approach(JavaScript) just didn't cut it. I stumbled upon Rust and it proved to be a great language for such applications.

Re: Ask HN: What is your best way to learn a new programming language?

#43
I can't read anything and have it stick unless I use it. But the hazard of doing a project is that you'll just recycle skills and strategies from earlier languages, which inhibits your openness to what's distinctive about the new environment.

The only approach that works for me is dialectic: go back and forth between absorbing raw information, then using it hands-on on a genuine problem. Learning moves you forward, and using it locks you in and makes you a dry sponge for absorbing further material. The trick is to notice when you're trying to fit your old ways into the new box, and stay alert for opportunities to change your way of thinking.

...or maybe I'm just saying this because I'm working on learning Clojure after decades of procedural programming.

Re: Ask HN: What is your best way to learn a new programming language?

#44
I usually start by reading either the docs (if they are good quality) or a book (if the official docs aren't great) and then I code something trivial after that.

If I'm using it for work I will likely be reading and trying to understand co-workers pull requests, and then progressively more complicated PRs of my own.

Re: Ask HN: What is your best way to learn a new programming language?

#45
Opinionated steps:

0. Do not know a language X.

1. Want to learn a language X.

2. Leave your previous experience behind. E.g. know C, forget about it while learning a new language.

3. Read official docs.

4. Follow the language rules (as much as possible).

5. Analyse language parts (e.g. concurrency, error handling, etc).

6. Synthesize the parts. See how parts combine (e.g. error handling in concurrent code).

7. Bring back your previous experience (e.g. see how different languages solve problems).

The main point is to know "what tools present and what can be done with those", rather than "what is felt about tools present and why the world sucks".

PS:

A small set of observations:

- "disliking" parts of a new language while learning returns you back to the step 0.

- steps 5, 6 and 7 are almost never ending (especially in languages that grow).

- step 7 requires discipline. It is needed not to "pick the best language", but to understand various ways of solving a problem across different languages (do not forget to identify a problem).

Post reply on HN