Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Stuff that annoys you...

Name: Anonymous 2010-09-03 12:45

when reading code not written by yourself. For example, I cannot stand it when  people use

if (condition)
    ...
else if (condition)
    ...
else if (condition)
    ...
else if (condition)
    ...
else


instead of the much more readable


if (condition)
    ...
else
    if (condition)
        ...
    else
        if (condition)
            ...
        else
            if (condition)
                ...
            else

Name: Anonymous 2010-09-03 18:37

>>20
Only if you want to be able to optimize the switch using a hashtable of a binary tree of conditionals. Good languages don't require it, and instead have the compiler check if all the cases are constant, and if they are, apply whatever optimizations are possible, if they're not, just convert them into the usual if/else forms (or whatever it prefers internally).

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List