Well, I disagree. Test-drive your damn code. The difference in positive impact will be a few orders of magnitude.
Be a better damn developer. Tests don't deserve cut and paste hell any more than your actual production does.
31–40 of 68 posts
Well, I disagree. Test-drive your damn code. The difference in positive impact will be a few orders of magnitude.
Be a better damn developer. Tests don't deserve cut and paste hell any more than your actual production does.
"Every 3 to 7 lines of code you'll find some amount of editorializing. Maybe every few hundred lines you'll find a good joke too." I think there's the issue. In applications I write, every 3-7 lines of code is refactored into a method that is named exactly what it does, and every few hundred lines of code (usually much less) is in a separate file and class named on what he does. Broken out like that, there's not many…
http://theprofoundprogrammer.com/post/27214842818/text-thous...
There's usually a large amount of comments and metadata relating to code that isn't present in the source files themselves, but in an external database: git blame path/to/file.txt I think this is one of the most underused tools in software development! I wish more editors had features like "show me the history of this class/function" etc.
I'm against commenting code, with two exceptions: - You're implementing something complex (like an algorithm) - You're implementing something stupid (typically a workaround for something that could not be done in a more elegant way, and you want to explain why it can't be refactored) If the code is well written it is also self explanatory. This can be done by structuring / formatting the code well, into methods, clas…
Agree completely C# 11 years of experience
Earlier quoted context omitted.
Agree completely C# 11 years of experience
There's an huge requirement for comments in C# that isn't needed in java - that of describing what exceptions a method may throw. This is probably also the place where comments are ignored most of the time too - I literally cannot count the number of times I've seen programmers failing to catch obvious exceptions, even in the framework libraries.
Nope. You need to comment every nonobvious decision, but if you write code the right way then the nonobvious decisions disappear. A well-written method doesn't need explanation, because it obviously couldn't have been written any other way.
// NOTE: Workaround for a bug in the framework
// foo will crash if you foo before bar.
// Here we bar with a null value, which prevents the crash
bar(NULL);or like my teacher said use your common sense, make your code as clear as possible.. I should understand it without you ...