Recently I gave a presentation on learning multiple programming languages quickly. The idea of the presentation was to quickly start coding in multiple languages and learn the toughest or the unique parts as we go along practising.
The technique is just common sense though, and has mostly worked for me in my career where I have used it to learn multiple programming languages – Java, JavaScript, Python, Go and Rust to name a few. I intend this article for anybody with interest to learn new languages.
In the hands-on presentation, I presented ways to understand Go, Rust and the newer Nim quickly.
Before we start:
- Basic knowledge of Programming – Differences between Object Oriented concepts, procedural programming and some previous experience in some programming language.
- Go and Rust are systems programming languages, which require the knowledge of knowing the internals – particularly network, multiprocessing, memory and other things you wish to use it for. Other languages like JavaScript requires the knowledge of understanding the Web and how various parts of the web work. The more general-purpose the language is the more specific becomes the knowledge – Python can be used for many types of apps and libraries, hence it is important to know fully the consequence of what you want to achieve.
- The most important aspect to a developer is maintaining the history of the changes made, hence on the way, knowing how git or any other source control tool works will be a great plus!
- Interest and time is of prime importance. If you have an interest you will make time!
Usually, any programming language has a learning curve. The lower the language is, the harder it becomes. Ruby or Python, for example, might take a week compared to C or C++, which can take weeks. If it takes that long to learn any language, why not learn more than one?
It is essential to pick conceptually similar languages. For example, if you are learning Ruby, Python becomes easier. If you are learning JavaScript, then mixing it with learning TypeScript or Lua can speed the understanding. It also helps compare the features and remember better.
This blog is also no about mastery in learning multiple languages. Mastery takes years together. This is about learning just enough to start coding meaningful stuff quickly.
There are few things common to every language –
Eco System
Eco-System is about how to build and ship. Every language has a source build system, a way to ship for distribution and tools to help build everything.
- Java has the javac compiler, jars for distribution and the JVM for the runtime.
- Similarly, python has a runtime installation for running python scripts. IT also has tools like egg and wheel for distribution.
- Go, and Rust produces system binaries that can run natively without a VM. Go binaries are usually bigger as it compiles a runtime into the binary. Rust has a bare minimum runtime – the coding style itself helps to manage the memory and other safety.
- Rust has Cargo to create, manage and compile projects, while Go has “go tools” to do something similar.
Defining Functions
Every programming language has a way to declare code blocks, provide an entry to run the code. Keywords such as func, def, fn are used to declare blocks of code.
Additionally, special blocks named “main” exists in many languages, including Go, Rust, C/C++. While Python and Nim, the body of the file itself is the main function.
Decision Making & Looping
The most important part of any code is decision making and looping. Every programming language has tools to enable decision making and looping.
Go handles looping using the for keyword itself for looping over a range, dictionary or sequence. Rust has for loop and while loops similar to many other languages.
Memory Allocation
This is probably the most complex part of a programming language – How to declare a variable, how to destroy after the usage. Higher-level languages use different techniques such as garbage collection and other methods for automatic memory management. Lower-level languages like Rust use several language constructs to help with allocation and deallocation – particularly mutability, ownership and borrowing and lifetimes. Go has a garbage collector along with pointer constructs to offer for managing memory efficiently.
Source Structure and Modularisation
Modularisation and dividing similar functionality, albeit being not as important as others are of deep importance. Languages like Java enforce it by the way code is written into directories. This affects how reusable code is imported and shipped. Rust has modules and cargo for the same purpose while Go borrows a little bit from java. Go also has a specific $GOPATH which makes it a good practice to develop sources in a specific location.
Other Things
OOPS is different in each language. Java is considered a pure Object Oriented Language while JavaScript has a prototype-based inheritance. GO may or may not be called OOPS and Rust is only interface implementation based object-orientism.
Every time I have to learn a new language, I approach them not only with understanding these 5 concepts, but also by writing code and using aspects of those. Here are the example I used:



end.
Leave a Reply