How to learn to code?
Published: 2023-10-11 08:32:11

Being from ECE (Electronics and Communications) background, I did not have much opportunity on coding as such (no Verilog doesn't count XD). It was in my third year that I had 2 Java courses on my plate when I realised it was high time. 

Much like my situation I guess you would also be in a similar situation, don't know where to start, planning a career switch into software industry or even choosing what language to learn. By the end of this article you will have a clear idea on if not the roadmap but atleast the next step to take.

## Who is it for?
To start with, if you extremely new to coding. Let me assure you it is very **simple**. In essence it is just learning how to interact with a machine or more specifically instructing a machine what to do.

Then, learning a language is not a tedious task either. If you are consistent enough. It will not take you more than 5 days to learn a language. By the end of 5 days you will have a working knowledge of the said language.

## Which language to start with??
According to the [survey](https://survey.stackoverflow.co/2023/#most-popular-technologies-language-prof), conducted by [StackOverflow](https://stackoverflow.com/) most of the professional developers are working on JavaScript.

![StackOverflow Programming Language Survey](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wd83n13rv0geqda8nuxq.png)

But what does this survey mean? Should I hop on the train and learn JavaScipt? But my friend tells me Python is the way to go or C++ is the real thing??

**_Answer:_** It all actually depends on what your objective is. 


- If you are planning to work in Web Development.

First learn HTML and CSS. Analogous to human body, HTML is like the skeletal system that defines the structure of a site. CSS is like the skin, that defines the looks.
Finally you learn JavaScipt, synonymous to our nervous system. It is responsible to listen to events, _React_ in a certain way that is intended for that site.

- If you are planning to work in App Development.

There is always a tussle between Kotlin, Java and Dart. It would be my recommendation to learn Java. Not because it is going to benefit for App Development, in that essence Kotlin and Dart have the upper hand. However once you are familiar with Java, migrating to any other language is a piece of cake. As the core concepts remains the same only the syntax is going to change. Besides as a bonus Kotlin is very much similar to Java so migrating would not be difficult.

- If you are planning to work in AI/ML Development.

Python is the only answer in this domain. Rest everything comes in later. However Python paired with a strong understanding of Statistics is the only way to go.

- If you are a student at the crossroad of where to go.

Learn Java, hands down. Do not fret about C++ or C or Python. It is the best of both worlds. From an interview point of view it offers advantage over Python in terms of speed of execution. From a beginner standpoint, it is very much readable and easy to use when compared to C++.

## Where do we learn?
While many would say that taking a course on Udemy or Coursera or watching some tutorial on YouTube. My personal choice is [CodeCademy](https://www.codecademy.com/). 

Not only they have many beginner courses for free but also their approach is really interesting if you want to deeply understand the core logics. Plus their interace is also very convenient and smooth removing all distractions whatsover.

![CodeCademy Interface](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p3xw3zv9jn2k26oejxdc.png)

They offer the concepts in the left pane, an editor in the middle to try out the tasks given and an output screen in the right to verify the output of the code.

Another recommendation would be to use [Scrimba](https://scrimba.com/allcourses). Scrimba also provides an interactive playground while learning, which lets you work and fiddle with the code and broaden your understanding of things.

![Scrimba Interface](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3zqfr8nz9joctvnksrjo.png)

## Remember...
Coding is **NOT** a one time process, if you believe that once you learn a language you will be golden, then you cannot be any further from the truth. Coding is an iterative process, you Google, what you don't know or what you are doing wrong. Learn the right or the optimal way and then improve. 

There is nothing wrong with Googling the solution as long as you understand what is happening. Infact, Googling is the only way you learn and expand your knowledge base and in doing so improve yourself.

## Final Verdict
My ultimate recommendation would be to start with Java, it is optimal for all domains. It lays the groundwork for all the core concepts which you can later translate into any other language. It is really beginner friendly and very much readable, has a massive supportive community which can help you with your queries, is still a popular choice amongst developers, ranking 7th. Many legacy systems still work on Java and their support does not seem to going down anytime soon. 

Overall, it makes life a lot easier and provides a smooth start into the coding journey.