

Ask HN: How do you learn a new programming language? - fadelakin

I've been programming on and off over the past 3 years lately I've been in off mode. I've decided that I want to be a software developer after high school and I want to program full time. I was wondering if anyone has some tips on learning new languages and how to keep my skills up. Is it good if one takes notes while learning a new language?
======
vermasque
First, I go through a light language overview: fundamental concepts and
syntax. This gives me a feel language, whether or not I want to pursue it (I
keep revisiting and abandoning Clojure), and what I can learn from it and
apply to other development in other programming languages I already know. For
example, playing with programming languages with functional influences
(Python, Scala) has influenced how I write Java code in my day job (more
static functions, object composition over class inheritance, more re-use) even
if I rarely touch those influential languages. For examples of a light
overview, take a look at anything on w3schools.com or take a look at
<http://tour.golang.org> which I read recently. I've taken notes before and it
seems to provide very little value, especially if you have access to the light
overview again.

Then you must build something to exercise that learning. If you just read and
don't build, it'll slip away just as quick as it came. Solving an actual
problem that you have is a good motivator for building something. Recreating
something as you believe it should be is another one; for example, build your
ideal word processor. Complete learning involves building things of
significant complexity.

I would learn complementary languages to diversify skills. If you know C#.NET,
time spent also learning Java is not necessarily that beneficial. They are
similar. However, learning Bash for shell programming is at a different level
of abstraction and is optimal for tasks that the aforementioned languages are
not.

------
cferwin
I like to find a good basic intro to the language (like a book or a tutorial
series) and work through it. After every chapter I write a small program that
focuses on using the subject of the chapter. After I finish the book or
tutorial I like to write a program that I will use.

At this stage I think programming for yourself and developing a passion for
your chosen career is more important than mastering a language. I wrote a blog
post about that if you want an example of what I'm talking about.
<http://progfiles.wordpress.com/2012/04/29/flow/>

I think taking notes is good for making sure you understand a concept. If you
can summarize it accurately you probably know it well enough. Also notes are
nice when you want a refresher on something, but don't want to hunt through
the source to find it.

I recommend Eloquent Ruby (The Kindle version is only $17).

------
davyjones
Rather than learning a new language, I suggest that you solve a problem. Any
problem. Programming is used to solve problems ranging from controlling
elevators to sharing information.

Do you already know where you would like to apply your programming skills?
Creating games? Creating software programs that control a space shuttle?
Creating a website which a specific target?

Just look around you and think how you can possibly make something better.
There are lots of interesting things that are waiting to be solved. The world
is your oyster.

~~~
onlyup
I agree with this. I just try tackle a problem with the new language.
Obviously you won't "learn" a language fully by one project but you should get
a feel for the language, it's syntax, it's libraries, it's communities.

------
crusso
I read a little about the language to get a feel for what its mainstream use.
Objective-C is for iOS programming, Ruby is for Rails and the web, etc. then I
think of a little project to write in that language.

I then run through a couple of tutorials, bending them to the project that I
had in mind. By the time I make good headway on my project, I've got a basic
level of familiarity with the language.

------
mtinkerhess
In order to grow as a programmer you should spend time programming. Lots and
lots of time. Why do you want to be a programmer? What kinds of programs do
you want to write? Start writing those programs--you will learn by doing. You
will learn a language by writing programs in that language, solving problems
as you run into them.

