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


Forgot your password?
Check out the new SourceForge HTML5 internet speed test! No Flash necessary and runs on all devices. ×

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

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++) {

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?


Slashdot Top Deals

Coding is easy; All you do is sit staring at a terminal until the drops of blood form on your forehead.