January 2019
Beginner to intermediate
776 pages
19h 58m
English
This is similar to what we do when we write in plain English. Indenting a program is mandatory in some scripting languages, but as a best practice it should be followed for any program that we write in any programming language. Indentation improves the readability of a program because it helps the programmer or someone else reading the program to quickly understand the flow of the program.
Let's see an example where we have a nested condition in which we check if a Car is Red and if it is a Sedan and if it is Automatic. A bad way of writing this would be as follows:
if (Car is 'Red')if (Car is 'Sedan')if (Car is 'Automatic')do something
Now, think of adding multiple lines like this to a long program, and you will get easily confused ...
Read now
Unlock full access