|
Of course, I am not saying that you should never comment your code, and indeed I often do, but to have it on a list saying its a bad coding habit is odd. It seems to suggest that you should always comment your code, which of course is not the case.
To clarify one of my statements, I should have said, as far as possible code should be self describing, as rather than self commenting.
|
|
|
|
|
Steve Solomon wrote: Code should be self documenting. Absolutely!
And you shouldn't need written details about driving a car, flying an aeroplane, or using microsurgery machines, either!
Anyone who can't look at 40,000 lines of code and immediately understand absolutely everything that the program does and how all elements of the program affect each other should not even be allowed near an IDE!
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
Adding Table name + "ID" as identity column in database cases.
It is going to be more terrible when table name is too long.
Table Name: DocItemCostCenters
Identity Column Name : DocItemCostCentersID
|
|
|
|
|
What do you prefer to do instead? I hope it's not this:
Table Name: DocItemCostCenters
Identity Column Name : ID
... which I find even worse.
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, waging all things in the balance of reason?
Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful?
--Zachris Topelius
Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies.
-- Sarah Hoyt
|
|
|
|
|
Its the worst case in above all.
You can have all the tools in the world but if you don't genuinely believe in yourself, it's useless.
|
|
|
|
|
|
Although it is a good habit to do a lot of check, if you are using a managed languages like C#, a lot of those are often already done so it is much less critical...
In .NET exception are thrown for out-of-bound and using null pointers so « missing » checks are far less a problem that with native C++ for example where you can easily cause hard-to-find bug by writing something outside an array for example.
And even in language like C++, you can help yourself using debug libraries of STL, smart pointers, assertions, string class and thus avoid many bugs related to level coding.
Philippe Mori
|
|
|
|
|
|
It can't always be you. I hear quite a few people make that statement......
|
|
|
|
|
You forgot to include your e-mail address
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
Should have been an option.
|
|
|
|
|
It was, you just have to tick all the boxes!
|
|
|
|
|
No comments: should be "the default case" because code should be self-explaining.
I cant blame for "Writing code that assumes a default behaviour" because thats my style
How often do you "Copy & Paste" Code?
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
KarstenK wrote: code should be self-explaining.
I don't entirely agree with that.
No matter how simple person A makes code, Person B reading it may or may not find it that way.
If you want to avoid person B saying "Why did he do that?" or "Why did he do it this way?", put comments.
|
|
|
|
|
Yepp. You got to read my comment (and all source code) precisly
I hammered it out: "code should be self-explaining" - what does it mean
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
As per the title.
The 'No Comments' one only applies to code that is not obvious on first glance. Code that is obvious, like i++ , doesn't need a comment.
What do you get when you cross a joke with a rhetorical question?
|
|
|
|
|
I hate code which needs explations
bad
if(i >10) return -1;
without comment you are left in the dark
good
if(counter > MAX_ORDERS) return false;
all clear, lets do other stuff.
Press F1 for help or google it.
Greetings from Germany
|
|
|
|