How to learn coding?

What is coding?

Writing a set of instructions to solve a problem using a computer is coding

Coding is all about problem-solving. To become a successful coder you should be good at thinking on your feet and coming up with a solution.

Computers can not think, and solve problems on their own. A user has to write specific instructions to solve a particular problem.

Prerequisites to learn to code

Understanding and knowing how to use a computer is the basic prerequisite. Apart from that understanding how to install/uninstall software is also very important. Following are the most basic prerequisites for learning to code:

  1. Booting up and shutting down a computer

  2. Learn basic computer usage, such as creating or deleting files/folders.

  3. Using basic programs such as paints, docs, excel, etc.

  4. Install/uninstall any program on a computer

  5. Understanding the basic computer architecture

  6. What is CPU

  7. What is RAM

  8. What is a hard disk

  9. What are files

  10. What is GPU

  11. Whats is motherboard

  12. What is an operating system

  13. How to mount and unmount a storage device

  14. Install operating system, either Linux or Windows. Learn disk partitioning.

  15. Learn the usage of the command-line interface, either bash/sh/ps

  16. Learn the usage of an editor, either Vim / Gedit / Visual Studio Code

Langauge to start coding

Python is undoubtedly the most popular programming language to learn for a beginner. It is easy to learn and can be used to solve problems ranging from simple automation to solve complex applied artificial intelligence problems.

Python was built using C, CPython is the default runtime of python programs. Python is designed to handle automatic garbage collection, user doesn’t have to worry about objects lifespan.

Automatic garbage collection frees the programmer from manually dealing with memory allocation and deallocation.

Using a simple language for learning helps the user to understand/focus on the real purpose of solving a problem, rather than dealing with advanced internal things like memory allocation and deallocation.

Python is a good language for absolute beginners. It derives many of its critical features from ABC, a language that was designed specifically for non-experts [ABC].

Gradually once a user is ready to learn the advanced concept, the user can pick up low-level language like C, C++, etc.

Another powerful and faster language is Go, which can be used to build a complex server-side application.

How to Start

The best way to learn programming/coding is through understanding data structures and algorithms (DSA).

DSA is the backbone of the foundation of solving problems using a computer. Understanding and applying the right data structures and algorithms for a particular problem are crucial to being a good programmer/coder.

DS

A data structure is a data organization, management, and storage format that enables efficient access and modification. Understanding DS fundamentals is necessary to write efficient code.
To start with learning the following data structures:

  1. Queue
  2. Linked List
  3. Stack
  4. Hash Tables or Mapping
  5. Heap
  6. Tree
  7. Graphs

Read and understand these DS topics thoroughly, implement all these using Python. Implementation is very important to learn and test your understanding. These DS topics will help solve problems efficiently.

Algorithms

An algorithm is a finite sequence of well-defined instructions, typically used to solve a class of specific problems or to perform a computation.

To start with learning the followings algorithms:

Search

  1. Binary Search
  2. Linear Search
  3. Breadth-First Search
  4. Depth First Search

Sorting

  1. Merge sort
  2. Quicksort
  3. Heapsort
  4. Insertion sort

Iterative algorithm and Recursive algorithm

  1. Recursion
  2. Dynamic Programming

Read and understand these Algorithms thoroughly, implement all these using Python.

Solve problems related to these algorithms to get a clear idea of their usage and increase your understanding depth.

Solve problems related to these DS topics and Algorithms from websites such as Topcoder/Leetcode.

Complexity Analysis

There are many ways to solve problems, but all solutions are efficient. It is important to make sure that the solution to a problem is optimal in terms of time and space usage.

Complexity analysis helps to understand the time and space complexity of a solution.

To start learning how to do complexity analysis for the above algorithms.

When solving problems, if you are stuck go back to the related topic of DS or Algorithm and revisit.

Spend as long as you need to understand DSA.