|
Not sure if you're being sarcastic Not only do those comments not follow Microsoft guidelines, I don't think they're particularly good.
|
|
|
|
|
No, I'm not being sarcastic; if I was being sarcastic, you would feel the sharp point of it entering your eye.
Of course, you are entitled to your opinion on the commenting, but, I would ask you if you have actually read enough of the code to form an opinion rather than "rushed to judgement" based on a single example from such a faulty source as this flea on the hide of C# who dares write like he knows what from what.
I admit I am used to reading code that is often butt-naked of comments; perhaps I am grateful for what may seem, by your exalted standards, mere "crumbs"
I look forward to studying your next CP article, and seeing how you do commenting ... that's not sarcastic, either. I am always ready to learn from good examples.
cheers, Bill
«The truth is a snare: you cannot have it, without being caught. You cannot have the truth in such a way that you catch it, but only in such a way that it catches you.» Soren Kierkegaard
|
|
|
|
|
If you're used to code with no comments then for sure these are better than nothing, but I stand by my comments that they're not very good and don't follow guidelines. If you were to use that code in a project that uses style analysis tools you've have to re-write the comments.
As for comments in CP articles, you don't comment articles the same way you would comment actual code. Also those particular comments are for people who implement the code mainly as an API, eg they need to know what the function does without access to the source code to determine it for themselves, and those comments can be used to generate "MSDN" documentation and they are also used in Intellisense etc.
I haven't looked through the whole code, but I am assuming that you chose what you considered to be a good example to use in your thread so I don't think it's unjust of me to judge the rest of the code based on the snippet you provided.
|
|
|
|
|
F-ES Sitecore wrote: I haven't looked through the whole code, but I am assuming that you chose what you considered to be a good example to use in your thread so I don't think it's unjust of me to judge the rest of the code based on the snippet you provided. If you question my ability to know what good comments are (and, that's a very fair question), then why would you assume my selected comment accurately describes the quality of the comments in a work by another person which you haven't bothered to peruse ?
If you wish to present yourself as a judge of good commenting, rather than just a drive-by sniper taking cheap-shots, you need to investigate the source with your own eyes. Of course, that would take effort on your part.
«The truth is a snare: you cannot have it, without being caught. You cannot have the truth in such a way that you catch it, but only in such a way that it catches you.» Soren Kierkegaard
|
|
|
|
|
I don't think it's unreasonable to assume that if you are saying something is well commented that you would use an example that you consider to be well commented. You stated in your OP you think this is well commented, and I am simply telling you that in my opinion it isn't. That is part subjective, I don't think the person who wrote those comments has English as a first language so they don't read well for me, but it is also part objective as they don't follow Microsoft's guidelines. If I look at the help for, say, the Connection property of SqlCommand then look at the help for this code they are completely different in style, and they should be the same, you shouldn't expect your audience to adapt, that is what guidelines are there for.
If you can find a better example that will make me change my mind then by all means find one and update your OP.
|
|
|
|
|
BillWoodruff wrote: If you question my ability to know what good comments are But that's not what he's saying, at all.
He's saying that the comments, as written, do not follow guidelines, so would be picked up by style analysis tools -- which, given the <summary> tags, may well be in use.
However, I would have thought that you would have picked up the incorrect use of "or" in the first line of the summary, which gives the sentence a meaning that the writer probably does not intend.
That's two strikes. Your venomous response in your last posting counts as a third, for me. You were not being attacked; someone was discussing something with you.
Discussing: you know, where one person gives his opinion, and other people give theirs, and everyone respects other people's rights to have opinions (or, at very least, responds with a riposte that is witty, not nasty).
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
Writing good comments is a skill that is often lacking in programmers. Too often you see meaningless comments like:
i++;
Any idiot can see you are incrementing i! The comment is meaningless. Meaningless comments is one of my pet peeves.
Get me coffee and no one gets hurt!
|
|
|
|
|
Cornelius Henning wrote: Any idiot can see you are incrementing i!
Well, yeah. But it's intelligent people that need the help!
I am not a number. I am a ... no, wait!
|
|
|
|
|
I agree about silly comments, but sometimes
while(x)
{
...
i++;
it simply helps to "give a nice Format"
Only my mind
modified 19-Jan-21 21:04pm.
|
|
|
|
|
Right? I will never not
while is_cool():
#...
else: #nobreak
#...
and
try:
#...
except:
pass
else: #noraise
#...
Sure, anyone experienced will know what's going on, but I'm guaranteed to forget the next time I come to it.
|
|
|
|
|
I don't mind that kind of comment if it's in DoxyGen tags, or similar, because otherwise the HTML documentation would be blank for that function, but in-line like that it's a waste of time to both write and read.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
BillWoodruff wrote: This library does everything but walk the dogs
No good to me then!
I am not a number. I am a ... no, wait!
|
|
|
|
|
I completely agree. I used this library couple of years back and was delighted to see it work straightaway along with a very good code quality and equally good comments.
All are born right-handed. Only gifted few overcome it.
There's NO excuse for not commenting your code.
|
|
|
|
|
If one person on this thread ignores the static (mine and others), and gives the author of this incredible library the credit he's due ...
I think I'll go on living: no matter that enthusiasm, here, often requires the bearer to suffer the "slings and arrows of outrageous fortune"
cheers, Bill
«The truth is a snare: you cannot have it, without being caught. You cannot have the truth in such a way that you catch it, but only in such a way that it catches you.» Soren Kierkegaard
|
|
|
|
|
I couldn't agree more I doing some work involving RabbitMQ and Protocol Buffers developed in Java using intelliJ (which is bloody amazing by the way and I've always been a Visual Studio chap) and everything so far has been free, gratis, zilch cost! How are people making money I wonder.
|
|
|
|
|
Quote: recursive is an option, among many options
I like how this sounds.
|
|
|
|
|
People who don't like to write comments figure comments are useless unless they rival Shakespeare sonnets in beauty and depth. People who do write comments know that commenting the code helps both the author and any readers to understand intent. Further, while a particular comment may be somewhat obvious, the effort made over the whole program to review and summarize its pieces is a mental discipline that generally pays off in better code.
|
|
|
|
|
SeattleC++ wrote: a mental discipline that generally pays off in better code. A very eloquent comment, and a very solid finish !
I believe there are some very interesting developments in annotating code ... thinking of writing comments in the code as one form of annotation ... still to come, though I don't claim to know what they will be.
People I've encountered who don't like to write comments have been either just unaware/uninformed of their future value, or ... lazy. However, there are rare people with phenomenal mnemonic skills; I met a fellow at a Mac software company in the late 1980's whose co-workers called him "Mr. Rom," because he knew, from memory, all the op codes for every ROM function call.
cheers, Bill
«The truth is a snare: you cannot have it, without being caught. You cannot have the truth in such a way that you catch it, but only in such a way that it catches you.» Soren Kierkegaard
|
|
|
|
|
|
Well, when a Mommy Chocolate Parrot and a Daddy Bee want to have babies, they get together under a Gooseberry Bush and Summon The Stork, who delivers them a load of Chocolate Eggs, which they take turns in hatching.
These days, the Stork's job has been outsourced, the Chocolate Parrot died of Avian Flu, and the Chocolate Bee was downsized - so Tesco fills all three roles and loads its shelves with Chocolate Eggs for all to take home and hatch. The Easter Bunny drives the truck.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
This is one of your best, Griff
«The truth is a snare: you cannot have it, without being caught. You cannot have the truth in such a way that you catch it, but only in such a way that it catches you.» Soren Kierkegaard
|
|
|
|
|
Anti human control freaks Monsanto are killing all the bees intentionally so you are forced to buy their centric ally engineered plants. And keep buying them year after year
|
|
|
|
|
You're so damn ignorant and wrong it's almost not KSS in and of itself.
You do know that when farmers by non-Mansanto hybrid seeds that the seeds they get from their crop will not breed true (as in the case of all hybrids) - and so the difference is moot. Why aren't you complaining about hybrid seed, as well?
No one buy's Monsanto's seed, unless they get a financial advantage from it. Just remember, corn that kills corn-borers (with the same pesticide, internally, as organic farmers use) and requires no spraying toxins into the environment is really a big plus. Even a third-world farmer would benefit as he gets a larger crop and doesn't have to put out money for sprays and doesn't have to poison him/her self and family in the process.
As for the bees, they're suffering for several reasons. Not just a parasitic disease going around. There are vast areas where there's only a single crop. When they're in bloom, the bees can feast - but then they're all out of bloom for the rest of the summer - and starvation is the rule for the hive. Unfortunately, farming at the level of many small fields of diverse crops would so reduce the food supply as to initiate world-wide starvation as the production of food drops.
Basically, like it or not, GMO's are the only way to improve productivity without requiring more land (such as chopping down the rain forests). Another alternative would be for you to give up your animal-burgers so the food isn't wasted fattening them up. Other (more traditional) options are war and pestilence. Myself? I opt for the science that will feed the planet with more and better food.
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "As far as we know, our computer has never had an undetected error." - Weisert | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
W∴ Balboos wrote: GMO's are the only way to improve productivity Monsanto's got you hooked too. You should do some research first.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Not really - and I looked into this quite a bit. Genetically modifying plants is essential for survival of the human race. This is the state of affairs because the last big breakthrough, which would have been in time to mitigate this need: easy and effective birth control - didn't really catch on where it was needed most. So, a couple or three billion additional humans later, the planet is seriously elephanted.
I've been against burning carbonaceous fossil fuels even when oil was US$3/barrel. It's to valuable a raw material to burn (then and now). I'm not particularly on board with any group. For example, I'm a vegetarian for 45 years - but consider PETA a bunch of a$$hole$.
The question I always ask - and never receive a valid response for - is an alternative to GMO.
Perhaps, just perhaps, it's a lot of fear-mongering that has put unfounded fears and conspiracies into the justifications. Now, prove them wrong. But even if you do, those espousing them will simply call it a cover-up.
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "As far as we know, our computer has never had an undetected error." - Weisert | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|