08-06-2018 12:22 PM
@Bob_Schor wrote:
Here is the NightMare in LabVIEW 2015 ...
BS
LOL when I first opened it up I was like, "This isn't so bad," and then I scrolled left.
08-06-2018 12:35 PM
Thanks everyone for their inputs, they are much appreciated!
Here is some additional info:
I am not an expert in the field, I have a general idea of how the system works, but really all I do is add and fix code as well as conduct technical research. I wish I had the background or at least the person who wrote the code to explain what the theory and reasoning is for this. Unfortunately I'll probably have to make assumptions or just cluster together things I assume are together. I am actually a chemist, but I'm making things work on the programming and physics end of this project.
I have reason to believe this code was written circa 2004
08-06-2018 12:37 PM
Ironically, I just re-opened it and was wondering if that's what everyone was thinking when first opened. Just looks like a lot of unused space until you scroll left.
08-06-2018 12:39 PM
@etvg wrote:
Thanks everyone for their inputs, they are much appreciated!
Here is some additional info:
I am not an expert in the field, I have a general idea of how the system works, but really all I do is add and fix code as well as conduct technical research. I wish I had the background or at least the person who wrote the code to explain what the theory and reasoning is for this. Unfortunately I'll probably have to make assumptions or just cluster together things I assume are together. I am actually a chemist, but I'm making things work on the programming and physics end of this project.
I have reason to believe this code was written circa 2004
Bad code is capable of time travel with no loss in its badness.
Does it work?
If it works don't mess with it.
Ben
08-06-2018 12:54 PM - edited 08-06-2018 12:54 PM
Granted I don't know who you work for but I was handed a similar piece of code (see attached) and told to update it for a completely different product and make the front panel presentable for a customer qualification visit.
I flat out refused and started over.
Turning out a more robust program based on a proper programming architecture that is easy to maintain and has now become our lab's Qualification Platform.
08-06-2018 12:55 PM
It does work. However while I am running experiments in the lab I usually sit down with the code and try to make it simpler. The whole code used to be written in this same manner as some of you have seen in previous questions (@altenbach @bob_schor), and I would like to continue to make it user friendly for the next guy, as I leave in six weeks. I suppose it can be seen as a challenge as well.
Cheers
08-06-2018 12:58 PM - edited 08-06-2018 01:02 PM
@Ben wrote:
@etvg wrote:
Thanks everyone for their inputs, they are much appreciated!
Here is some additional info:
I am not an expert in the field, I have a general idea of how the system works, but really all I do is add and fix code as well as conduct technical research. I wish I had the background or at least the person who wrote the code to explain what the theory and reasoning is for this. Unfortunately I'll probably have to make assumptions or just cluster together things I assume are together. I am actually a chemist, but I'm making things work on the programming and physics end of this project.
I have reason to believe this code was written circa 2004
Bad code is capable of time travel with no loss in its badness.
Does it work?
If it works don't mess with it.
Ben
I agree here. The worse it looks, the less you should fool with it. Sometimes bad code depends on its "badness" to run "correctly", including stuff like race conditions. For instance, once I cleaned up some communications routines so efficiently that there was an unknown race condition downstream that, due to the communications happening is less than one second instead of several seconds, was now reading stale data.
If something is that bad, I generally rewrite it and then compare the output(s) to the original code to make sure it's doing the same thing.
08-06-2018 01:02 PM
I probably could attempt to re-write the entire code; however, not having a background in programming, the hardware, or physics to completely understand the theory could severely inhibit my ability to do so. This code is for measuring resonances of materials via a digital Resonant Ultrasound Spectrometer.
08-06-2018 01:05 PM
I'm sure you are right on the race conditions, I had a crack at changing some stuff about a week ago and I was having some race conditions, then a scenario where it worked; however, for some reason the speed of the system was hamstrung. This led to me just scrapping that VI and going back to the old version.
08-06-2018 01:12 PM - edited 08-06-2018 01:19 PM
Edit: Deleted due to double post.