Languages come and go with surprising rapidity in the field of computer science. In no other discipline do people change their fundamental tools with such frequency. This being the case, you can expect that you will be called upon to learn new programming languages very often over the course of your career. Which naturally leads to the question: How do you go about learning a new programming language? Fortunately, there are a few simple hints that make the task of learning a language easier.
Hint 1: First identify the basic data types supplied by the language. Almost all languages will provide you with simple integers. How about long or short integers? Enumerated types? Characters? Strings? Does the language support floating point values, and if so what ranges? If your problem requires you to use a data type that is not supported by the language, use another language.
Hint 2: Identify the basic data structures supplied by the language. APL supports rectilinear homogeneous arrays, Lisp makes it easy to write list structures, and Snobol provides generous support for strings. Perl provides tables (indexed dictionary-like structures) as a basic tool. Java supports classes and interfaces. Any problem you envision solving must ultimately be expressed in the data types provided by the language, so a basic understanding of the implications of the choices you have is a foundation upon which everything else is built.
Hint 3: Does your language provide any built-in operations? Prolog supports search as a basic mechanism. Functional languages (ML, Haskell) allow you to create new values, but not change existing structures. Snobol gives you string pattern matching as a primitive operation, APL provides matrix operations. The list of built-in operations will indicate what problems the designer of the language felt were most important.
Hint 4: Understand the class of problems the language is intended to help solve. Languages do not develop in isolation, they are created for a reason, usually a specific type of problem. Study the type of problems the language is being used to address. Try to understand what features of the language make this particular problem easier, and why those same features might make other types of problems difficult.
Hint 5: See if there are any useful libraries available for your language. The programming language you use to solve a problem is just the first tool. Often there are libraries of useful extensions that people have developed that can also be used to address new problems. Smalltalk comes with a massive library of existing code. C++ now has a standard library of common data structures. Java has libraries for many networking tasks. Search around and see what is available.
Hint 6: Emulate, Copy, and Steal. Start with existing and working copies of programs. Make certain you can get them to work on your system, which may be slightly different from the systems on which they were developed. Study the programs to figure out how the different language features are being used.
Hint 7: Experiment and Evolve. Once you have a few working programs, Experiment by making changes. Can you evolve a working program to make it solve a slightly different problem? Can you take one small part of a program and change how it addresses whatever problem it is solving?
Hint 8: Redo some previously solved problems in the new language. Take some programs you have earlier written in a different language, and try to recode them in the new language. Try not to make a statement for statement copy, but think about how the language features of the new language can be put to use in the new version. Note carefully what is easier to do in the new language, and what is harder. (The famous ``hello world'' program that is now traditionally the first program written in any language is an example of this process).
Hint 9: When you are faced with a new problem, think about previous problems that you have seen that have features in common with the new problem. Then go back to the habits of emulation and experimentation.