What do you do when you encounter substandard code

robertmee

Lifetime Supporting Member
Join Date
Feb 2008
Location
NC
Posts
2,011
As a system integrator, a healthy portion of my work is rewriting other companies code. Sometime's it's code that was written by the company itself (internal engineer in the past), and sometimes it is code written by other SI's. Recently, I've encountered some really bad code, some bordering on dangerous. Do you notify the customer that they should be aware that Vendor A is providing substandard work that could potentially adversely affect process/safety? Or do you bite your tongue and just rewrite it properly, knowing that Vendor A's code is elsewhere in the plant. I don't want to get into a position of bad mouthing another SI, because I know we all have different standards and methodologies, but at the same time, do you just let bad code go unchecked? And what if it is the own company's engineer that wrote the code? Do you somehow gracefully educate without making the engineer feel incompetent?

Just wondering how the rest of you handle it, and if you're rewriting my code, I apologize in advance for my bad code :)
 
Wow

Pu88y footing was never a strong suit for me either. If it's substandard production code, no I'd bite the tongue. If it's a safety issue, Id speak up. Go after the code not the vendor or the person.

You could off handed ask then who wrote it. Ya know just out of curiosity. Gather you safety issues, and just tell them. "look these are some items I think might be a safety issue. This code might be in other areas too." Try not to even bring up the other source. you'll look like your taking the higher road.

Once you bring it up, the customer might just figure it out on their own.

Then just offer to fix it.
 
Before you discuss it with the decision makers, you should be able to demonstrate problems or potential ones in ways that affect production, quality, safety or some other parameter that equates to dollars.

If you are sure you can show them real reasons that affect the bottom line enough to justify the expense of reworking it, then go forward.

Then you need to be as diplomatic as possible. When in your position, I have said things like, "The overall design of the logic doesn't fit well with the present and future needs of the equipment and should be revamped to bring it in line with your needs." Or something like: 'Making a structural change to the logic can greatly improve efficiency' (or safety or productivity) and be prepared to give an example.

Instead of pointing out how bad it is, talk about how much better it could be.

I have been guilty of talking very harshly of some of the **** I have run across, and it was in my hands to rewrite it, but my derogatory comments about it didn't garner any extra support. It was when the machine stalled and refused to make product after a timer preset on the HMI was changed by 1/10 of a second and they had to call the OEM...that'$ when they decided to let me fix it right.
 
I'm in that situation with one of my projects now. In-house guy started it, got 75% complete, got promoted, and they've contracted me to finish it (2 robots tending 4 lathes, conveyor, gage, and vision stations). I should have no-quoted it but I didn't know how bad it was and there isn't enough time in the project to re-write it so I apply band-aids wherever I can. Luckily I only agreed to take it on if it was time and material.
 

Similar Topics

Hello everyone, I'm having issues with connected components. I got a new laptop and I installed all the RA programs I need without problem. I was...
Replies
1
Views
297
Hi All, Someone at work has put a PLC system on my desk, that's just been taken off an idle production line. He said "It's an S7 PLC. We don't...
Replies
3
Views
72
hello, I'm a student and for my final grade I have to repare a sepro robot. the only problem I have for now is that i have an error code 3...
Replies
0
Views
35
I received an email from a student with the following code attached. This is supposed to control a floodgate system, and supposed to be written...
Replies
23
Views
778
I have a machine which is undergoing upgradation. As part of the process two SEW drives are being replaced., existing Gen B with new Gen C. The...
Replies
3
Views
193
Back
Top Bottom