08-26-2014 04:28 PM
08-26-2014 04:40 PM
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.
11-06-2014 03:47 PM - edited 11-06-2014 03:50 PM
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.
11-06-2014 03:57 PM
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.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
11-06-2014 06:40 PM
@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! 😉
11-06-2014 08:06 PM
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
11-06-2014 08:14 PM
@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.
11-06-2014 09:03 PM - edited 11-06-2014 09:03 PM
@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?