How to learn a programming language ?

My Journey in Coding

I have been learning how to write code in various languages for almost a decade now. I started writing code when I was in 8th grade and first got my hands on HTML language. We were taught basic HTML principles and syntax, but I didn't stop there, I was curious to learn how to beautify the plain text webpage, so I ended up learning CSS. Then slowly I wondered how I could add buttons and add functionality to them, so I ended up learning Javascript. Curiosity is the only way that will pave way into the beautiful land of coding.

DOOM 1: Old game, that made me curious about the programming of computer games

Roadrash: Another game that made me curious about the programming
 

I love computer games like many other people do. Whenever I sat down to play games, I thought to myself about how the game could be programmed, how can us humans make computers understand these entertaining and engaging piece of software. Internet is the best resource available to learn all sorts of things, most importantly, programming. So, I started diving into the would of low-level programming in C/C++. By this time, I was in my 11th grade, and I had chosen Computer Science as one of my preferred stream. I'm glad that I made that decision, because having the theoretical background really helps in understanding the core concepts which are pretty much language agnostic. Concepts like Data Structures, Algorithm designing etc. is what really helps in understanding and getting a feel for writing a program. By the time I finished my 12th grade, I knew C/C++ fairly well. Then I opted for Bachelor of Science course with triple major in Math, Physics and Computer Science. Here, I was exposed to all sorts of languages like C/C++, Java, PHP, HTML, CSS, SQL, shell etc. The core principle for me was that whatever was being taught as a part of my course, I wouldn't just stop at that. I would go on and build some interesting projects, which would help in realizing some of the bewildering concepts of programming. I did not only like programming, I loved combining things with Physics and Mathematics, and created various simulations and programs that made use of the concepts that were taught at college.

Currently (as of this blog post writing in Feb 2024)l, I'm in my final semester of Masters in Physics. I mostly code in Python these days, because I use that for my Masters thesis project.

Now, as the title says, I'll come to the point of,

How to learn a programming language ?

DISCLAIMER: Programming lingo ahead 

First of all, the question one should ask before jumping to learning a language is why to learn that particular language ? What is it that can be achieved by learning it ? Answer to this will help save the time wasted on learning something that isn't going to help in whatever problem it is that someone is aiming to solve. If one chooses to learn out of interest it's a different thing, and one can skim through the basic concepts of a language like syntax, loops, principles etc.

C++ code

Once the initial hurdles of basic concepts of a language is learnt, next step, which is crucial, is to create something with whatever was learnt. This should be a bite size program (pun intended :)) that solves something or does something. This way is absolutely 100% efficient in learning a language because it will make use of basic concepts learnt like the looping constructs, conditional statements etc. Next step would be to advance into learning some more complex concepts and then repeating this step of creating a project based on what's learnt.

Learning a language just because someone else told you, or just following the masses, or to just secure a job is really a bad idea, and it would, honestly, increase the time taken to learn a language, if at all one possibly "finishes"  learning. We all know that learning never stops, same goes for computer languages also.

It is OKAY to refer to codes from websites like stackoverflow, or use AI chatbots to solve some problem. It's always a plus point if one understands atleast 5-10% of code that is  is being copied to progress learning. Another tool I'd suggest is Github Copilot and other AI programming assistants, eventhough I personally never used them, they seem like a good option when just starting out to code.

Recommended pathway for learning to code

Like most people recommend, I'd suggest anyone new to coding, to start with Python. Once comfortable with most parts of Python, then maybe, if necessary, and if performant code writing is what one aims for, then go for C/C++ or Rust.


The preferred languages for most applications are available on the internet. Once, any one language is understood properly, then, learning any other programming language is simple as understanding the syntax and other concepts unique to the language. Most of the concepts remain the same, like conditional checking, looping, error handling etc.

As a side note, it's really important to understand few concepts of Math like Geometry, Graph Theory, Number theory etc. if someone really wants to get into areas like Game Development, Cryptography, Computer Science research etc.







Comments

Popular posts from this blog

My experience of the Winter School held at IISER TVM

SonifyCPP - A software for converting images to music magically

First time participating in a solo instrumental event