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

But a wholly non-funny "Invariant Violated" message would be no better. The problem isn't that the message is funny, but that it does not contain the information you need to understand what's going on. The whimsy is just a distraction.


Do you find that distracting things help you debug shoddy code?


They don't hurt, and it's fun to come across them. If the funny thing is used in one place, it can be memorable and easier to search for. If it's the equivalent of "error [error]" or whatever, I honestly don't care.


if "divide by cucumber" is a unique string in the code base, then yes?


Right. And how many of those can your brain fit?


Doesn’t matter. The important thing is that I can look them up or resolve them easily. Without looking it up can you tell me the difference between HTTP 451 and 510? If not they’re no more useful than I’m a teapot. But I can identify both of those uniquely and figure out where they’re coming from.


This is a great example where humor can help: I love http.cat because the whimsy makes it easier to look up and remember status codes. Not exactly the same as jokes in code, but an example of how more humor can be better than less humor for practical, human-factors reasons.

https://http.cat/451 and https://http.cat/510 for reference

451 is a bit of a niche joke (took me a bit to realize it was Ray Bradbury), but 510 is definitely going to help me remember "not extended" :P


You can remember some of those by heart. Everybody knows what 404 means nowadays.

451 is also a bit whimsical btw – and that actually helps remember what it stands for (Unavailable For Legal Reasons).




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

Search: