Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Ask HN: How do you really learn a new language?
4 points by sown on Aug 21, 2012 | hide | past | favorite | 7 comments
I mean really learn it. Master it, I mean.


Do you mean how to master that language, right?

Build and read.

I recommend getting a good reference book for the language (I personally find the O'Reilly books pretty good), with most of its features included, and read it from start to end. This way you will become familiar with the majority of the language concepts.

Then, find open source projects made by experts on that language and try to understand them. There will be simple things, but you will also find some constructs or language tricks.

And, of course, build things. You will not learn the language if you don't use it. Create hard things: there's no need to create a complex application, but instead a difficult application, where you need to explore deep in the language to achieve some goal.


These are all good suggestions.

Bug fixing is sometimes a useful way to learn a language.

Another good method is to try to teach it to someone else - what you do and don't know becomes clearer to you. So, you could look for questions on various online forums and provide the best answer you can. (You don't need to post that answer, you just need to write it.) And then compare what you wrote with the answers provided by other posters.


The only way to master something is to use it again and again over a long period of time.

But if you are asking about getting started with a new language, then it will vary from person to person based on your mode of learning - some learn by reading, some by writing, some by coding, some by reflecting, and some learn by teaching. You need to figure out what your preferred mode of learning is and do that.

I learn by copying some other code. I'll find a small tutorial and follow along typing the code line by line. I dont copy-past, I actually type it out. I don't necessarily think about what I am typing, just following along. If its in a book, I'll type out some of the examples. After its working, then I'll find a different tutorial and type it out again. Usually after a few programs like this, I start to get the hang of the basics.


Assuming you already know other languages ...

Pick a smallish but difficult problem, and solve it. Maybe best is to make a personal utility that you would use, even if you already have that utility.

Don't worry about getting every idiom right, or fitting in exactly with the language's culture (but do pay attention to it).

Try all the things! This is your chance to try all the language features, without embarrassment, even if they aren't the most appropriate choice.

Get something working the very first day, preferably the first hour. Could be the equivalent of hello world, doesn't matter. Always have something working, and something next on the list for tomorrow, to help you wake up interested. That way you'll keep at it.


I've refined my method for learning new languages and it works really well for me.

1. Thumb through a basic book on the language. Skimming through syntax, language structure and other nuances that separate it from similar languages that you have experience with. Skim through examples but don't spend much time on them.

2. Pick a project and go.

Refining your knowledge in the language is, in my opinion, simply a matter of time. Use the language, learn the language and get better at the language.


My generally rule of thumb is to pick a project that is far beyond what I could hope to do in the language in a reasonable amount of time, then work as hard as I can, get as far as I can with copious amounts of googling and docs reading. By the end of it I have a good idea of how to work on the language. (And sometimes even a finished project)


The two most important things have already been mentioned.

Another important technique that I usually use is to ask, repeatedly if I'm "doing this right". I find stackoverflow welcomes such questions but you must already have working code.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: