|
Years ago, a bright young programmer placed a comment in what he thought was code that would never execute. It did. In the field during a trial with a potential sale of hundreds of units. If not for the sense of humor with the client's field engineer at the time, I think we'd all have been fired.
The comment was something to the effect of requiring the sacrifice of a black goat on the keyboard during a full moon. Placed by a person who had since left the company ... and we did not even know about it. Shame on us. Very tense scenario in the room when that message popped up. We were called in for a chewing out at the next available meeting. The sale did go thru, btw.
A commment like that can cause a lot of heartache, even jobs, you name it. With the current jobs atmosphere these days, it's best to keep our frustrations to ourselves. I know of some employers who monitor comments on blogs even when you are not at work. It'd be a pain to work for such folks but they do exist.
|
|
|
|
|
I used to work for just such folks; for example, on my personal facebook page (which is locked down to all non-friends), a co-worker commented on my status last night that team member A was busy that night with a lot of support calls, etc., to which I commented "yeah, she's a worker" or something to that effect. The next morning, I was called in for an "unofficial" warning about discussing work matters on facebook. Treacherous #$$##$#s.
|
|
|
|
|
Time was, I'd have chuckled at such comments and passed on with a grin. But fairly recently, I came across an example of the practice that jerked me out of my complacency.
Two of my engineers -- call them John and Steve -- had gotten into a severe disagreement about how to handle a particular aspect of the communications interface between their programs. As group leader, I had to mediate, and it was in the nature of the dispute that one or the other of them had to "lose." As John had already written a solution to the problem for his side that embodied his preference, I wheedled Steve into accepting the fait accompli and implementing a conforming solution in his program. He accepted my decision, but to say the least, he wasn't happy about it.
(What is it with software and ego? After forty years in this trade, I still don't get it.)
Well, shortly thereafter, Steve left my group. In the sweet rushing fulless of time it became necessary to make changes to his program. As all my people were up to their eyelashes with work, I took the responsibility onto my own shoulders, and resolved to learn Steve's rather complex program as thoroughly as possible.
When I came to the two segments of Steve's code where he'd implemented John's preferred solution to their mutual problem, I was stunned by the comments in the code. Mind you, Steve isn't a happy commenter; indeed, his stuff tends not to be commented at all. But my oh my, did he ever comment those two segments.
The thrust of those comments was highly uncomplimentary to John. Offensive in several dimensions. And they went on and on and ON...
And so, I've become an enforcer of "structured English" commentary. Among its other virtues, it's entirely free of:
- adjectives,
- adverbs,
- similes,
- metaphors,
- idioms,
- imagery,
- Anglo-Saxon monosyllables for body parts, excrement, and the procreative act,
- and references to the marital state of other engineers' parents.
My engineers think I'm an obsessive. So be it.
(This message is programming you in ways you cannot detect. Be afraid.)
|
|
|
|
|
Sounds familiar and I'm happy that Steve left this slough.
First of all, in project there is no "looser" side and cannot be at all. Only strictly technical decisions.
Judging on that: "As John had already written a solution to the problem..." I say: YOU is a problem since you based your decision not on a tech facts, but just "it's already done by John". Stupid as an arse.
But you HAD a chance to clean your f** up: when you saw Steve is not happy, what you did? Did you ask him why? Did you get tech. reasons? Did you compare his vision with John's? Sure not - you just said "accept this sh** and make same fetid copy". TWICE you're stupid as a manager and a technician.
People "is not happy" not because NIH, but because they have technical knowledge what is good/bad. You ignored this knowledge and... viola - you LOST technicaly wisdom person. Because if he was just stupid newbie, he'll never left the team. Congrats.
|
|
|
|
|
Gee, you're so quick to impugn my competence on the basis of a brief summary of a large, complex problem! Look at all those assumptions about what I did and didn't do! And you lambasted me in such magnificent grammar, at that. Did you write that in English, or did you use a freeware Gibberish-to-English translation program?
You're obviously destined for great things. Just keep on as you've begun, and no one will be in any doubt about your percipience, intelligence, or people skills. Of course, that might result in your freezing to death in a cardboard box, but we all face choices in life. Who knows? Maybe your design and coding skills are great enough that mannerly folks will accept your little ways. You might want to start thinking about that.
(This message is programming you in ways you cannot detect. Be afraid.)
|
|
|
|
|
It's usual behaviour of guys without arguments: "gee, your grammar is bad!", but I forgive you. I count on the info you gave. Or info you accurately selected for the story. Anyway it's enough to conclude: under GOOD management there is no SUCH comments like Steve's. Do you agree? Or may be you'll invait that "Steve" and he will explain your "large, complex problem"? (which is solved by "two segments of Steve's code" - haha)
Obvious that I'm not an English native speaker, was it TOO hard to realise it?? Your chineese is a way worse than my English, so what?
|
|
|
|
|
Your reading comprehension is as poor as your power of reasoning. My argument is principally with your assumptions about what did and did not occur, all of which are wrong. Your arrogance is typical of a young engineer who has never had supervisory responsibilities. After all, everyone knows how to do the boss's job better than the boss does!
Inasmuch as I am considered one of the best front-line supervisors in my rather large company -- engineers constantly plead to be allowed into my group -- I forgive you for your presumptuousness and immaturity, though I do hope you'll grow out of them.
Finally, I don't speak nor write Chinese, but if I found it desirable to do so, I'd learn it thoroughly enough to do it properly. It's a matter of respect...but it seems that your deficiency in that regard extends to butchering other people's languages while delivering unsubstantiated insults to their competence.
Have a nice life. You'll understand that, I trust? The words are nice and short.
(This message is programming you in ways you cannot detect. Be afraid.)
|
|
|
|
|
Thornik wrote: Anyway it's enough to conclude: under GOOD management there is no SUCH comments
like Steve's
Wrong.
Good developers tend to also have strong opinions. There is no such thing as black and white facts and there certainly is almost never time and absolutely never enough money to figure out the best solution. So opinions matter.
But that doesn't mean that they are not opinions. Nor does it mean that a single opinion is in fact best.
But businesses can't wait for the best to be proven. They need a solution now or even yesterday and so either someone must acceed or a manager must step in at times.
And your comment completely ignores the fact that, as with all human endevours, humans are, by definition, average. That means developers and managers are almost always average. Thus managers are not excellent but neither are the developers that they manage. And that fact isn't helped by the emotional state of developers of which a large percentage think they are above average. And thus who consider that their opinion should be given more weight.
|
|
|
|
|
Completely agree: even program itself is written NOT FOR CPU, but for us, humans! And as in verbal conversation, you express yourself according to your emotions. Why comment is an exception? If I hate MS for idiotic "if (myWindow.ShowDialog() == true)" why I cannot say it? (if you didn't catch the point, ShowDialog() now returns.... absolutely stupid "bool?" type!!)
With emotions, jokes, etc we say our followers "hey, it's not only 0/1, it's our thoughts, dude!".
|
|
|
|
|
Thornik wrote: If I hate MS for idiotic "if (myWindow.ShowDialog() == true)"
This has bothered me since I began professional development 2 years ago; it honestly took me quite (an embarrassingly) long time to figure out that a Show...() method actually had a boolean return value. It made no sense to me then, it makes no sense to me now, and even though I've accepted it, it'll likely not make sense to me in the future. Why not name it ConfirmDialogBox or something like that? That signifies it's looking for some sort of confirmation, thus returning a boolean value.
|
|
|
|
|
That's good idea - at least NAME it different way if it has different behaviour! But better of course to return "bool", not "bool?".
|
|
|
|
|
I find that in .NET Windows Forms controls there are a lot of things that you need to do in a particular order to make events trigger the way you want, and some are not so clear as to why.
There have been a number of times when the solution I found online is "this is how I did it but I don't know why". For a handful of these solutions, the consensus is that it's either a bug in the .NET Framework, Visual Studio, or at least a poor inconsistency in Microsoft's design or implementation. These are the ones I comment with things like: "This is the ghetto way to get around Microsoft's broken development environment."
This way I know that if I try to play with it in the future, it may not be something I'm doing wrong and it just makes no sense but "you do it this way."
|
|
|
|
|
Wow. Sounds like a bunch of old guys writing their opinion[s]. I'm only 55 and been doing this for a long time. Write what you want. Comments should, yes, be informational first and foremost. But throwing in a bit of humor never hurt anyone. Indeed, I throw humor in because someday, sometime someone will chuckle. I've had people thank me for a bit of humor years down the road, long after I'd forgotten the comment. It's fun, Man! And as for "swear words" ... all I can say is it sure seems that a lot of people are pretty uptight about "bad" language. In the words of the late, great George Carlin "it's only words".
|
|
|
|
|
I like to write code with humor in it. I also look forward to hearing a chuckle when somebody comes across a gem I wrote. It makes my co-workers more likely to want to review the code/do a bug fix/or participate in development. Our unwritten rule was there was nothing crude/foul language should somebody unintended read the comment.
Getting in the practice of writing comments in the code makes the code easier to understand when people see the code for the first time. I remember that about 1/3 of every program I wrote was comments and white space.
The result of our comments made a more plesant workplace. I do want to point out that most of the comments in the system were related to the code, but we can't be serious all of the time!
Hogan
|
|
|
|
|
I personally agree with this 100% but wanted some additional viewpoints (and some of the counterpoints were actually well-reasoned and insightful); fortunately, our dev shop is just the principal and me (I'm the only employee to date), and he's of a like mind, so there's no short-term objection or anything like that.
Based on all feedback, I think I can agree that swear words should be kept to a minimum, and definitely nothing insulting, derogatory, offensive, sexist, etc., but there's no reason humor can't be injected into comments as long as a.) it does not interfere with the message (hopefully enhances it) and b.) it fits the effective culture of the office.
|
|
|
|
|
It all depends. It all depends on who will ever read the code. Sometimes we can't predict where the code will land and sometimes we know the code will land on the hands of very important customers. Sometimes I believe we should refrain ourselves from our humor urges for the sake of our professionalism, even though we may think it doesn't hurt anyone.
It's like going to a job interview with slippers and shorts. We know it does not change our skills or capabilities but it may cost the job opportunity. I've witnessed very skilled people failing to be hired because they didn't pay attention to "look professional".
To alcohol! The cause of, and solution to, all of life's problems - Homer Simpson
----
Our heads are round so our thoughts can change direction - Francis Picabia
|
|
|
|
|
Fabio Franco wrote: It's like going to a job interview with slippers and shorts. We know it does not
change our skills or capabilities but it may cost the job opportunity. I've
witnessed very skilled people failing to be hired because they didn't pay
attention to "look professional".
Thats a good analogy. You can't know what the people on the other side of the table are like until long after it matters.
|
|
|
|
|
Gary Huck wrote: But throwing in a bit of humor never hurt anyone.
Jokes can be consideration in EOC complaints. So someone can end up getting hurt.
And just because you think it is funny doesn't mean that everyone or even anyone else will consider it funny.
Gary Huck wrote: And as for "swear words" ... all I can say is it sure seems that a lot of people
are pretty uptight about "bad" language.
I doubt most offensive comments containing nothing but swear words. The swear words are used to provide an emphasize for some opinion expressed in the comment.
|
|
|
|
|
Personally, I think these people are all way too uptight, and a little humor in comments is fine. All this "unprofessional" and "it distracts...".... Get over yourselves... Just my opinion, of course
-MJC
Michael J. Collins
Web Application Programmer
|
|
|
|
|
Consider that the code you're writing will be delivered to the client after it has been completed to be maintained by their own IT staff.
Imagine how colorful comments may affect the image of the company you work for.
Better yet, imagine you inherit a project written by someone else that besides having some crappy code, also has these type of comments. How would you feel about the original developer?
It's no shame to have some bad code, but it would transmit a very professional image if you acknowledge it and point out it should be improved. It can tell other developers that you, the original writer, are a professional and mature developer instead of looking like a child that does not take work seriously.
To alcohol! The cause of, and solution to, all of life's problems - Homer Simpson
----
Our heads are round so our thoughts can change direction - Francis Picabia
|
|
|
|
|
In our case, we develop an in-house application that we sell to financial institutions, so there's no code delivery to clients, though I 110% agree with you that any delivered code should be devoid of inappropriate comments.
I'm definitely in the camp to not include comments unless they are necessary, particularly to explain complex logic or to explain some weird workaround that had to be implemented. Both of these cases are ripe for hacks and kludges, IMO. So, yes, admitting the problem is the first step, so to speak, but I also think it's good to have a bit of sense of humor about it.
|
|
|
|
|
IndifferentDisdain wrote: In our case, we develop an in-house application that we sell to financial institutions
I do exactly the same, except that the code stays in the financial institution. So I'd never add humor to the code I write because financial institutions tend to take stuff very seriously.
If you are absolutely sure the code will never be requested by the client, then by all means, add some fun to the mess , otherwise, I'd just not risk it. I say that because I know financial institutions require a lot of audits, including source code review for security purposes.
Imagine having to review a huge code base, just to eliminate comments that may transmit a bad image of the company
To alcohol! The cause of, and solution to, all of life's problems - Homer Simpson
----
Our heads are round so our thoughts can change direction - Francis Picabia
|
|
|
|
|
I don't know about Inappropriately-Appropriate Code Comments, but I recently took over a project and was pouring through the code and found:
ReDim Preserve F__kMe as BS
The underscores weren't used, but you get the idea. Quite a lot of this type of variable naming.
|
|
|
|
|
Show off some of your creativity, cuss it out without actually using any cuss words
Cuss words sometimes offend coworkers, both current and future, and why would you want to do that? Besides, you never know when some suit will decide to have a peeksie at the code and be offended by the language in the comments.
We can program with only 1's, but if all you've got are zeros, you've got nothing.
|
|
|
|
|
What's funny to you, may not be funny to someone else, having said that, i usually don't write colorful comments (or comments at all for that matter ), but i wouldn't write anything beyond PG, just to be on the safe side.
|
|
|
|
|