7 ms·
> I like a bit of humour in my code, and I wanted to name it GodComponent. No. Just no. Do not ever be funny in code. No one else likes your humor, and it's di
by caymanjim 7y ago
> I like a bit of humour in my code, and I wanted to name it GodComponent.
No. Just no. Do not ever be funny in code. No one else likes your humor, and it's distracting. (Ignoring the other reasons "GodComponent" is a bad name.)
- cwbrandsma 7y agoI needed to wrap the code that handled thread management that I use in Swift. I called the component Threader, and in the comments I mention I named it after the TMNT character Shredder. Two things came from that: I have gotten a chuckle from all the developers I introduced to that code, and no one has forgotten about it. Some humor is useful.
- xmprt 7y agoThat's nice when the team is small and everyone knows what the code does, but when new members start joining and you have all these inside jokes/references all over the code, it becomes more cumbersome than anything to explain what it is. I enjoy humor but keep it to a minimum and hopefully don't impact the actual readability.
- mattkrause 7y agoThe trick here (and in someone else’s “Thrilla in Mozilla”) is that you don’t need to understand the humor or reference to understand the code. It’s just a nice little bonus, since threader is already a perfectly reasonable[0] name. This is different from insisting that helper functions in brains.c be of type pinkyfunc_t. [0] I was tempted to undercut my own point and write cromulent there instead.
- philwelch 7y agoI think it's okay to be funny in test cases. For instance, my test data has included the user-agent string, "The Thrilla In Mozilla".
- jchook 7y agoAs long as you don't go into potentially offensive humor
- lonelappde 7y agoUpthread we have someone boasting about naming their business machines after porn stars.
- jchook 7y agoI had to learn the hard way
- Moru 7y agoI worked with home support for an ISP. A few times I was at a customer helping with a router and the mother call her son to get the password for the router. Not always a nice password...
- philwelch 7y agoI very much believe in offensive passwords/passphrases (maybe not for wireless routers) specifically because: (a) You're not supposed to tell anybody what they are. (b) Offensive passphrases are easier to remember.
- askafriend 7y agoMeh, I don't value that opinion at all. Especially a hard-line stance of "DO NOT EVER". I'm going to continue injecting some light humor into my code and it'll be fine (especially unit test code).
- gumoro 7y agoYes! Unit test code! I avoid humor in main code, but in unit test code when you have to come up with dummy bits of test data or variable names, I love getting funky there :)
- PopeDotNinja 7y agoI enjoy seeing a bit like of humor in the code, especially silly-but-clear comments and names less important parts of code. For a one shot task, why name it ScheduledObjectStorageDownloader when you can name it AutoCloudStorageFileYoinker?!
- richardxia 7y agoWhile I'm not 100% against humor in a codebase, ever since my company started hiring more engineers internationally, I've become more tuned in to whether a name that uses slang like "yoinker" will be understood by someone who doesn't know English as a first language.
- PopeDotNinja 7y agoThat is a fair point.
- sundvor 7y agoI've been using English as my first language for nearly 20 years and am unfamiliar with "yoinker". Just googled it and, ... nah, I wouldn't approve that PR! (Have never heard it used down here in Australia. We've got plenty of other sayings that are local to us though.)
- PopeDotNinja 7y agoHehe, I never googled yoinker until just now. I originally heard it on The Simpsons. Here's a SFW Simpsons supercut of "yoink": https://youtu.be/CJh1hmmLLzw https://youtu.be/CJh1hmmLLzw I suspect there are a lot of words that used to be safe that are less so now :P
- OJFord 7y agoBecause someone might grep for 'schedule' or 'download' but, quite reasonably, not think of 'autocloud' or 'yoink'?
- WatchDog 7y agoI for one appreciate good humour in a codebase.
- lonelappde 7y agoAh, but do you appreciate bad humour?
- WatchDog 7y agoNo not really, but I also don't appreciate bad code, and I encounter a vast amount more bad code than I do bad humour in the course of my work.
- jpz 7y ago100% with you on this. I find the replies to your comment here remarkable. Namings should be descriptive not idiosyncratic. It might be just like the guy I spoke to last month that said he just makes everything public when writing Java. Some people can have opinions that differ from best practice, it doesn't justify them, however. Express your personality when you speak to people face to face, tell a joke, make witty observations at lunch, or in a code review meeting, don't express your personality in manifest idiosyncracies in your comments and code.
- paxys 7y agoYeah, seriously. People use the "it was just a joke" argument for so many stupid things. Realize that there are people here whose sense of humor is very different from yours and this inside joke is likely going to cause confusion or conflict.
- newshorts 7y agoI agree on the aspect of professionalism. I wouldn’t go so far as to say never. Maybe there is some situation out there where it’s appropriate and understandable. I’ve just never seen it ;)
- nojvek 7y agoI mean you can be plenty funny. Just not in naming things. My elaborate rants as comments on some parts of system have a bit of humor or sarcasm in them. I guess it’s a team thing. Our codebase has been built over time and has a number of hilarious comments.
- pradiptasarma 7y agoExactly, the following is fine: try { ... } catch (Exception up) { ... throw up; //hehe } The GodComponent as a name is not.
- mawburn 7y agoI used to name projects of funny names, but then I started realizing that I had no idea what other people's cute names were for their projects. We have one in our company named right now named Harbinger, neat name... but wtf is it? Boring names are boring, but they tell other people, and future you, what they are or do.