|
...since I program as a hobby, but also to anyone wanting to use or contribute to my projects (so they know what the heck I was thinking when I wrote something).
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
I will use comments but try to make sure the names I use comment the purpose. I have a real gripe with the development environments. Years ago Microsoft added xml comments, but never really took it to the place they need to be. It should be possible to use standard names within functions and arguments and there should be a tool for class, method and argument documentation.
|
|
|
|
|
Obviously, compiler would be happy with you
Cheers
KR
|
|
|
|
|
To Whom It may Concern
Peter Leow
https://www.amazon.com/author/peterleow
|
|
|
|
|
As title.
Especially when the BOSS asked some projects long time ago....
|
|
|
|
|
//Why are you still here?
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
// I am fixing your bugs still
|
|
|
|
|
When I was at college I was told that every line of code MUST be commented, however they did stress that the comment should state why you are doing something not what you are doing (after all, you can figure out what the code is doing just by reading it, and if you can't understand the code then it needs to be refactored), sticking to standard patterns also helps with ease of understanding.
Despite what they impressed on me at college, I'm not in favour of commenting every single line of code as it's unnecessary, but I (mostly) always write headline comments on Methods/Properties/Classes/whatever as an overview of functionality; and I also (mostly) write comments for a group of statements in methods more or less like a overview/guide, without commenting every line.
But, most importantly, I comment for the future me, who in 2 weeks time will be looking at a section of code I wrote at 11:30pm one evening thinking - why did I do it like that again?!
"Benjamin is nobody's friend. If Benjamin were an ice cream flavor, he'd be pralines and dick." ~ Garth Algar
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." ~ Paul Neal "Red" Adair
|
|
|
|
|
1.21 Gigawatts wrote: I comment for the future me, The "future you" is the "future maintainer", who in 20 years time, will probably be "somebody else". So, you should comment for the "future maintainer".
#SupportHeForShe
Government can give you nothing but what it takes from somebody else. A government big enough to give you everything you want is big enough to take everything you've got, including your freedom.-Ezra Taft Benson
You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun
|
|
|
|
|
Hopefully most of my code is not in use anymore in 20 years.
|
|
|
|
|
The 'future maintainer' is me in this context
I do C# for fun, day job is slightly different, but related nonetheless!
"Benjamin is nobody's friend. If Benjamin were an ice cream flavor, he'd be pralines and dick." ~ Garth Algar
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." ~ Paul Neal "Red" Adair
|
|
|
|
|
I don't always comment, but when I do, it's for my future self. As a solo dev for most of the past 16 years, I've never had a problem understanding my own code.
"Go forth into the source" - Neal Morse
|
|
|
|
|
You must not get out much.
#SupportHeForShe
Government can give you nothing but what it takes from somebody else. A government big enough to give you everything you want is big enough to take everything you've got, including your freedom.-Ezra Taft Benson
You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun
|
|
|
|
|
Whaddaya mean? I'm here most days!
"Go forth into the source" - Neal Morse
|
|
|
|
|
Dan Saks, one-time secretary of the ANSI/ICO C++ standardization committee, said the following:
"If you can say it in code, do so. Otherwise, say it in a comment."
In other words, your code should be self-documenting as far as possible. Your comments should supplement that documentation as necessary.
Software Zen: delete this;
|
|
|
|
|
|
Real words of wisdom there.
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
Seasoned programmers know well that code is the ultimate comment. When code reads like a story, there's hardly any comment needed. Comments come handy only when you have to break the flow of the story due to limitations of the language or adopt a complex hack to improve performance, etc.
|
|
|
|
|
I've seen some linq examples here that does NOT read like a story and definitely needs commenting
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I agree with you and I have seen simple structures like for loops that require comments. Any programming feature or paradigm can be abused if its purpose is not fully understood by the developer.
|
|
|
|
|
Comments are for business logic. There are often things we are told to do that seem crazy, but they are just the crazy things we're asked to do. So often times, the comments explain why I'm doing something I don't think makes sense to do.
Hogan
|
|
|
|
|
// I'm sorry
|
|
|
|
|
so I use long and explaining coding conventions and names and a clean control flow to make it easy readable.
Only when it gets wired I use comments.
This is working fine for me for some years. I understand my 10 year old code. (I hope so)
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
To the poor souls who have to review my code
|
|
|
|
|
I do not fear of failure. I fear of giving up out of frustration.
|
|
|
|