News for hackers. Stuff that matters.
Re:What Makes Code Hard to Read: Visual Patterns of Complexi... by zoogeny on Tuesday March 11, 2025 @05:21PM (#43337122)
90% of the time I prefer the first. I am allergic to indentation and I hate anything remotely like:

    function foo(a) {
        if (a) {
            return doThing()
        } else {
            return Error();
        }
    }
I like all of my assertion and predicate guards nicely at the top of a function:

    function foo(a) {
        if (!a) {
            return Error()
        } 

        return doThing()
    }
And for that reason, I would probably go for getOddness4 even though I see your point.
Re:What Makes Code Hard to Read: Visual Patterns of Complexi... by stared on Tuesday March 11, 2025 @08:07PM (#43338541)
In case of handling exceptions (and similar stuff), I also prefer avoiding unnecessary nesting.

For two (or more) equally valid, I prefer keeping same nesting.