News for hackers. Stuff that matters.
Re:Avoid Else, Return Early (2013) by collyw on Tuesday March 27, 2018 @04:26AM (#16686420)
This can be horrible in JavaScript. It can make code really ugly. I have had to deal with code that looks like this recently:

    if (condition){
        doSomething()
        doSomethingElse()
    }
    else
       doSomethingDifferent()
    doSomethingConfusing()  // is this part of the else or not??

Perl got many things right. Its a shame it seems to have fallen away as a language.

There are no comments on this comment yet.