HOW TO GET STARTED WITH PROGRAMMING
Before we dive into programming, let’s have a look at the skills that make you a Good Programmer.
- Knowledge of one Programming Language (C, C++, Java, Python, …. etc)
- Problem solving skills
- Basic Knowledge of Algorithms
- Need to have an idea about the different online platforms like (Hacker rank, hacker earth, Spoj..etc)
- Identify the roles that you are looking for, which could be a Developer, tester, etc
- Learn the Programming language basics of your choice, try to solve the simple problems in the beginning.
Note: If you are a beginner, I’ll suggest you to start from C as the preferred language.The reason behind this is that the built-in functions for the C library are less when compared to other programming languages. In this process you will implement your own logic for the problem. Likewise, you can improve your logical and coding skills. Beginners link
Textbooks for C Language:
- Dennis Ritche’s book is the best for learning C
- Darrel Graham
- C Programming Absolute Beginner’s Guide, Third Edition, Greg Perry, Dean Miller, Pearson Education
- Programming in C, Fourth Edition, Stephen G. Kochan, Pearson Education
- Let Us CBook by Ashutosh Pandey and Yashavant Kanetkar
- Practical C in O Reilly publication
- Choose Object Oriented Language of your choice and implement the same. Hands-on experience is the most important thing.
Textbooks for Java:
I suggest you refer to ‘ Deitel & Deitel’ completely.
In addition, O Reilly has a lot of books for each Java package which are extremely good. But it's not suggestable for beginners. If you have basic knowledge of Java, then I strongly recommend you to go for it.
- A programmer needs Basic ‘Data Structures’ knowledge and learns the basics crystal clear. Experience hands-on. Make a habit to solve at least 2 problems per day.
Note: Data structures are more essential when it comes to competing in good computational and programming contests.
Advanced Data Structures TextBooks:
Algorithms Part I and II by Sedgewick and Wayne
- Choose Cpp as preferred Language and practice the same. Learn the Basic Data Structures and try implementing those.
Note: The reason to learn Cpp is because Java is not a purely object-oriented programming language. Most of the programmers prefer Cpp because of its flexibility.
- Let Us C++ by Yashwant Kanetkar
- The C++ Programming Language by Bjarne Stroustrup
- C++ Primer by Stanley B. Lippman
- Programming: Principles and Practice Using C++ by Bjarne Stroustrup
- Try to learn about the Complexity of the Programs and try to reduce it by applying the efficient solution.
Note: Here comes the calculation of the complexity related to time and space. Program should be efficient from all perspectives.
Textbook for Advanced data structures:
Introduction to algorithms by LCR (Cormen)
Step By Step Procedure need to follow to get the accurate and efficient solution
- Before attempting the problem, analyse the problem statement with keen observation. Read the problem statement again and again till you get a clear idea on the given problem statement.
- Once the problem statement is understood, think about the logic in different directions and try to optimise the time complexity in every possible way.
Example: Consider the problem statement of printing all the prime numbers up to a given number.
- The first and foremost approach of yours will be a naïve approach (brute force).
- If you think further, you can skip all the even numbers. This will reduce half the computational time.
- If you think further, eliminating the divisors will be helpful.
- Further into, you will get another approach i.e the sieve approach which is the best in this case. Likewise, by analyzing the question, try to reduce the time and space complexity, finally ending up with an efficient solution.
- Once you get efficient approach to solve the problem statement, don’t directly dive into the program, write your own testcases, cross validate with your logic. Note: The test cases must be framed for different scenarios such that it makes you think if your developed logic will fail for any of them.
- Once done with the testcases, think about the data structure that is apt for your implemented logic.
- Once the data structure is identified, choose a programming language that you like. (In rare cases choosing the programming language also plays a vital role).
- Finally while implementing the program, it is suggested to follow some best practices.
- While writing the Program (of your preferred languages) you need to follow the coding standards. Do not simply add headers/libraries to your program. If the library/header is not used in your program, it might lead to unnecessary consumption of the memory.
- Divide the program into a number of pieces, making each piece one function. We strongly recommend that you that the driver program(main) should not contain anything except the input, function calling and the output.The reason behind this practice is if your implemented code is more than 100 lines, then it will get very difficult to identify the mistakes committed. Technically, debugging is very difficult if you implement the entire logic is in one single function (that is :main)
- Do not print the output in the function if you get your desired output. Always, return the output to main function and display using the standard output functions, which is very helpful while debugging.
- Try to minimise the variables usage as much as possible.
- Readability of the program is also an important aspect, your code must be easy to understand. Naming convention must be followed when necessary, that is, do not give random names to variables/methods. The names must be such that they resemble the functionality/usage of the method/variable.
- It’s always a good practice to write comments regarding functionality of the function, and anywhere else necessary. This will be very helpful when you revisit your program after long time.
Linear Data Structure
Popular Algorithm Techniques
Non Linear Data Structures
By this time, you are already pretty good with programming. You will do better than most of undergrad CS students. If you want to learn more and delve deep read more.