Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
User Journal

Journal Journal: Who knew?

So, who knew that I had a blog/journal on slashdot... I certainly didn't. So now that I have discovered my journal, I figured I should put something in it, even if all I put in is a link to my actual blog.

Comment LOC is for idiots (Score 1) 584

I agree, measuring LOC is foolish, it promotes the practice of writing poor code or bloatware.

LOC is a metric that is meaningless, the only folks that use it are the idiots in management that don't understand SFA about code.

Which is better code?

main( int argc, char **argv )
{
int i, x;

 for( i = 0 ; i   x = ( 80 - strlen( argv[i] ) ) / 2;
  printf( "%*.*s%s\n", x, x, "", argv[i] );
 }
}

...or

main(
int argc,
char **argv[]
)

{
int i;
int x;
int n;

 for(
  i = 0 ;
  i   i = i + 1
 )
 {
  x = strlen( argv[i] );
  x = 80 - x;
  x = x / 2;
  for(
   n = 0 ;
   n &nt; x ;
   n = n + 1
  )
  {
   printf( " " );
  }
  printf( "%s", argv[i] );
 }
}

More lines of code does not make better code. I can crank out a more lines of code just by screwing with whitespace and the formatting as I did in the above example.

Slashdot Top Deals

In case of atomic attack, all work rules will be temporarily suspended.

Working...