From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why structures function palette is not complete?

Solved!
Go to solution
To use them IS to abuse them.
0 Kudos
Message 11 of 18
(1,172 Views)

Lalox wrote: Do you know problems using this sequences bacause of Labview, not bad programers?

Admittadly, bad programmers.  However, in general, you are much better off using a State Machine.  Yes, there are times where a sequence structure is the way to go.  But I would much rather have a flat sequence structure than a stacked sequence structure just so that I can see all of the code.  And we are talking 1 to maybe 3 frames.  Any more and I go with a state machine.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 12 of 18
(1,167 Views)

Hello,

 

I think in general one should be less categoric when telling other people how top write "good programs". I have 20+ years of OO programming experience, and I also used to be very categoric in my early days. Later, one realizes, that every style / strategy may have its place.

 

I also use Stacked Sequences a lot, but only when initializing GUI (VI Front Panels): BUT; then again, my latest sytem, HPC-09 v6, www.objective.no/lean ,   has 30+ Front Panels.

 

 

Geir Ove
0 Kudos
Message 13 of 18
(1,095 Views)

If 10 out of 10 experts in any field say somthing is bad, you should probably take their opinion seriously.  Even if you think you have it all figured out.

0 Kudos
Message 14 of 18
(1,082 Views)

@Hooovahh wrote:

If 10 out of 10 experts in any field say somthing is bad, you should probably take their opinion seriously.  Even if you think you have it all figured out.


Let's not start THIS all over again!  😉

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 15 of 18
(1,066 Views)

Hi,

 

I agree Stacked Sequence Structure is possibly a disaster for maintenence, though sometimes it save the space of the block diagram.

I used the structure for tick count sandwiched the main code.

After I read the following paragraph, I'm surprised at the performance.

Does Stacked Sequece Structure really affect the performance of the program, not just the code presentation?

 

 

 

 

But 20141107001.JPG

0 Kudos
Message 16 of 18
(1,049 Views)

@Lalox wrote:

Not so really bad using stacked sequences, I understand what you say, I use subVi's also but this kind of sequences helps for especific purposes and it is up to the programmer using them or not.

But now I have to ask, I use them but not abuse them, and I have no issues on my programing, so Do you know problems using this sequences bacause of Labview, not bad programers?

Thanks all of you, this was not an issue when i fist saw the bug list somo days ago.



I used to be with you on this, (thinking the SSS could be used without abusing it)  See the link to the IE in Altenbachs latest reply.

 

Honestly, I believe there may be a use for the SSS that could not be done otherwise.

 

I have not used one in over a decade - But I have not coded every edge-case yet either!

 

The use of the SSS in a less than optimal design (Structure use / structure abuse) approaches unity in theory.  In PRACTICE, from my experience with every vi I have seen that ratio is statistically insignifacant from unity.  Every time it is used it is abused.

 

I do welcome examples of documentable desing optimizations that use the SSS.  But, they are rare cats indeed in modern LabVIEW versions!  The SSS was correctly hidden from newer users.  Every structure you "should" like to use is on the structure palatte.


"Should be" isn't "Is" -Jay
0 Kudos
Message 17 of 18
(1,045 Views)

@geirove wrote:

Hello,

 

I think in general one should be less categoric when telling other people how top write "good programs". I have 20+ years of OO programming experience, and I also used to be very categoric in my early days. Later, one realizes, that every style / strategy may have its place.

 

I also use Stacked Sequences a lot, but only when initializing GUI (VI Front Panels): BUT; then again, my latest sytem, HPC-09 v6, www.objective.no/lean ,   has 30+ Front Panels.

 

 



@Lalox wrote:

Not so really bad using stacked sequences, I understand what you say, I use subVi's also but this kind of sequences helps for especific purposes and it is up to the programmer using them or not.

But now I have to ask, I use them but not abuse them, and I have no issues on my programing, so Do you know problems using this sequences bacause of Labview, not bad programers?

Thanks all of you, this was not an issue when i fist saw the bug list somo days ago.


 

geirove, look at what Lalox actually said.  They pointed out there are specific purposes which are suited to a sequence structure.  That's correct.  They previously claimed they use them frequently.  This is how we know it's poor programming style.  The specific purposes aren't common.  If they're using the sequence often, it's safe to say it's bad code.

 

You mention 20 years of OOP experience.  If you're working with an OOP language for a large project, does it make sense to have a single class?  Or, would you be better off abstracting things to make multiple classes so you could use the code in other projects you have?  Does it make sense to use methods or should we keep ALL of the code in the main method and just copy/paste the code we want each time?  Do either of these actually have a place in a well-written program?

 

There are things that are arguably bad.  There are other things that are definitely bad and show a lack of understanding of the language.  Ignoring functions/methods to put everything in main shows you don't really understand the language.  Sure, you're accomplishing your task.  But, you'll be better off if someone points out the value of functions and sets you on a better path.  This is true with one day of experience or 20 years.  When people point out it's a bad programming practice, they aren't insulting the programmer.  We all started from a place of ignorance.  We found a tool and learned to use it.  Often, it's quicker to keep using that tool rather than learn to find the correct tool.  99% of the time, programmers are using sequence structures (of either type) because they don't understand dataflow.  Understanding dataflow is paramount to using LabVIEW correctly.  It's not categorizing to suggest they learn what makes LabVIEW work.  I'd say it's detrimental to NOT point this out.  Programmers should be interested in constant growth and learning new techniques.  They shouldn't be afraid of code review.  I'd much rather write a better program.  Wouldn't you?

Message 18 of 18
(1,028 Views)