Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

This question already has an answer here:

I am C++ developer with some good experience on it. When I try to learn a new language ( have tried Java, C#, python, perl till now) I usually pickup a book and try to read it. But the problem with this is that these books typically start with some very basic programming concepts such as loops, operators etc and it starts to get very boring soon. Also, I feel I would get only theoeritcal knowledge without any practical knowledge on writing the code. So my question is how do you tacke these situations? do you just skip the chapters if its explaining something basic? also, do you have some standard set of programs that you will try to write in every new programming language you try to learn?

share|improve this question

marked as duplicate by MichaelT, gnat, Kilian Foth, Jalayn, Yusubov Jun 5 '13 at 13:29

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1  
Yet another "how do I learn another language" question. Sigh. –  Thomas Eding Nov 11 '12 at 1:54
1  
asked more than 2 years back though –  Naveen Nov 11 '12 at 4:38
    
Yeah, start with debug IIRC. Good advice no matter what for a new lang, imo. –  Erik Reppen Jul 17 '13 at 5:01
add comment

11 Answers

up vote 20 down vote accepted

Basically by writing code in that language.

You need to have a good example application to study/modify otherwise you're starting off on the wrong foot and you might never recover. Years ago we decided to use Ada for our next product, but as we all used FORTRAN in the previous product we ended up creating FORTRAN constructs in Ada. We never really recovered from that.

Having access to the documentation and Stack Overflow is essential otherwise you'll potentially miss the important features of the language. On that score find out who are the Gurus in the language and read their blogs, these will often discuss the new features of a language/framework and also the obscurer areas you'll never find by yourself. If you can't find out who they are ask here!

In an ideal world I'd like to learn by myself for a while and then be evaluated, but I've never managed that yet.

share|improve this answer
    
+1 For the "Just Do It" style, although you might miss some language essentials (eg. Anonymous function in C#, LINQ, ...), which can be though. –  Tom Wijsman Sep 14 '10 at 11:56
1  
@TomWij - Agreed - I need to clarify the answer. –  ChrisF Sep 14 '10 at 11:59
    
thanks for the answer..do you recommend any particular site where can I get the sample example application? as these languages are not related to my daily job I can not use that application for learning the language. –  Naveen Sep 14 '10 at 12:00
    
@Naveen - Code Project might be a good place to start. The applications/classes are usually very small as they are showcasing some aspect of the language. –  ChrisF Sep 14 '10 at 12:03
1  
As they say: real programmers write in Fortran whatever language they are using. –  High Performance Mark Sep 16 '10 at 9:34
show 1 more comment

You have many ways to learn a new programming language. I'd go with this method:

  1. Choose the programming language you want to learn first
  2. Read Books about it and watch good online tutorials
  3. Connect to an online open source code repository and download some projects
  4. Use the books and your brain to connect the dots with the "real life" code from the code repository

That way you'll learn the language itself and get to see how it is used in "real life".

Most important: Don't try to learn more than ONE language at the time. You'll screw it up.

share|improve this answer
add comment

I'm currently learning Ruby by using it to solve Project Euler problems. I do mostly embedded C work (also some PHP and C#) in my 9-5 job, so the Ruby stuff is just to expand my horizons a bit. I picked up a couple of Ruby books, then installed a good IDE.

share|improve this answer
add comment
  • Read a book

  • Write some code

  • If you have some doubts/problems then refer to Stack - Overflow

  • Repeat

share|improve this answer
add comment

Get a broad overview of the language by reading the complete manual; seems tedious, but will give you a sweeping view of the language, even if you do not understand most of the part. This advice is in contract to what 'BioBuckyBall' says above, but if the language manual is small you can easily complete the book in a couple of days.The main point is to "get" the gist of the language; at some point in reading, the whole concept of the language just "clicks"!

Next create a small project in the language in the domain you love. Initially do not try to dig deeper into the details. Usually if I'm learning a new language I try to create some functions or classes related to Statistics: like Standard Deviation and averages. This quickly gets me into arrays, iterations and data types. When learning a different language, again try these same examples, which will allow you to compare the syntax and semantics of the different languages on the same problem domain.

share|improve this answer
add comment

I like to first learn about the language fundamentals like the type system etc to get a feeling how things work as well as to see some basic example on how the code looks like. My preferred way of doing this is reading a book and I mean a real book that I can read while lying in the bed or wherever I want. The basics should be explained in maximum of 100 pages, preferably in much less. If no book is available, I try to find the information from the internet.

Reading the whole book is obviously a waste of time, because you are not going to understand the more advanced topics without any hands-on experience. At work there's usually already some code to work with so in that case I just start working on the task at hand. I learn little by little by reading what others have done and if I run into a problem, I try to google for the answer or that failing, ask from a coworker. After I have been working on a while, I try to finish the book.

If I have to start from scratch, I start by hello world, then try input from keyboard and file handling. Depending on the language, I might do some UI exercise. After that I would start programming the "real" program.

share|improve this answer
add comment

My approach is simply start writing in selected language, find pet project and do it. Read lots of samples, check others code, go through one bigger project source, find what you don't understand and read it up in the docs. Currently learning F# and bought the book - Expert F# - I find it incredibly difficult to focus and read through all of it without having to use it. But here's not only a new language, that's the whole paradigm shift from imperative to functional.

share|improve this answer
add comment

Don't try to read your programming books from front to back in a single or few sittings. I usually pick up a book and read a little at a time, usually not more than 10 pages, and for particularly dense books, just a couple pages. For 'soft' books, I may read significantly more, but I try to avoid them in the first place.

If, as in your case, you can already code in a similar language, start with a simple console app or something and do little exercises like

  1. Read/Write something from/to a file
  2. A little to-do list console app
  3. Test all the language features as you read about them
  4. and on and on
share|improve this answer
add comment

There is one book I really enjoy. It is called "Seven languages in Seven Weeks", and aims to teach you... seven languages in seven weeks.

It is a fun way of looking at very different languages, and the strengths and weaknesses of each of them. For each language, the book deals with a non-trivial problem.

Of course, the book is not a deep reference for either of the languages, but does show the essentials of them.

The languages covered are Ruby, Io, Prolog, Scala, Erlang, Clojure and Haskell.

share|improve this answer
    
Thanks for mentioning the book, it sounds interesting, especially as I have no experience in any of the languages. I might consider buying it as I would like to get familiar with many new languages. –  Carlos Sep 15 '10 at 19:46
    
I think this would be a waste of time. Learning seven languages in 7 weeks is like building Taj Mahal in three days. –  cseder Nov 10 '12 at 13:43
add comment

I haven't yet found a book that helped me much in learning a new language. Kent Beck's "Smalltalk Best Practice Patterns" comes close, but I could already muddle my way through writing something (in Smalltalk, I mean) by the time I read it.

The first rule is JFDI. Think of some application, toy, problem, whatever - something manageable, of course, and so reasonably simple/small - and try write it. You'll constantly run into "but how do I... ?" questions, which I at least find to be the best way of learning anything.

So then how do you answer those questions? Go lurk in that language's community. Read their documentation. Read the backlogs for their mailing lists. Chat on their IRC channels. You'll soon figure out who the alphas are. Read their blogs. Pay attention to what the experienced practitioners say, and be prepared to be wrong.

share|improve this answer
add comment

Bruce Eckel's "Thinking in ..." books are quite good for if you're switching between C++/C#/Java...

Python and Perl tends to be less related so it's more advised to start from the basics there,
or you will have to find a tutorial that's explicitly based on the assumption that you know how to program.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.