4 ms·
This is a great idea. Too bad code can't really be isolated this way. I feel that marking a hack is one of the few legitimate uses for comments in code: //TOD
by bjhoops1 13y ago
This is a great idea. Too bad code can't really be isolated this way. I feel that marking a hack is one of the few legitimate uses for comments in code:
//TODO HACK HACK HACKITY HACK
- artursapek 13y agofew legitimate uses for comments in code You mean comments in CSS specifically?
- fredoliveira 13y agoI feel that marking a hack is one of the few legitimate uses for comments in code I'll take that as an offhand comment you didn't give much thought to, because wow, there most certainly are lots of legitimate uses for comments in code.
- bjhoops1 13y agoI'm pretty firmly in the "code as documentation" camp, what can I say? I think that most of the time, if you can describe an action with two or three words, you probably ought to be extracting that logic into a method by the same name. IMHO comments are best used in a handful of situations, such as: 1) Marking hacks 2) Explaining unusual, non-obvious sections of code 3) Noting historical reasons for doing something in a non-obvious manner 4) Noting pitfalls to be avoided 5) Making passive aggressive remarks about the "business guy" who made you do something terrible Not an exhaustive list of course, but I do think that it's best to think twice before writing a comment, asking yourself "how can I make this more obvious with my code?"