3 ms·
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
by taneq 5y 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
}
- ThePadawan 5y agoThat 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).
- taneq 5y agoHaha nice, if ever there was a design decision worthy of the title "glorious bastard", this is it.