Tips For Learning A New Programming Language
Photo by Andrew Neel on Unsplash

I always wonder on what to advice when I see a question like should I learn ‘Python or R’ , ‘Java or Ruby’, , ‘Lisp or Prolog’, ‘Ada or COBOL’. (I never saw the last one actually). In my opinion the answer is always obvious. Both. Probably my approach to learn a new language is little different from others.

Learning any new thing requires, time , patience , practice and motivation. One of the reasons we are in a dilemma question like above is scarcity of few of these essential elements needed for learning and mostly it is time. We don’t have time.

If you are a beginner to programming itself, you probably need a different approach. My worst suggestion to anyone ever is to start with one of languages in alphabetical order. Still it works. Once you have learnt that rest of this article will apply to you. I know time is precious in your case as well but mostly you ll spend time learning things common to most programming languages.

Components of a Programming Language

I divide my learning experience of a modern high level programming language in learning 5 parts of that language

Core concepts : All the programming languages are simulations of a machine for which hardware doesn’t exists and binary code based machine is used as core of this purpose.Therefore many constructs in most of the programming languages are the same but implemented in different way. Only the syntax for those core concepts is going to change. Some of the core concepts of almost all high level programming languages are :

Looping

Branching

Interaction of I/O device , including console and file

Data types

Scope definition and blocking the structure.

There are more but these features are the once that you would find in any programming language.

2. Language specific features . If you are learning object oriented programming you need to understand the implementation of polymorphism, inheritance and encapsulation. Except for the syntax all the features are common. Tricks like tail recursion etc applies tp functional programming. Now when you are learning a programming language you need to be aware of type of programming language you are learning what are feature you need to learn.

Language specific features are the once from where your path starts getting diverged for each language. Pointers in C, garbage collection in java, lambda in python are the things that are unique to those languages. You might find flavors of these features in other languages as well.

3. Platform specific features.

These features are more relevant to those who are learning a language that supports low level features and interaction with hardware and devices.

4. Third Party Library related features

This is more on how a programming language supports its interaction with other languages , platforms , frameworks etc. For example in case of java there are different ways interacting with languages like C using JNI, with Messaging queues using JMS , and with internet using frameworks like JEE. Ideally these things should come in later part of your learning once you have fair understanding of core components of language.

5. Libraries

Libraries are where the real fun is. We mostly use the features that are implemented using a specific programming languages. The more we know about libraries developed by others and their proper usages , the less we ‘ll have to repeat the things. Suitability of a language to implement specific type of library makes that language more suitable for that type of application.

Order of Learning

Depending on the programming language you are learning and your need you can choose the order in which you learn these components to master a programming language

Usually one of the last things in journey of ‘traditional’ learning of a programming language is to learn and use libraries. However, we start learning and using packages from very early stage of programming language. io libraries of C, and java are some examples. In fact some people learn libraries of some languages before they actually learn the syntax and core concepts of a language. R is one of the examples. You can start using before learning some languages.

You can determine what type of user you are and that might impact the approach you take to learn a programming language very fast.

Points To Remember

Following are some tips that can be used to make learning fast and sustainable without getting frustrated much.

Learn to Unlearn. This advice is suitable for those who already know some programming language and while learning new language try to implement things , replicate syntax and follow methodology from previous language. Well reusing what you have already learnt is obviously important but there is a clear reason why the new thing came into picture when the old one is already there or why still have to go to old one when new one was there. A lot of time is spent in learning new language while trying to replicate concepts in new language in old way. One example is C++ programmer trying to implement finalize method in each class while learning java in the same way he implemented destructors in C++ class. Identify the Learning Order: Each language has some primary feature based on which all the other advanced features are built. A quick way of learning a new language is just to focus on those core feature first. For example in java you need to learn core concepts before jumping into using libraries network programming. Identify the purpose of use. This advice goes back to the advice 1. While learning focus on those features that are naturally suited for that language. For example, implementing multithreading in java is more matured than it is in python. Similarly, dataframe type of objects are more matured in python and R. Partially because of design and partially because of trend. (Don’t) Avoid Reinventing the wheel. Find an invented wheel, try to break it into pieces and then see how you can fix it. Check for the community support available for language and see how the things are implemented that you want to implement. Keep checking your progress. You can simply have a counter on how many hours you spent on studying or how many features you learnt. just count according your own criteria. Collaborate with other Programmers. I hardly need to emphasize importance of this. Split your time wisely between Studying and Programming: Some people might take an approach of just using computer screen to learn programming. Following tutorials and keep applying. Others might be just going through the code written by other people without trying by themselves. Well, you need to have a mix approach. You can device your rule. I usually follow 70/30 like 3 hours programming per 3 hours of study. (I am just making it up . ;) ) Experiment with your code : In my experience thing that I remember longer is the one with which I struggled a lot. It makes a good story to tell on how you fixed a certain bug or how you came up with a clever idea while experimenting with something. This story has a learning not only for others but also for you. Select Learning Tools wisely: You don’t need to stick to a specific editor or environment just because it worked the best for you in past. Many of the smart people have gone through the pain and developed something that might look uncomfortable in beginning but helps in long run. While learning python you can choose jupyter notebook or PyCharm but if you are using visual studio code and want to continue with the same it might get little difficult. Learn how to use code sharing platform : As an optional step Learn github. Also learn Maven , npm and those type of things on how libraries and code are distributed.

Just Remember that these are suitable while learning a language not while developing a production level code. You need to follow coding standards while developing your software using these languages.

I hope these are helpful for you. Happy learning !
['Pankaj Kumar']
['Java', 'Learning And Development', 'JavaScript', 'Programming', 'Python3']