Timeline for Self-documenting Code vs Commented Code
Current License: CC BY-SA 2.5
5 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jan 8, 2015 at 13:21 | comment | added | T.J. Crowder | @PeterAllenWebb: No point to that comment at all. That doesn't remotely mean the function shouldn't be commented; it should. Does "extension" include the dot or not? What is the return value for "foo"? (null? ""?) For "foo."? Will passing in null cause an exception, or will the function return something (perhaps null)? | |
| Feb 25, 2011 at 1:56 | comment | added | PeterAllenWebb | +1 This is a know-your-audience question. Who is likely to use this function? How can you help them? What will your help be worth? Is it worth more than spending a bit of time now to add a comment? Etc. Etc. Etc. | |
| Feb 24, 2011 at 21:15 | history | made wiki | Post Made Community Wiki | ||
| Feb 24, 2011 at 13:22 | comment | added | Phill | Can you give an example. I mean given the example in my original question. "GetFileExtension" whats the point in the comment "Gets the file extension of a given file"? The method has already described what should go into the comment. If the method was named "GetExtension" then a comment would aid in clarifying what the method is to do, since the method is not explaining itself. | |
| Feb 24, 2011 at 12:59 | history | answered | user6791 | CC BY-SA 2.5 |