News for hackers. Stuff that matters.
Re:Everyone can write bad code by fhood on Thursday February 08, 2018 @01:46PM (#16334485)
> “If you need new functionality but do not want to break the old just add another field and an of statement to enter a new code path.”

Oof.

    def a(b, c, d, e=None):
        if e:
is way more common in my code than it should be.
Re:Everyone can write bad code by bastijn on Thursday February 08, 2018 @01:57PM (#16334568)
Exactly. It’s a competition to beat the previous editor’s cyclomatic complexity score! In fact, I should have said:

“If you refactor a method without increasing its cyclomatic complexity don’t bother sending for review.”

Re:Everyone can write bad code by AstralStorm on Thursday February 08, 2018 @02:18PM (#16334729)
Uh? Every code should be reviewed. Decreasing complexity can cause inadvertent bugs, including ones not caught by regression tests.

Unless this was cheeky sarcasm in which case you shouldn't replace the previous point just add this one.

Re:Everyone can write bad code by bastijn on Friday February 09, 2018 @01:18AM (#16338301)
I think all the points in this thread are (cheeky) sarcasm :).