Coding practices

Nov 07, 2005 18:47

Chime in...I am interested on your thoughts...

Which coding method do you prefer? Put every little logical routine into a sub function (example a), or write code into the main (example b)


a -
static final int main()
{
functionA();
functionB();
functionC();
}
private void functionA()
{
//do stuff that is logical to A
}
private void functionB()
{
while(true)
{
//do stuff that is logical to B
}
}
private void functionC()
{
//do stuff that is logical to C
}

b -
final static int main()
{
//Do stuff that could be functionalized logically into a functionA
while(true)
{
//do stuff that could be in B
}
//Do stuff that just might fit in C
}

Sorry about the indenting...kind of hard to do without putting in a table in the HTML, but I don't feel like it.

coding

Previous post Next post
Up