ganutenator
Lifetime Supporting Member
It better to have too many instead of not enough right?
It better to have too many instead of not enough right?
(* The correct setup is to set the top sp to a lower value than the side
Before the change in code, This would correctly not shut off the lp pump and lp s.v. before the side was done.
I wounder if Tom took into consideration blowing the rest out w/ air.
I wonder if since this first code change if I am leaving the air on.
I am attempting to write code so you can make the side sp smaller than the top sp for some reason I don't remember.
Here goes. 2023-09-27 iso format in case A A Ron ever reads this. he he
*)
(* attempt at writing code to above comment*)
(*I was told that you can not add too many comments.
I would argue that I can. And I'm pretty sure people that know me would agree w/ that*)
IF Pass1PreEarlyTopEn AND Pass1PreEarlySideEn AND Pass1PreEarlyOffInchesSideSp >= Pass1PreEarlyOffInchesTopSp THEN
Pass1EarlyOffNormal:= TRUE;
ELSE
Pass1EarlyOffNormal:= FALSE;
END_IF;
No 'probably' about it. Quality and accuracy. If you put in a comment that says, ""he next four rungs...." and then during debugging, you find you need to add a fifth rung, be sure to edit the comment.But the quality of the comments is probably more important.
I tend to describe the intention/reasons behind the code.
+ a little humor.
Code:(* The correct setup is to set the top sp to a lower value than the side Before the change in code, This would correctly not shut off the lp pump and lp s.v. before the side was done. I wounder if Tom took into consideration blowing the rest out w/ air. I wonder if since this first code change if I am leaving the air on. I am attempting to write code so you can make the side sp smaller than the top sp for some reason I don't remember. Here goes. 2023-09-27 iso format in case A A Ron ever reads this. he he *) (* attempt at writing code to above comment*) (*I was told that you can not add too many comments. I would argue that I can. And I'm pretty sure people that know me would agree w/ that*) IF Pass1PreEarlyTopEn AND Pass1PreEarlySideEn AND Pass1PreEarlyOffInchesSideSp >= Pass1PreEarlyOffInchesTopSp THEN Pass1EarlyOffNormal:= TRUE; ELSE Pass1EarlyOffNormal:= FALSE; END_IF;
Yes, better too many than not enough.
TL;DR
But the quality of the comments is probably more important. If it takes a couple of paragraphs to explain what a rung or statement is doing, then maybe that code should be refactored and simplified, even if it means breaking logic up across several rungs/statements, so it's easier to see prima facie what the code is doing and the comment can simply state why, and only explain what if absolutely needed.
There is a lot of opinion about comments out there; a search for "code comment standards" will find some useful pages. There are probably several threads in this forum alone.
Agree on the paragraphs, although I have a single CPT statement that's part of a linearizatuon routine of a 20x200 matrix that shows all the math in the comments...its a good 2 paragraphs
Generally no, but I don't need a paragraph to describe a one shot storage bit.
My pet peeve with excessive rung comments is when they're on every rung and simply state the same info that can be gleaned from reading the rung.
Describe the "why" or the overall methodology, or a date, time and reason for an edit. Spell out a formula for a complex computation. Things like that which add context to the logic or explain the structure are invaluable and never too much.