Hacker News new | ask | show | jobs
by mrspeaker 3730 days ago
Never ever EVER put bad language in any unexpected error cases or logs - even as you're developing it... it WILL somehow magically make its way to production, and it WILL appear!
2 comments

Not only will it manifest itself in production, it will do so at the time and with the user most likely to cause great embarrassment.

[NB There is a related phenomena to do with a demo of a system that includes "adult content" (i.e. porn) - the likelihood of a user randomly stumbling upon this content is practically 100%, even if this content is a tiny part of the overall demo].

I remind myself frequently not to swear in code as I am quite juvenile on a normal day. If I'm struggling I'll just make up a word, so that if it ever happens that someone else sees it I can say it is an acronym but that I have conveniently forgotten for what.
I had a hearthy chuckle when learning about Android's Log class: the highest level of importance for a message is WTF. Documented as What a Terrible Failure.
You could always put a "this should never happen" right before the swear words so they know it wasn't your fault.
But there's a risk I'll become stuck in an infinite loop of writing shit! this should never happen shit! this should never happen shit! ...

and so on. Still it would be a change from writing bad code.

Wow, deja-vu, this is just what happened to me one time when I was working on a new booking system for a hotel.

I was working on site over the winter season when the hotel was closed down, a lovely old hotel high up in the Rockies. Every day I sat down and wanted to write some brilliant code but all I ever ended up writing was the same comment

All objects and no functions makes Jack a dull boy. over and over again.

Drove me quite mad actually.

Sometimes I feel like I'm still there.