All reputed Engineering colleges use open source operating systems like Ubuntu.
As far as text editors are concerned Vim or Vi editor is the best.I also recommend you to use Vim editor not only for coding but also for any text editing.
New coders don't know much about code indentation so they type their code like this-
which is not at all recommended but it is fine with Toy programs.
Its Good to have good programming habits that we can keep throughout entire career.
Indentation not only make your code or program look good but it makes you to understand it in a much easier way as you can see loops in side loops as it happens at the time of execution and also much more things
this is the code which is intended by a single vim command
Command is gg=G
Just hit Esc once don't press : (colon) and type the command
As u can observe u cant see the command you are typing but its this is the Right way to do it
Hope it will help you..
Here are some Indentation and formating rules :
* Use one single "TAB" (and not 3-4 spaces) for indentation.
*Indentation means, whatever is
logically 'inside' should be shown like that. This means the 'bodies' of
for, while, if, else, function, switch should be indented using ONE
tab.
* Indent when you are typing the code and not after writing the code.
* Rules for spacing:
Give one space after comma in variable lists or arguments lists. e.g int i, j, k; OR printf("%d%d", a, b);
Give one space before and after every binary operator: e.g. i = j + k;
*Everything which has a { and } associated with it is called a block.
The opening and closing brackets
of any "block" must be matched with the first character of the block
keyword (i.e. f of for, i o f if, e of else, etc. )
* Do not give a space before ";" of a for loop
* Do not give a space after '(' and ')'