Rules of Programming

Table of contents

No heading

No headings in the article.

There are some major things we need to follow when you write a program / work on a project. As we all know practice makes a man perfect we must practice some rules when we write a program so that the way we write a program gets habituated.

Naming convention must always be followed. Always give a meaning full set of names for any variable you name. So that not only you but also other programmers also know what the variable does and what are the impacts if we remove the variable from the code or modify the value inside the variable.

Comments are the most useful part of the code. Always write the comments so that others can understand what the particular part of the code does or what the particular method or block of code does.

Remove unwanted code from the program. Remove the dummy loops and dummy conditions from the program and keep the code clean that is only keep the parts whichever is necessary and remove all the unnecessary parts from the program so that others donot get confused why the particular code is present.

Optimise code. First make a working solution for an issue and then test the flow and make sure there are no other impacts for the project. Save the code or commit the code to the git repository. Then perform code optimisation and again test the code and check if there are any other impacts and then commit it. Further try to optimise the code more by removing unnecessary conditions and unnecessary loops and unnecessary variables from the program to make it more space and time complexity optimised.

Did you find this article valuable?

Support Kantimahanti Sai Prasanna Kumar - Blog by becoming a sponsor. Any amount is appreciated!