7 Answers
7

Rather late to the party (come on, Necromancer!), but I want to say that I've been learning languages partially through Stack Overflow.

I want to note that "the way" (my preferred way) to learn languages through SO is not to post lots of newbie questions about them. The process:

Start following that language tag.

Read the simpler questions in that tag, particularly questions about things you have lots of experience with in other languages. I know regular expressions pretty well, so I can learn a lot about a language's syntax and workings by reading that language's regex questions. Pay attention to the code examples to learn syntax.

If you have major problems, the purity is not worth the frustration. Resort to using the Googles to find more general language references, but don't forget to Google "site:stackoverflow.com" to search SO for your question first. SO probably already has your newbie question, and Google's search engine is better than Jeff and Joel's. Sorry, guys.

Eventually, you will start being able to predict the answers to (some) questions people post about that language. At this point, start posting answers. Maybe they'll be wrong or not very good or not "the best way" to do it, but you can't learn if you don't stick your neck out somewhere, and someone will come along and post the right answer anyway if you don't.

After doing this for a couple months, I find I know quite a bit about a language. Languages I have done this with:

I started Python from a book, but I didn't care much for it, so I turned to reading Python questions on SO and, with the help of example code, learned much. Though saying I learned it on SO is a misnomer, as I had great help from the wonderful online documentation.

I won't pretend I know it even remotely completely, but the little Haskell I know mostly comes from SO. I have yet to find a good introduction to monads, but despite this I am able to answer some more basic Haskell questions and get quite a few upvotes.

I already knew C, but I've learned a lot of C++ from SO. Most of what I had to Google were basic syntax problems, but SO taught me about using std::vectors and the different forms of using and other things. It wasn't that much of a leap, but now I can answer some basic C++ questions.

Currently working on Ruby. Lots of help from the Ruby online documentation so far, but whenever I upgrade to Ruby 1.9 I'll be in much better shape.

Conclusion: It's doable, and you don't even have to make an ass out of yourself. It certainly puts the pressure on you to learn, but I'm used to that with programming, as I've been entirely self-taught from the start.

Wow first question and an answer in 3 minutes! Thanks. I think the reason I ask is because I hate forums, a lot of them go unanswered but still rank high. Do you mean after searching SO before asking question? Also since it's another language you can assume that I can do an if statement :)
–
StephenJul 7 '09 at 12:23

Searching both SO and the wider web, though with SO's page rankings the two are pretty synonymous!
–
ChrisFJul 7 '09 at 12:25

You'll learn best writing code in the language you choose to learn. Project Euler has a lot of (maths oriented) problems you can solve. There are also a lot of online tutorials and books (e.g. Dive Into Python).

If you come here and say something like "I'm teaching myself Python, and I'm having trouble with X; what am I doing wrong?" (after searching, of course), then no one should have any problem with "easy" questions.

Can you learn a language just using SO? No. At least, not before you seriously wear out your welcome. SO shouldn't be your primary resource for learning a language. It is great for clarifying points of confusion and for improving your ability to take advantage of a language.

When you get to a decent competency, SO is a great way to see a lot of challenging questions that people have run across in the language of your choice. You can learn a lot from trying to answer these questions, and then seeing how the really adept answer them.

If the question is about limiting yourself only to SO to learn and do research (in conjunction with hands-on programming), then it might be possible to learn a new programming language through SO, but you'll probably pull your hair out in the process. The wealth of information in other online resources, books, or other materials would be just too much to pass up - unless you're extremely patient or just want to prove a point about only using SO.

SO is not a tutorial. The format does not lend itself well to teaching a new language starting from basics. Yes, taken together the questions illuminate a lot of a given language, but there will be dark spots which not only aren't described here, there aren't any clues that tell you your missing something.

That last point is important - without a 'language roadmap' of some sort, you won't learn some basic aspects of the language, you won't know that you're missing parts of it, and that will hobble you in the future.

So no, you cannot expect to fully learn a language on SO with no outside resources.

SO is a great place to enhance a good tutorial, though. If you are already an accomplished programmer, you may be able to dig into the meat of the language, and while going through basic instruction look up related questions on SO to drill down into why or when one might choose one construct over another. You might use SO to teach you advanced topics that are glossed over in the basic tutorial, since it's geared towards someone who may not understand advanced CS topics.

But I'd be interested in seeing someone try. I suspect that SO could become a good resource if someone took the time to put together a series of questions that became the tutorial:

"This is part of a series on learning Python for beginners. Please read the question carefully, and submit answers that are simple, clear and easy to understand. Your answer should answer the question with as much detail as necessary for a beginner - but no more. Please do not post an answer consisting only of links - the intent is to build a fully self-supporting tutorial for Python on SO."

The above would appear at the top of every tutorial question, and you might have the following basic questions (each in its own question post):

What is the history of Python - who created, why, and what are its roots (in terms of other languages that preceded it)? What languages have claimed this language as one of their influences?

What are the basic constructs of Python?

What are the control structures of Python?

What are variables in Python, and how are they used?

You'll probably need to CW the post to avoid the wiki police, but other than that there's no reason not to post a tutorial series of questions, and thereby learn a language while providing a resource for others who might want to learn a given language.

Expect, though, that once someone starts doing this, these will pop up all over the place as others will follow suit. It may result in a backlash from the community (all I see are these stupid tutorials!) but I believe this could be a very good resource for programmers, and a way to bring beginners into the community on a regular basis.