3 ms·
This is actually very good advice, and you can extend it to comments in source code. When I was young, I sometimes couldn't resist the urge to put strong wordi
by Luyt 15y ago
This is actually very good advice, and you can extend it to comments in source code.
When I was young, I sometimes couldn't resist the urge to put strong wording in comments, like:
// This sucks, use a better data structure for it!
Invariably, when I revisited the code months or years later, I thought by myself: Why swearing? You can also express disagreement in a more neutral way.
So, nowadays I use a better commenting style for bad code and tech debts, always with a motivation along it:
// TODO: This datastructure is probably inadquate
// here because of O(N^2) lookup
- DarkShikari 15y agoI think it's not just "strong wording", but the inarticulateness of the first example comment. You can express strong feelings while still being articulate. Example 1: //FIXME: This code is shit, someone make it better. Example 2: //FIXME: This code is a truly atrocious hack to work around $issue. I don't know of a better way, but suggestions welcome.
- astine 15y agoWhats the different between example two and this: //FIXME: This code is a shitty hack to work around $issue. I don't know of a better way, but suggestions welcome. This contains the same information but uses a swearword. I think that every would agree that clearer comments are better, but does the presence of obscenities inhibit clarity or are they merely offensive and superfluous?
- awj 15y ago> but does the presence of obscenities inhibit clarity That entirely depends on your work environment. Will adding in obscenities will rouse up some big HR kerfuffle? Then don't do it, you're just wasting everyone's time. Otherwise, do whatever you want.
- jacques_chester 15y agoOnce I left a comment in a source file of the following form. # This comment included for the benefit of those grepping for swear words: shit. I don't think I'd do it today, but I was young and it was for a place that had demotivational posters hanging in their lobby.
- bengl3rt 15y agoI once worked somewhere that had a poster on the wall: "Meetings - none of us is as dumb as all of us." I think it was a good reminder.