Advertisement

Questionable Design Habbits

Started by February 27, 2009 02:20 AM
16 comments, last by Lode 15 years, 8 months ago
So like everyone else on this site, I check in pretty much daily to read.. well.. the daily's at least (bright idea btw, my thoughts are that it is really keeping people at the site). Anyhow, after stumbling home from the bar tonite, I read the artical about the "sexual predator" comments, and that really really struck me as hilarious. The reason for this is, that I tend to "hard code" my placement text off the top of my head. Or even worse, occasionaly this creative problem finds its way into comments in my code! I was working with a client about a year or so back on a custom shopping system. system worked great, but one of the other workers made a fuss about one of my comments. I was working on a BHO layer (for database normalization), and in a particular function dealing with taxes, I placed "@blame George Bush", followed with expert commentary from yours truely about how taxes should be properly calculated in the perfect world. This of course was not a lone case. There are times where I would name scoped variables insanely silly or pointless names, just so that the code reads humerously. Its completely subconscious. for(int iq = 100; iq>0; iq--){...} Brainstorming design ideas and concepts is even worse. I will typically have about 10-15 open pages of notepad where I just randomly type what is on the top of my head, typically regarding the design, but if my mind wanders.. so does the writing. My gal came back from college, hopped on my PC, and mistakingly read one of my designs. She honestly thought my casual puzzle game design was a plea to assassinate various hippies and midgets. And sadly I could understand the confusion. So, is anyone else here as screwed up in the head as me?
/// <summary>/// Execute the update installer from the package. Note that the package/// must first be extracted before it can be executed. Failure to follow/// this defined order will result in points deducted followed by death./// </summary>/// <param name="args">Installer Executable Arguments</param>public void Execute(InstallerArguments args){    ...}


I only have "questionable" comments in my source code - I'm much too anal about naming conventions to do something like you in that for-loop.
Advertisement
We have giant "Ted heads" all over our code. Basically, several years ago someone took a picture of our producer Ted, turned it into a gigantic ASCII block, and pasted it as a comment into the top of some source files. Then the trend grew. To this day nobody knows exactly how many source files it's been copied into or where it even originated. I supposed if you went all the way back to changelist 1 you could track it, but it's much more fun to stumble upon one and copy it around some more :-P
Quote: Original post by PaulCesar
I was working with a client about a year or so back on a custom shopping system. system worked great, but one of the other workers made a fuss about one of my comments. I was working on a BHO layer (for database normalization), and in a particular function dealing with taxes, I placed "@blame George Bush", followed with expert commentary from yours truely about how taxes should be properly calculated in the perfect world. This of course was not a lone case. There are times where I would name scoped variables insanely silly or pointless names, just so that the code reads humerously. Its completely subconscious.

for(int iq = 100; iq>0; iq--){...}


The only time I do stuff like that is for debug code, usually print outs, that I know will get pulled out once the bug is fixed. I would never want to be caught with that kind of stuff in delivered source code. While some engineers might find it amusing, all it takes is one comment up the chain and you can damage your reputation and your companies reputation with the customer. It's just not worth it.
If a hobbit is half-hobo and half-rabbit, is a habbit more rabbit than hobo?


Answer the question, I must know. :|
I would get into serious shit if I did anything like that.

[Formerly "capn_midnight". See some of my projects. Find me on twitter tumblr G+ Github.]

Advertisement
I tend to swear a lot in my comments, especially in my TODOs
// TODO: why the fuck does this only work sometimes???

But I dont write any huge rants because I just dont have the time, plus I would never assume that anyone else cares.
I would try to cut back. If youve got some funny material, put it on a blog or somewhere else. Dont assume that anyone and everyone reading your code will appreciate your humour and insights.
I make jokes about the code and what I was thinking at the time to do what I did in comments. But I certainly wouldn't make political manifestos in my comments. All it takes is one code review and you might be looking for another job. There is a time to be silly and there is a time to be serious. And unless you are working for clowns you want to be serious at work.
When I get mad at code, all my test variables become swear words. But they eventually are deleted cuz they are tests.

NBA2K, Madden, Maneater, Killing Floor, Sims

I'll joke around wildly in person and to a lesser degree in emails, but my code never has anything like that. The risk of someone misinterpreting the comment is too great.

This topic is closed to new replies.

Advertisement