Many computer scientists and software engineers will be familiar with this task, learning a brand new language to complete your project in. It happens all the time in our field. It actually happens so often that we take for granted the skill which allow us to accomplish such a task. The other day I was helping a colleague out while they were attempting to learn the Flex 3 and Actionscript 3. A lot of what he was doing was counterproductive to his learning of the language. In his defense, he is an old school developer who learned a lot of OOP (Object Oriented Programming) languages and not a lot of scripting ones, so while he was going through these little trial programs he was creating he was implementing OOP methods of design that have no place in a Flex/Actionscript world. What follows is a basic guideline on how to acclimate yourself to a new language when it is needed.
1 – Know your terrain
It is important to know what kind of language you are dealing with before you start coding in it. The type of language will determine what mindset you need to be in to code within it. Coding in JavaScript is not the same as coding in C++. JavaScript is a series of functions that a called as needed, usually by some other language like HTML or the GWT. First thing to do is figure out what coding style your language falls within. Is it a scripting language like PHP or JavaScript, an OOP language like C++ or Java, a functional language like LISP, or maybe it is a hybrid of several of these like many of the new languages are these days. Once you know, do a little research into how these languages are developed in the real world, or draw upon your own experiences with a language similar to the one you are trying to learn. This may seem like a pointless endeavor at the start, but by completing this step you will have a much deeper understanding of your new language and where it is coming from.
2 – The concepts are the same
There is a set list of things that most programming languages can do. Loops, If statements, Function declaration, resource importing, class creation, variable declaration, etc. These concepts and techniques are used across all code and are used a multitude of times in all code. It is important to figure out how these commonly used coding techniques are implemented in your new language at the start. Many are fairly standard across all languages, but sometimes there are little nuances that can trip up even the most experienced coder. By figuring out how these basic things are done up front, you will save yourself hours of research time later.
3 – Testing the waters
When starting a new language it is always good to try it out a little. Now that you know the basics of how to use your new language and what kind of language it is, write some test projects. Try to do the basics first, the so called “Hello World” applications. Run thru any tutorials that are provided in order to get a better understanding of how the code is actually implemented on screen. Also, take this time to familiarize yourself with the development environment. It took me a long time to figure out how to use Eclipse coming from .NET once I moved away from C++ development and started developing Java and Actionscript. The environments were similar, so I didn’t take the time to learn the Eclipse environment right off and suffered for about 3 months before sitting down and teaching myself how it all worked.
4 – Conceptualize
Now that you have learned the basics of your new language and its environment, get a little more advanced. You are most likely learning this new language for a specific project or set of projects. If you already know what these projects are going to do, write some small proof of concept projects that allow you to get more specific with the new language. These projects will help you to understand how your new project at work will work within the new language. As an example, when learning Flex and Actionscript I knew that a lot of the GUI’s I would be coding were going to need Drag Drop functionality, so I made a few simple projects that taught me how to manipulate the data in a Drag Drop format and how to create my own Drag Drop managers for those elements which didn’t have it already built in.
5 – R & D baby
At this point you should be feeling quite comfortable with your language. It is no longer new and scary like it was when you started step one. You are now ready to really start using the language in the real world. You should be comfortable using the simple concepts of the language, as well as some of the more advanced aspects. More importantly though, you should have a good idea about how your project is going to be coded and developed within the language.
Using these simple guidelines you should be able to learn any language you will ever encounter. Remember that there is no set amount of time it will take to learn a new language however. A language could take you a week to learn, but take others days or even weeks to get to the same level. It is also important to remember that you do not know everything about the language, few people every really do. Always know that the internet is vast and resources such as forums, blogs, guides, and help documents can give you the solution to most any problem, or at the very least point you in the right direction.