Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

"Biggest" is hard to quantify, but "most common" for sure is the combination of repeatedly executing the same expression (versus assigning it to a variable and using that reference multiple times) which often goes along with my red-alert "what is wrong with you?" of using one thing and logging another

    doAwesome(thing.otherThing().somethingElse());
    LOGGER.info("I used {}", thing.otherThing().somethingElse());

    // or its friend, this horseshit

    if (thing.otherThing().somethingElse() != null) {
       doSomething(thing.otherThing().somethingElse());
    } else {
       LOGGER.warn("somethingElse was null "+thing.otherThing());
    }
(we will ignore the Law of Demeter for the purposes of this rant, since in my professional experience that ship has sailed)


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: