Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror

Slashdot videos: Now with more Slashdot!

  • View

  • Discuss

  • Share

We've improved Slashdot's video section; now you can view our video interviews, product close-ups and site visits with all the usual Slashdot options to comment, share, etc. No more walled garden! It's a work in progress -- we hope you'll check it out (Learn more about the recent updates).

×

Comment: Re:Ockham's Razor tells me.... (Score 1) 963

by richardchaven (#24712905) Attached to: Why Corporates Hate Perl

Golly, I read Knuth, and Kernighan, and McConnell. Perhaps the introduction to Knuth will help you understand the difference between algorithms and implementation. Take a look at Steve Gibon's beautiful assembler code if you want a clear example of low-level code with high readability.

If clear code is "old-fashioned", then get my horse and carriage ready. Ad-hominem aside, yes, you CAN read that COBOL code even if you never used COBOL; is that a bad thing?

Good code is good code: COBOL, C, Algol, Basic, or Ruby.

I think Hungarian notation is worse than using the words "Button", "List", "Array", etc. because it is a shorthand, and we don't need to speak in shorthand. Understanding what the user wants and what our fellows mean and "What in hell were they thinking when they wrote this code?" is enough of a challenge.

You think that

void initcheckers(void) {
    int i,j;
    for (i=0;i7;i++) {
        for (j=0;j7;i++) {
            piece[i][j]='';
            color[i][j]=(i+j)%2;
        }
    }
}

is more readable than

void initializeCheckersBoard(void)
{
    int ColCounter, RowCounter;

    for (RowCounter = 0; RowCounter NUMBER_OF_ROWS; RowCounter++)
    {
        for (ColCounter = 0; ColCounter NUMBER_OF_COLS; ColCounter++)
        {
            SpotPieces[RowCounter][ColCounter] = '';
            SpotColors[RowCounter][ColCounter] = (RowCounter + ColCounter) % 2; // alternate colors
        }
    }
}

You can use the wrong word or poor spacing to make a bad example of any system; the bottom line is not impressed by knocking down straw-men.

BTW: Did you spot the bug I introduced in your version of the function? How easily would a new maintenance coder spot it?

Cheers

Genius is ten percent inspiration and fifty percent capital gains.

Working...