Jump to content

How NOT to code large applications


Recommended Posts

QUOTE(manic @ Sep 19 2007, 03:39 AM)

The worst example of bad labview code i've ever seen was a monstrous 16 MB VI without any subVI. I guess it had about 300 screen sizes, when viewed in 1280x1024 px. Something like 20 screens wide and 15 screens high.

Unfortunately, i can't provide an image of that thing...(not only because of the size, but due to legal reasons)

Fortunately, i wasn't the guy to redesign that piece of LV-**** :laugh:

If I would be tasked with that my reaction would be simple. Don't even try to redesign it! It will cost at least double the time than doing it from scratch and still not be as clean and performent as it should be.

Rolf Kalbermatter

Link to post
  • Replies 56
  • Created
  • Last Reply

Top Posters In This Topic

QUOTE(rolfk @ Sep 22 2007, 09:53 AM)

In fact one of my last assignments has been to take over multiple projects whch are done (not wired or coded) anti-principles. You name it. Case inside a sequence inside a case inside a sequence. Local Variables, Globals, Not Auto indexing, using While loops instead of for loops etc. Can't post the code as it multiple screens in Height and width. Another thing that puzzled me ia lot is varibale names. It can drive you crazy. PressurePSI is actually holding PressurekPA in some places. The biggest challenge was that there are more than 30 loops in the same VI all polling, all timed at different rate and the only way the data is exchanged is via Locals and Globals. The problem was the program works on one PC and does not on another. Pray why should that be?!! The original Author blames the Windoze!! They want me to fix this.

Anyway to make the long story short. This is what I told them. "Go ask Eric Clapton to pick up his guitar and play cacophony, just random sounds. I bet he will not be able to do it. It is the same here. If you want more Cacophony hand the guitar to someone who does not know how to play. If you want music, the concert must start all over again."

Anyway. We talk about Design Patterns all the time. But it may be worthwhile to look at Anti-Pattrens, when teaching new people.

Lava Flow

Accumulate and Fire

http://en.wikipedia.org/wiki/Accumulate_and_fire

Busy Spin

Italian Coding

Golden Hammer

Accidental Complexity

Boat Anchor

Just Some nice terms to use... when talking code

Regards

Mache

Link to post
  • 11 months later...

I've inherited a bunch of spaghetti code, some of the most tangled bunches of wire you've ever seen. But, as bad as they are, I was able to understand & extend them. I've attached my favorite example of horrible code. The best thing about it is that I can point to the spaghetti code (written by coworkers) and honestly say it's not the worst I've seen.

Link to post

QUOTE (jcarmody @ Sep 14 2008, 07:06 PM)

The best thing about it is that I can point to the spaghetti code (written by coworkers) and honestly say it's not the worst I've seen.

That doesn't make it a good thing :D

Link to post

QUOTE (jcarmody @ Sep 14 2008, 04:06 PM)

I've inherited a bunch of spaghetti code, some of the most tangled bunches of wire you've ever seen. But, as bad as they are, I was able to understand & extend them. I've attached my favorite example of horrible code. The best thing about it is that I can point to the spaghetti code (written by coworkers) and honestly say it's not the worst I've seen.

I'd like to run that through diagram cleanup and see how it comes out (and how long it takes - so far I've been impressed with the speed)

Link to post

Join the conversation

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

Guest
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.