Hacker News new | ask | show | jobs
by taneq 1770 days ago
Or just ran with the joke. Likewise I'm sure somewhere out there is a codebase containing

    int random() {
        return 4; // randomly chosen by roll of a fair dice
    }
1 comments

That would make a somewhat interesting testing strategy.

In a similar vein, React intentionally calls user-implemented functions which are meant to be pure twice in a row (even though that's technically unnecessary), just to ensure the programmer actually makes the function pure (so the application behaves reproducably in the future).

Haha nice, if ever there was a design decision worthy of the title "glorious bastard", this is it.