Jump to content

The Zen of LabVIEW


Jim Kring

Recommended Posts

I'm a big fan of the Python programming language/environment and I really like The Zen of Python (by Tim Peters) :

Abstract

Long time Pythoneer Tim Peters succinctly channels the BDFL's

guiding principles for Python's design into 20 aphorisms, only 19

of which have been written down.

The Zen of Python

Beautiful is better than ugly.

Explicit is better than implicit.

Simple is better than complex.

Complex is better than complicated.

Flat is better than nested.

Sparse is better than dense.

Readability counts.

Special cases aren't special enough to break the rules.

Although practicality beats purity.

Errors should never pass silently.

Unless explicitly silenced.

In the face of ambiguity, refuse the temptation to guess.

There should be one-- and preferably only one --obvious way to do it.

Although that way may not be obvious at first unless you're Dutch.

Now is better than never.

Although never is often better than *right* now.

If the implementation is hard to explain, it's a bad idea.

If the implementation is easy to explain, it may be a good idea.

Namespaces are one honking great idea -- let's do more of those!

If we had a Zen of LabVIEW, what would it be? Here are a few ideas to get things rolling...

Straight wires are better than those with with bends

Flat sequence structures are better than stacked

Always wire error clusters -- inputs and outputs

Avoid relying on defaults (e.g., "default" frames in case structures, default tunnel values, default shift register values)

Initialize your shift registers (unless you are creating a LV2 global)

Required inputs should be marked as "required"

Nice icons are worth every minute spent on them (but not every hour spent on them)

Please create VI Descriptions and comment your code

Link to comment
If we had a Zen of LabVIEW, what would it be? Here are a few ideas to get things rolling...

A cluster or enum should be a typedef.

A typedef should be a LV class.

LV classes should be improved so that the previous is practical.

Event structures are better than polling loops.

LV makes UI easier, but even so, good programmers are not necessarily good UI designers. Figure out which you are and ask for help if necessary.

Link to comment
It sounds a little more in the western tradition than the eastern, but ...

Point taken. In that vein I offer a koan...

At dawn, a student asked of the master, "Master, what must I do to achieve enlightenment?"

The master answered, "Walk around this pole all day. Each time you reach north, smack yourself in the head."

The student did so.

The next day, the student asked the master, "Master, what must I do to achieve enlightenment?"

The master answered, "Do as you did yesterday, but skip the walking."

Upon hearing the answer, the student was enlightened.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.