Code Smells In LABVIEW–Part 2

Last code smell post was about giant piles of spaghetti code, this one is about something that is very, very, very typical for people who have experience with c-like programming languages:

Not understanding DataFLOW

That problem has two parts, and this one is the first and most annoying:

Overuse of sequences

Sequences in LabVIEW are.. well, the single most overused concept. I don’t like them. I use them, very, very, very seldom (like once a year or so).

They violate the principle of data flow – or they tell me that you didn’t handle an error.
Code runs when the data is ready : http://www.ni.com/gettingstarted/labviewbasics/dataflow.htm

(Be careful with reference data types, though. For example queues or imaq image data. LabVIEW duplicates the pointer, not the object, so you could need to enforce data flow to prevent unpredictable behaviour. Do this with always, always connecting error wires.)

Second part about not understanding data flow is overuse of global and local variables. Ever wondered about why your code is so slow?

Next part in the series: Using clusters and not thinking about data structures.

Advertisements

2 comments

  1. […] “turning science fiction into reality” ‹ Integer to String in Cpp Code Smells In LABVIEW–Part 2 › […]

  2. […] of a series on code smells in LabVIEW. #1 is about huge, messy piles of spaghetti, #2 is about not thinking dataflow, and this part is about thinking that everything is a […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: