Other Software > Developer's Corner
indent wars..
jgpaiva:
I end up relying on my text's matching bracket highlighter. If it matches with the wrong bracket or none at all, I missed something ;)
-allen (February 10, 2006, 05:54 PM)
--- End quote ---
Exactly my point! :Thmbsup: :Thmbsup:
Rover:
Everyone read _Code Complete_ by MS Press? It discusses indent techniques plus standards for loops and if/then structures. I read it in the early 90's, and it's still around.
allen:
Reading related information . . . now there's a thought :D
mouser:
code complete 2 is out now (updated version of first book) - i highly recommend it for all programmers.
http://www.amazon.com/gp/product/0735619670
f0dder:
A sample of my code style...
--- ---extern std::string GetUserName();
const unsigned IterationCount = 1024;
void MyFunction()
{
unsigned myVariable = 42;
// 4-space tab - space indentation is evil.
// Multi-statement loops and if sentences use blocks
for(unsigned i=0; i<IterationCount; i++)
{
TweakSystem(i*2);
PrintOut(i);
}
// Single-statement loop and if sentences don't use blocks
if(GetUserName() == "f0dder")
GiveRootPrivileges();
}
Also, for classes, I never define functions inline in the class block - for member functions that are supposed to be inline, I do define them in the header, but below the class.
Navigation
[0] Message Index
[*] Previous page
Go to full version