A few days ago I was discussing how indents code ANSI / C and so if you can use the same style in different languages.
Obviously, the indentation is like the mother, each has its advantages and sings and knows his mother will not be shaken!
Today, looking for information on wikipedia I come across this page: Indent Style discusses where the most common techniques for indentation, here's a little summary:
* K & R style
//... x < 0 ) { if (x <0) ( "Negative" ) ; printf ("Negative"); ; negative (x); { Else () "Positive" ) ; printf ("Positive"); ; positive (x); )
* Allman style (bsd in Emacs)
x == y ) while (x == y) ( something (); somethingelse (); ) finalthing ();
* BSD KNF style
x == y ) { while (x == y) ( something (); somethingelse (); ) finalthing ();
* Whitesmiths style
x == y ) while (x == y) ( something (); somethingelse (); ) finalthing ();
* GNU style
x == y ) while (x == y) ( something (); somethingelse (); ) finalthing ();
* Horstmann style
x == y ) while (x == y) ; (Something (); somethingelse (); //... x < 0 ) if (x <0) ( "Negative" ) ; (Printf ("Negative"); ; negative (x); ) else ( "Positive" ) ; (Printf ("Positive"); ; positive (x); ) ) finalthing ();
* Pico style
stuff (n): (X: 3 * n; y: doStuff (x); y + x)
* Banner Style
function1 () ( dostuff do more stuff ) function2 () ( etc. )
And what you used?
Posted under Technology
This post WAS written by admin on November 4, 2008






But with the lack of languages like python or forced indentation ... Cobol.
Configuration:
Tab into spaces (hate the character \ t)
Indentation for 2 characters
Styles:
GNU Style for all code
Pico Style for short methods of boilerplate code (type setter / getter and the like)
GNU Style lifetime, partly because I started with Pascal
BSD style for if / while and like! Instead the body functions Allman style.
This however is it called? Is missing
if (condition) (
something ();
Else ()
something_else ();
)
Sometimes I use it.
Oops sorry, I had missed the first in list
Correct as well the first comment!
Are elderly, and K & R.
While the code tends to be moved too far right ...
if (condition)
(
....
....
....
Else ()
....
....
....
)
K & R style