Programming tips
These tips are generalized and not to any specific language that is the reason why I included code from many different languages. The techniques are almost the same though variations exist in the syntax of things.
By referring to variations, I mean the different methodologies of coding, e.g

So let the tips come.
When beginning a method, class, loop, function, condition statements (such as if, switch, etc), open and close it before starting to code.
e.g.
|
if(condition) { //place this and the closing of the curly bracket first, then code //this reduces a lot of problems faced when writing complicated problems /*don’t start typing here first*/ } |
By this a typical error is often removed that is just because of the { , } that is often encountered by new programmers.
Code indentation
Indentation is normally done using the tab key typically 5 or 6 spaces are left.
e.g. the following is a C/C++ code.

Indentation helps when catching errors in larger programs such as databases. In a database related program where a database such as SQL, Oracle. Etc run in the backend the code is very complicated and there are lots of things we have to do. So why not indent the code so that errors can be caught easily. Not only are database programs long. Full calendar software in C exceeds 500 lines with a lot of nested loops, and conditional statements. So if the code is poorly indented, there is very little probability that the code will run properly without any abnormalities. Where as in indentation we can figure out the loop of conditional changes and make necessary changes to it to fix the problem.

Comments inclusion
One of the very crucial points, often the point where many of the new programmers have difficulty in. when we start making larger more sophisticated programs (i.e. that involve more lines of cod, we can’t figure out every time that this variable was for this purpose and this was for this purpose). This often is helpful when code has to be updated. That is miscellaneous bugs have to be removed.
Ways of commenting.
One is the single lined comment that is started with // here is a comment
Another is the multi lined comment which has syntax as follows
/*
Here is comment line 1
Here is comment line 2
Here is comment line 3
*/
Here is a sample java code with and without codes.
Include author(s) name, created on, version, and purpose of program in the beginning of your source code. Source code is the code that we wrote. This way user knows who made the code, no on can claim that he/she wrote the code without seeing the source code.
How to write it?
The following template can be used in most of the languages such as C, C++, Java, etc.

Name Variables, pointers, functions, classes properly. Do not name the variables randomly as this can create a lot of complexities in larger programs.
e.g.
we are naming both the variables for the use of date.
int d; // d will be hard to remember
int date; // but date can be easily remembered
What about the case for first name. Many things can be done;
This is not allowed in most of the languages
char first name [100];
Correctly we can name variables such as
char first_name[100];
char f_name[100];
Use of data structures
The purpose of data structures is to help us to use fewer computer resources and do a specific purpose without the hesitation of buying a new computing machine.
E.g. we have a record of cars for a whole city. We have 10 million cars in the city. We want to store them in a database, if our program is badly written it will take up hours, days or even weeks to execute. Where as if our program is written properly with the use of data structures we can minimize this to even 20 minutes. The process we are doing on the records can be sorting, searching, or any other thing. We are using the same computer for the manipulation of records in the system.
Always make an algorithm, flowchart, what is the point of getting into more trouble? Actually this is even a little time consuming when writing small programs.
Algorithms are not meant for any programming languages; instead they can be used to create the same program in different languages.
A sample Algorithm is as follows. This algorithm shows the process of registering a user.
Registering a User

This is done because when writing complex programs is not that easy, one can not just open up the compiler and start coding. When working with larger systems, we need to design it properly so that bugs are not there as well. We often use a model called ADITE model (Analysis Design Implementation Testing & Evaluation) to create full systems. The following is a flow chart






