Follow Slashdot stories on Twitter


Forgot your password?
DEAL: For $25 - Add A Second Phone Number To Your Smartphone for life! Use promo code SLASHDOT25. Also, Slashdot's Facebook page has a chat bot now. Message it for stories and more. Check out the new SourceForge HTML5 Internet speed test! ×

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

He who steps on others to reach the top has good balance.