Indentation improves the readability of the code. It is mainly used for code inside looping statements, control structures, functions etc. as good intended code is easy to maintain and is good looking. It makes the code more readable and easy to understand. Some programming languages like Python made indentation mandatory instead of using brackets, It makes code easy to read and understand.
Some Rules for indentation are:
- Each nested block should be properly indented and spaced with a tab space.
- All braces should start from a new line then the code comes following the end braces from a new line.
Example of Some Good Indentation Practices
1. Using Indentation in conditional statements.
b is greater than a
2. Using indentation in looping statements.
GeeksforGeeks GeeksforGeeks GeeksforGeeks GeeksforGeeks GeeksforGeeks GeeksforGeeks GeeksforGeeks GeeksforGeeks GeeksforGeeks GeeksforGeeks
Documentation is a very important aspect of programming. Good documentation in programs make it easy for user to read and understand the code. This is done by inserting comments in the necessary places to make the code readable and more understandable for user. Documentation is basically for users of the code to understand it even without the help of programmer. Add Comments in code and explain the code line and the code will be well Documented.
Once the Program is made, it is saved and stored as a software package. After some time if the program needs improvement or modification, the saved program is modified and saves effort and time as programs need not to made from the very beginning. Hence Modifications will meet the purpose only. Program maintenance is done as:
- Keep the last program.
- Modify the program for required improvements.
- Do not make new program from scratch, just use the last saved program.
- Save time and effort.
- Statement, Indentation and Comment in Python
- How to remove indentation from an unordered list item using CSS?
- Lex Program to remove comments from C program
- Why are there two folders - Program Files and Program Files (x86) in 64-bit Windows OS?
- Program for n-th even number
- Program for n-th odd number
- Program to get the subdomain of a URL using PHP
- Program to calculate age
- C Program to Add two Integers
- Program to print Hut
- Program to calculate value of nCr
- Program Execution in the CPU
- C Hello World Program
- Program for EMI Calculator
- Program to wish Women's Day
- Program for sum of cos(x) series
- Program to find sum of 1 + x/2! + x^2/3! +...+x^n/(n+1)!
- Hello World Program in Perl
- Program for volume of Pyramid
- Program to Encrypt a String using ! and @
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.