04-07-2010 06:58 AM
macaba a écrit:
Unless the diagram is paint-ed, this is the correct answer. However, it might depend on the configuration of the diagram clean up.
04-07-2010 07:12 AM
That's a badly written question showing badly written code. It does not test people's knowledge of LabVIEW... Well.... maybe some...
Still a badly written question. They should not "encourage" code where the wire goes from right to left..
04-07-2010 07:27 AM
04-07-2010 07:36 AM
04-07-2010 07:47 AM
04-07-2010 08:00 AM
Full disclosure: I am a LV snob.
Here is an old joke pointed at me:
"Those who think they know everything are particularly iritating to those of us who do."
Question:
Is it just me or do others feel embarasment when they see bad LV code examples coming from an NI source?
Over the years Christian has made his mark here on the forums in that he has set the standard for well written code. But that standard which many of us push is not shared by NI. I guess I really wish that they would listen to us more.
Waxing philosophical:
LabVIEW is a beautiful creature whos' features are often ignored by its creator.
Ben
(Sometimes refered to as the LabVIEW Evangilist)
04-07-2010 08:05 AM
Ben wrote:
Is it just me or do others feel embarasment when they see bad LV code examples coming from an NI source?
It's not just you. I've often remarked that many of the NI functions wouldn't pass the CLD. We preach adherence to good style, but don't always practice it.
04-07-2010 08:07 AM - edited 04-07-2010 08:08 AM
Ben wrote:Is it just me or do others feel embarasment when they see bad LV code examples coming from an NI source?
I'll let you into a secret- we are human too (eeek!) and it takes time for us to pick up good practice too! (Our learning curve is steeper than most though which helps)
Also when you look at 'badly-written' customer code, day after day, it rubs off on you (its rare to find the good coding practices that you preach!)
04-07-2010 01:08 PM
Ben wrote:"Those who think they know everything are particularly iritating to those of us who do."
Question:
Is it just me or do others feel embarasment when they see bad LV code examples coming from an NI source?
yes.. (I had that poster up on my wall at University.. Still have it.. Sometimes it applies to me... Other times it applies to others.. It's an interesting perspective).
Glad my comment struck someone's nerve.. How do you convince people of doing someting right if you keep showing how to do it wrong...
I'm going through the worst spagetti code I have ever seen in my career.. I'll limit my comments.. The author didn't even have the audacity to put his name in the code.. No comments whatsoever in the code.. Not even a header...
We have to preach the right coding methods or at least to the best of our knowledge and we need to prevent examples or test questions which seem to indicate that it's okay to do so because the source did it.. Or someone else did it..
Thanks Ben! 🙂