LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Flat sequence and stacked sequence


Where do you put a long comment that would not fit on one screen beside the code ?
  1. I don't comment the code
  2. Outside the visible part of the screen
  3. In a sub-VI
  4. In the description of an element of the diagram
  5. In the description of the VI
  6. I use a state machine
  7. I use a flat sequence (should not be mentionned because it won't solve the problem of case 2)
  8. I use a stacked sequence
  9. ...

    Oh Wow Frankly 8 seems to be the best option.
Do i follow it...

noooooooooooooo

honestly 1 is what i doSmiley Very Happy
Message 21 of 52
(1,439 Views)
I like to put a sub-vi with a big question mark for its icon on the BD. Open it up, and it's just a front panel with text boxes of my documentation.
-Cory
Message 22 of 52
(1,435 Views)


JB wrote:

And what is faster ?
  • one click on the stacked sequence selector to switch from the code to the comment and back
  • move the horizontal scrollbar to read the comment and then reajust its position to show the code


Ctrl+Scroll on the SSS.
 
Personally, I don't tend to have very long comments either. I do have comments which contain quite a bit of text, but no more than a two or three short paragraphs usually.
 
Incidentally, a better way of handling versioning of a VI is to use source code control.

___________________
Try to take over the world!
Message 23 of 52
(1,429 Views)


@JB wrote:
Please take notice that neither of my examples lead to use variables of any type ! I spoke about rare circumstances !


Okay, that's not for coding that you use stacked sequences... okay! Smiley Happy

graziano
Message 24 of 52
(1,421 Views)


@tst wrote:

Personally, I don't tend to have very long comments either. I do have comments which contain quite a bit of text, but no more than a two or three short paragraphs usually.

Incidentally, a better way of handling versioning of a VI is to use source code control.


That's near to XP programming: almost no comment at all, the code has to "comment by itself".

graziano
Message 25 of 52
(1,410 Views)

Graziano a écrit:
Okay, that's not for coding that you use stacked sequences... okay! Smiley Happy

graziano

No, the stacked sequences help me to respect an even greater commandment (IMHO) which states that a diagram must be limited to the screen size !
Message 26 of 52
(1,401 Views)

@JB wrote:

No, the stacked sequences help me to respect an even greater commandment (IMHO) which states that a diagram must be limited to the screen size !




That's a great commandment, I agree Smiley Happy ! Even if many times I dont respect it Smiley Sad

graziano

0 Kudos
Message 27 of 52
(1,398 Views)


Graziano wrote:

That's near to XP programming: almost no comment at all, the code has to "comment by itself".

Not at all. I actually comment quite a lot. I find it much easier and quicker to read what a piece of code does than to start deciphering the code. The comments themselves don't have to be very long for that to happen. The trick is keeping the comments up to date if the code changes.
 
And yes, I also happen to think that SSS and diagrams larger than a single screen are legitimate in certain circumstances.

___________________
Try to take over the world!
0 Kudos
Message 28 of 52
(1,381 Views)
A good way for commenting can be a SubVI which has a descriptive icon, possibly with some text, and an intuitive name.  It's the same as naming functions the best way to describe their behavior, which in most cases avoid comments! Of course, this holds in some cases, not always!

graziano
Message 29 of 52
(1,377 Views)
That's not exactly commenting. SubVIs should definitely have good names and icons and their description filled in (although that doesn't always happen either), but I'm refering to textual comments in the diagram itself. No matter how good your code is, it will almost always be simpler to read a short piece of text describing what happens, because in the comment you don't usually go into all the details.

___________________
Try to take over the world!
Message 30 of 52
(1,371 Views)