Demystifying the Secret to Coding: How to Begin Coding?

If you want to know the best way to become an amazing programmer, you have come to the right place!

Ananya Banerjee
The Startup

--

Source

This article is intended for people who have little or no experience coding and are beginners to the world of programming. If you want to make yourself an excellent coder then the strategies discussed below will definitely help you achieve that. Let’s begin!

If you are new to programming, the first and most important thing to do is to choose a programming language. There are a lot of programming languages such as C, C++, C#, Java, Python, Go, etc for you to choose from. I would suggest choosing an object-oriented language such as C++ or Java as your first programming language. Please note that other articles might suggest beginning with other languages, and it is completely okay if you are working towards a specific task, and they demand you learn another language first. However, if you merely want to start coding and are unsure, I feel choosing C++ or Java as your first programming language helps you understand a lot of OOP(Object-Oriented Programming) concepts such as data abstraction, encapsulation, inheritance, polymorphism, etc. (If you are unfamiliar with these, don't worry! You can have a look at my article on OOP here.). Another reason to choose C++ or Java is, if you choose a programming language like Python, it contains a lot of built-in functions and libraries for tasks such as sorting, searching, etc. Though this might be convenient and easy to use, you lose out on the opportunity to learn how to code them yourself, and for a beginner, it is extremely important to learn the what, where, and how of everything before even attempting to use built-in functions and libraries. Thus, using a language such as C++ or Java helps make your base solid because you understand the underlying concepts behind a lot of the code that you will write in the future. As a result, this solid base helps you build an even stronger grasp on the entire concept of programming.

The next step after choosing a programming language is choosing an appropriate IDE (Integrated Development Environment). An IDE is a software for building applications that consists of developer tools that help you code using an easy-to-use GUI or Graphical User Interface. If you have never heard of an IDE, it's completely okay. Do not worry about it. Simply put, an IDE is an interface that helps you code, executes your code, and shows you the results in a very developer-friendly way. Some popular IDE are Spyder, IntelliJ, CodeBlocks, Eclipse, etc. You can download any of these IDEs and install them on your computer. Just remember to install the correct version for your operating system. Just follow the steps written on the downloads page of these websites.

Example of Eclipse IDE with spring tools

Now, that you have armed yourself with appropriate tools, you have two primary ways of learning a programming language. The first way is choosing a good course from websites such as Coursera, edX, Udacity, etc. You can choose any course that you like on these websites which are for beginners and begin your coding journey. The second way of learning to code is to use tutorials on websites such as w3schools, Bucky’s C++ programming tutorials, Code Academy, etc. Even though both of these approaches are good starting points, I feel that the best way to learn is to keep learning new things every day. Try to do small projects in the beginning. Projects help you get a practical understanding of everything that you will have learned in the basic courses. This makes sure that you know how things work in the real world and can link your theoretical understanding with practical applications. As a result, your understanding of the entire language gets enhanced a thousand-fold.

Source

Once you have understood the basics of how a programming language works, start learning about different data structures such as heaps, trees, queues, stacks, lists, arrays, graphs, linked lists, etc. Knowledge about what these data structures are and how they work, help you solve a variety of problems. Let me give you an example. If you own a supermarket and you want to create a supermarket inventory, then you need to think of storing data in a way such that you can have frequent insertion, update, and deletion actions without much loss of efficiency. If you choose a data structure where the cost of each operation is very huge in terms of both time and money, then you will end up losing a lot of your profit which you could have invested somewhere else. Thus, choosing a good data structure is extremely essential for any programmer.

List of Data Structures to know about:

1. Arrays

2. Lists

3. Linked List

4. Trees

5. Graphs

6. Heaps

7. Stacks

8. Queues

The next most important thing to learn about, are basic algorithms for tasks such as searching, sorting, traversal, etc. Algorithms such as Linear Search, Binary Search, Bubble Sort, Selection Sort, etc are a few of the many essential algorithms that a programmer should know by heart. Let me list them for you according to category.

Basic Search Algorithms: Linear Search, Binary Search

Sorting Algorithms: Selection Sort, Bubble Sort, Insertion Sort, Merge Sort, Quick Sort, Heap Sort, Bucket Sort, Counting Sort

Traversal Algorithms (For arrays, trees, graphs, etc): Depth First Search (DFS), Breadth First Search (BFS)

Graph Algorithms: Prim, Kruskal, Topological Sorting, Dijkstras, etc

Other concepts: Dynamic Programming(DP), Recursion, Memoization, Hashing

Please do note that this list is in no way exhaustive, but it can be used as a good starting point. The best way to learn these algorithms is to try to implement them and use them in problems. For this, you can use websites such as Codechef, Codeforces, Leetcode, HackerRank, etc which allow you to solve problems based on tags. This lets you choose which kind of problem you want to solve and helps you gain a practical understanding of it.

Image showing Leetcode interface

Last but not the least, the most essential thing is to be curious. Ask yourself the reason behind every line of code. Ask yourself what it means, how it works, and why it is necessary to write in a particular way. The more curious you are, the faster you learn and the better you become. I feel the real secret behind becoming a better coder is to be incredibly inquisitive and constantly challenge yourself. If you learn a new concept, try explaining it to someone who doesn’t know it. If you can explain it to them in a simple way, you definitely know that you grasped it well. I truly believe that if your concepts are clear, then no matter which kind of question you are asked to solve, you can definitely think of a way to do it. The right attitude will take you miles ahead of others but only if you are persistent, curious, and hardworking. Thus, as long as you keep working on different kinds of problems and trying to learn new things, you will no doubt become a great programmer.

I hope this article helped you get a good understanding of how to begin coding. Please like, comment, and share the article if you liked it. You can also follow me for more articles on programming.

Thank you so much for reading! 😊

--

--

Ananya Banerjee
The Startup

Software Engineer 3 @ eBay. University of Texas at Dallas Alumna. BITS Pilani Alumna. You can follow me @ https://www.linkedin.com/in/ananyabanerjee15/