My preferred method is to find the equivalent of K&R for that language, read it, and then start trying to program, supplemented with internet searches if I run into something that it turns out I didn't understand, or to find neat libraries.
Unfortunately, few books approach K&R's quality. I don't like books that are written under the assumption that I will be sitting at a computer as I read them, and expect me to be typing in code and running it for everything they cover.
If I can't find a satisfactory book, I'll cobble together something from what I can find on Safari Library, free online books, and assorted internet searching.
A while back I tried an interesting experiment. I needed to learn some Lua, because I wanted to write some add-ons for an MMORPG I was playing (Warhammer Online). Lua has pretty good documentation, but I had recently read that famous article on digital natives vs. digital immigrants, whose theses was that digital natives (people who grew up in the digital world) have a fundamentally different understanding of technology than those of us who grew up in the pre-digital age and immigrants to the digital world. The natives are multitasking do-ers, who want to learn things as they need them. They aren't, supposedly, like the immigrants, who think the way to learn things is to read a book, then start doing.
I decided to take a more native approach with Lua to see how that worked out. So, instead of reading the Lua documentation, I downloaded and looked at a few Warhammer Online add-ons to see how they were structured and get a feel for what Lua code looks like. I looked at the Wikipedia article on Lua to get an idea of what kind of things the language had.
Then I started coding. Whenever I wanted to do something that I knew the language could do, but didn't know how, I Googles. So, for example, the first time I wanted to initialize an array with literal constants, I'd Google for that.
This actually worked. I don't know if my Lua code is any good, but comparing to what I see on other people's add-ons, it seems in the same league at least. I would not put "Lua programmer" on my resume just yet--I'll wait until I actually read a complete manual before doing that. I did a similar experiment with JavaScript, with similar results.
I'm not convinced, though, that the "native" approach is actually good. Yes, I got satisfactory results, but I think much of that has to do with the fact that I've been a professional programmer for 30 years. That has given me good filters for recognizing bad code, so when I'd Google for how to do something and get back and answer that turned out to not be a good way to do whatever it was, I'd sense that and keep looking. Someone with just a couple years or less experience would probably have incorporated a lot more things from the bad examples on the net.
Unfortunately, few books approach K&R's quality. I don't like books that are written under the assumption that I will be sitting at a computer as I read them, and expect me to be typing in code and running it for everything they cover.
If I can't find a satisfactory book, I'll cobble together something from what I can find on Safari Library, free online books, and assorted internet searching.
A while back I tried an interesting experiment. I needed to learn some Lua, because I wanted to write some add-ons for an MMORPG I was playing (Warhammer Online). Lua has pretty good documentation, but I had recently read that famous article on digital natives vs. digital immigrants, whose theses was that digital natives (people who grew up in the digital world) have a fundamentally different understanding of technology than those of us who grew up in the pre-digital age and immigrants to the digital world. The natives are multitasking do-ers, who want to learn things as they need them. They aren't, supposedly, like the immigrants, who think the way to learn things is to read a book, then start doing.
I decided to take a more native approach with Lua to see how that worked out. So, instead of reading the Lua documentation, I downloaded and looked at a few Warhammer Online add-ons to see how they were structured and get a feel for what Lua code looks like. I looked at the Wikipedia article on Lua to get an idea of what kind of things the language had.
Then I started coding. Whenever I wanted to do something that I knew the language could do, but didn't know how, I Googles. So, for example, the first time I wanted to initialize an array with literal constants, I'd Google for that.
This actually worked. I don't know if my Lua code is any good, but comparing to what I see on other people's add-ons, it seems in the same league at least. I would not put "Lua programmer" on my resume just yet--I'll wait until I actually read a complete manual before doing that. I did a similar experiment with JavaScript, with similar results.
I'm not convinced, though, that the "native" approach is actually good. Yes, I got satisfactory results, but I think much of that has to do with the fact that I've been a professional programmer for 30 years. That has given me good filters for recognizing bad code, so when I'd Google for how to do something and get back and answer that turned out to not be a good way to do whatever it was, I'd sense that and keep looking. Someone with just a couple years or less experience would probably have incorporated a lot more things from the bad examples on the net.