Slashdot Mirror


Ask Slashdot: What Do You Do If You're Given a Broken Project?

X10 writes "Suppose you're assigned to a project that someone else has created. It's an app, you'll work on it alone. You think 'how hard can it be,' you don't check out the source code before you accept the assignment. But then, it turns out the code is not robust. You create a small new feature, and the app breaks down in unexpected ways. You fix a bug, and new bugs pop up all over the place. The person who worked on the project before you is well respected in the company, and you are 'just a contractor,' hired a few months ago. The easy way out is to just quit, as there's plenty of jobs you can take. But that doesn't feel right. What else can you do?"

29 of 308 comments (clear)

  1. Enjoy your Death March by pegr · · Score: 5, Informative
    1. Re:Enjoy your Death March by 0p7imu5_P2im3 · · Score: 5, Insightful

      It's not that bad. Results are more important than intraoffice politics, if your superiors enjoy making money.

      I have been in this specific situation. In my case, the ultimate answer was to rewrite the portion of the program that was worst, mostly from scratch. We had some proprietary libraries for which we had obtained the source code. Going through said source showed that the flaws (in this case, performance drag) were well entrenched, so I decided it would be necessary to write our own code from scratch to replace it. There were no political ramifications because we no longer had a business relationship with the original company, as it had gone bankrupt, and the original code was now owned by our customer. It was on my head to succeed, and succeed I did. The performance of our software went well into the useful range and I had impressed my superiors immensely. Not only that, but about two weeks later, the other customer of our software had canceled their project, so this project that I had just brought to fruition was now the only project using our software. I saved 20+ jobs and was now in charge of our group's only project. I was a hero.

      That's when politics begin to matter. Another group in the company had lost all it's customers at the same time as our group lost our other customer. That group's manager needed a project at which to work, so after arranging a public shaming of my group's manager and taking over my group, he had me moved to the basement in another building... literally... He had to replace me with 3 managers and 2 programmers and 4 operators, but then, he was able to charge the customer for 9 employees' time instead of just 1 employee's time. Now he looked like the hero and I was looking for another job. If not for charging time spent to the customer, he probably would have lost that fight.

      The moral of the story is: Do your absolute best and, if money is more important in your company than politics, you will be rewarded.

      --
      Resistance is futile. Your technological distinctiveness will be added to our own. You will become one with the morgue
    2. Re:Enjoy your Death March by Anonymous Coward · · Score: 5, Insightful

      So you were demoted to a basement position and someone else, who had no part in the software you wrote, reaped the benefits and became the company hero for your work. How exactly were you rewarded?

    3. Re:Enjoy your Death March by jellomizer · · Score: 4, Insightful

      Here is the problem.
      1. The poster is judging the person by his code. We all write code, and in a few years we look back and go, what the heck was I thinking.
      2. Most home grown programs grow organically, so there isn't a strong strong infrastructure to it. This doesn't mean the maker was unskilled, or a bad programmer.
      3. It was a learning process at the time.

      So this is what you need to do.
      1. Add what you feel is a good infrastructure to the project. It isn't that his code is bad, but we now have a newer way to do this, so it more manageable.
      2. Look for what is good. Even in bad code there is often a lot of good parts to it. Take advantage of it, and be sure to keep it.
      3. Document your changes, and explain them.

      The guy is well respected in the organization, that is fine, you should respect him too. Being that you have been hired to maintain his code, means he doesn't want or cannot be bothered with it any more. That said, it is your baby now and you will need to raise it your way.

      --
      If something is so important that you feel the need to post it on the internet... It probably isn't that important.
    4. Re:Enjoy your Death March by nosfucious · · Score: 4, Insightful

      Success is not defeating the trap, it's getting the cheese.

      No cheese, ergo, no success.

      Go read some Machiavelli.

      --
      Q:I was listening to a CD in Grip and it sounded horrible! What's up? A:Perhaps you are listening to country music
    5. Re:Enjoy your Death March by sunderland56 · · Score: 4, Insightful

      Summary of your story: Do your best, and you'll get screwed over by politics anyway.

      To the original question: If you rewrite the code and make it a huge success, the original author will get all the credit. If you fail because the code is a stinking pile of crap, you'll be blamed, not him. Welcome to the corporate world.

    6. Re:Enjoy your Death March by Hognoxious · · Score: 4, Interesting

      The poster is judging the person by his code.

      No shit. The person is employed as a coder. Would you judge a surgeon by his poetry?

      We all write code, and in a few years we look back and go, what the heck was I thinking.

      We might do that in the first year of our career, or maybe six months into a new language, platform or type of app. If you're doing it regularly at a later stage you're an utter flid and should go and do something else.

      The guy is well respected in the organization, that is fine, you should respect him too.

      I should respect someone because he knows the right butts to kiss? Don't think so. I've cleared up a fair few messes made by "well respected" people, and part of that process was resetting their reputations to something more aligned with reality.

      --
      Confucius say, "Find worm in apple - bad. Find half a worm - worse."
  2. Short answer: Run. by korbulon · · Score: 4, Funny

    Long answer: Run real fast.

    1. Re:Short answer: Run. by TWiTfan · · Score: 4, Insightful

      It's going to feel a lot less right when the project collapses and everyone points the finger at the fall-guy contractor.

      --
      The cow says "Moo." The dog says "Woof." The Timothy says "Thanks, valued customer. We appreciate your input."
    2. Re:Short answer: Run. by Anonymous Coward · · Score: 5, Insightful

      If you're not going to wimp out and run, then man up, confront the situation, and fix it. Regardless of whether the original author is well-respected, you need to expose the problem. You don't have to be an ass about it, just go to the original author and ask him why its in the state that it is, more often than not he was under deadline to get it finished and cut corners. Worst case scenario, he thinks he's a rock star and can't believe they hired a dunce (you) to replace a genius (him). Or just tell your boss that the existing state of the code is hindering progress and things need to change, don't even mention the original author. Figure out what you have, what it needs to be, and plot a course to make he necessary changes to get it there. Inflate estimates to adjust for the added complexity and if anyone questions your estimates, tell them exactly why it will take you that long (which may include "I haven't touched that code yet and am not familiar with the potential side-effects" or "the architecture is so fubar'd that I'm going to have to refactor").

      But whatever you do, absolutely *do not* bitch and whine about it. No one likes a whiner and it will just make you look like an amateur. Always remember, the problems of writing and maintaining software are hard and not always technical, you're paid to solve them. There are already too many amateurs making good money to create more problems than they solve, don't be one of them. And always remember that no matter how smarter you are than everyone that came before you, cleaning up their shit is ultimately your job. Deal with it.

    3. Re:Short answer: Run. by TWX · · Score: 4, Insightful

      And worse, that could directly impact the contractor's future work prospects, if they cite how bad a job the contractor has done, even though it wasn't his fault in the first place.

      You don't work for that company directly. Your decline to take on their project will probably have more positive effect for that company, in the long run, than your attempting to salvage it and shooting your foot off. They'll be forced to either make the existing employee work on it or will be forced to scrap it and ask hard questions of the existing employee in the process.

      --
      Do not look into laser with remaining eye.
    4. Re:Short answer: Run. by Anonymous Coward · · Score: 5, Informative

      I think this is good advice, and having been on the other side of this issue, I think it's important to note the worst case scenario may not always occur here. I had to write an incredibly large application on an absolutely impossible deadline, in a programming language I wasn't incredibly comfortable with using, and there weren't any "objections" allowed, given the setting. I was young, I wrote it, and accepted what I was doing was crap, but I had to cut every corner imaginable just to get it done. Fast forward ten years, the company wants to sell the application to others, because, while it's poorly done (IMO), it does everything desired and people are still looking for that type of software in our industry. Someone else was hired to review/rewrite/refactor. The guy who was hired eventually came to me expecting he was going to be the fall guy (hell, he may even have posted here), and when he brought his (incredibly well done) analysis of what was wrong, I told him he was absolutely right, he shouldn't be afraid to say it openly, and I'd be happy to help him understand the "guts" of what was trying to be accomplished.

      Long story short, while I guess in most times it really is a political slugfest about to happen, sometimes it's that the person who did the application, rock star or not, was put in an untenable situation and did the best they could with it and is well aware it is garbage, spaghetti code that went through 100+ changes of scope due to poor project managers. It doesn't mean that person necessarily is going to hate you for it.

    5. Re:Short answer: Run. by MouseTheLuckyDog · · Score: 4, Insightful

      Rather then going and asking the original developer why it sucks, explain to the developer that you have been assigned his project.
      If he is a "rockstar " then he will lord it over you and you know to run.
      If he knows that it sucks and tells you, then you likely have an ally in your quest to fix the app.

    6. Re:Short answer: Run. by Jane+Q.+Public · · Score: 4, Interesting

      I was in this boat a couple of years ago.

      I was given a project that three (!!!) previous developers had worked on, but obviously none of them finished.

      The code mostly looked okay. And it passed all the tests.

      But that was misleading. The way the code was written, it was hard to read. AND it had sloppy formatting. Those are not necessarily signs of bad code, but they can be bad omens. I should have heeded them.

      Turned out the tests were poorly written. And whenever I made even little changes, things broke all over. To top it off, rather than giving me time to refactor the old code, they kept me too busy making trivial visual changes.

      THEN, the kicker: they suddenly hit me with a deadline of 3 days! I could hardly believe it. Even though with a lot of effort I had finally gotten it basically working, it was nowhere near ready for production. I told them this; they didn't listen.

      So of course when it wasn't ready by the deadline, they blamed me. Which is just plain dumb. I didn't really care at that point... I was a contractor and I had seen what a rotten place it was to work. I was happy to bow out. Which I later found out was the same attitude as the three developers before me. They were happy to be out of there.

    7. Re:Short answer: Run. by Immerman · · Score: 4, Insightful

      The plutocratic collective thanks you for your amoral work ethic. Without the assistance of those such as yourself it could not grow and prosper.

      --
      --- Most topics have many sides worth arguing, allow me to take one opposite you.
  3. You were not hired to finish the project by EmagGeek · · Score: 5, Informative

    You were hired to be the scapegoat.

    1. Re:You were not hired to finish the project by TWiTfan · · Score: 4, Insightful

      If he makes it work, the original "respected" designer will jump in and claim all the credit.

      If he doesn't, he, as the scapegoat contractor, will get all the blame.

      No-win situation. Leave now.

      --
      The cow says "Moo." The dog says "Woof." The Timothy says "Thanks, valued customer. We appreciate your input."
  4. apologies to rumsfeld by Anonymous Coward · · Score: 5, Insightful

    document whats broken (known known), request budget to fix
    document what isn't broken, but could break (known unknown), request budget to maintain
    request budget to address change requests (known unknowns)
    request agreement to address incidents (unknown unknowns)

  5. Write tests. Write more tests. by Anonymous Coward · · Score: 5, Insightful

    You're very lucky: The person who created the project is with the company.

    Question him/her!

    Get an outline of how the project is supposed to work. Get broad ideas about each class, and the key functions in each class.

    Then, write tests. Write more tests. Write even more tests.

    In other words, you need to make sure that there's a second layer that 'knows' what the code is supposed to do and can ensure that it's still doing that.

    Only after you have the tests complete should you move to fixing bugs or adding features.

  6. Make a real assesment by gearloos · · Score: 5, Insightful

    First thing to do is complete a real analysis of the code and report to management with an estimate to re-write complete sections of the code. Go into it realistically and tell them up front what it will take to correct things, and why. I have been in this situation several times in my career and that has always been the best approach. There is no need to "knock" the other guys code (be positive, never the mudslinger) and done correctly, would look more like you have some fresh ideas that may not have been designed into it originally. Eother way, management wants to know what to expect and having realistic expectations as soon as possible will save everyones face in the loing term. If they feel your out of line, well, then it's time to look at all those other jobs your contemplating.

    --
    "Computers are a lot like Air Conditioners" "They both work great until you start opening Windows"
  7. Suck it up by CokoBWare · · Score: 4, Informative

    It's a sad thing. When someone who is well respected basically gave birth to a turd, and you need to clean it up, this is not ideal, but definitely the nature of the business... the business will become acutely aware of how crappy this app is in short order without your input.

    Advice: keep your nose clean. Don't complain about this person's code, but explain how the condition of the code will cost your time and energy to fix the problems as you dial in new changes. When they question you on it, tactfully explain that design decisions in the app are not entirely flexible, and changes may cascade into other areas that need to be fixed.

  8. If the "well respected guy" is still there by MillerHighLife21 · · Score: 5, Informative

    Talk to him. Plainly, just explain the issues you're having and what you're trying to get done to go over it with him. Ideally, get it in email form.

    One of two things are possible here. He either did a quick "get it done" job to just get it over with really fast and move on...OR he potentially just has it setup using an approach you aren't familiar with. Even explain the issues to your boss if need be so that your boss can help to get you some of his time to go over this stuff.

    There is good code and bad code...but there's also "different" code. I've seen many a developer absolutely lose their minds because something wasn't done the way they wanted it to be done even though it was a perfectly valid approach. That might not be the case in this situation, but as developers we can get a little set in our ways and a little OCD sometimes.

    Keeping "respected guy" at a distance isn't going to help anybody. Absolute worst case, explain to your boss that in order to avoid breaking anything else you need him to at the very least, document how he did things. More than likely you'll ask respected guy for help and he'll have a look and either explain things or apologize. If things are tied together enough that when you change one thing, something else breaks then they are probably tied together for a reason. It would be odd for them not to be.

    --
    "Don't teach a man to fish, feed yourself. He's a grown man. Fishing's not that hard." - Ron Swanson
    1. Re:If the "well respected guy" is still there by Dan+East · · Score: 4, Insightful

      Further, if it's case 1 (a quick "get it done" job to just get it over with really fast and move on), then you need to take the proper tone to set up an environment for you to complete the task you were brought in to do. What I'm talking about is portray the software in a positive light - that it is efficient, single-purpose, quickly developed, etc. However, for those reasons it isn't very extensible, and you're going to need to lay some groundwork and framework to facilitate the enhancements they require. What I'm presuming you're lamenting is you don't have the time or bid too low for the amount of work required. You need to communicate to them that you will have to reorganize a significant amount of the existing code in the process. Be sure and state the advantages (IE what they're getting for their extra money), which will be streamlined future enhancements, and importantly, more efficient maintenance of the software from here on out.

      I've been in this situation a number of times, and every time the higher-ups had an appreciation for the extra work required to lay a good groundwork and I was able to proceed in the manner I recommended even if it took more time. Another way to explain it to a non-technical person is that software is often built very incrementally and piecemeal, and that can result in a hodgepodge of code over the years, and every now and then it requires a good reorganization and consolidation of redundant parts into reusable libraries. Usually they understand that general concept, because it's true of most physical, real-world assets as well.

      --
      Better known as 318230.
  9. Nice cloak post by andyring · · Score: 5, Funny

    It seems the OP is actually asking about the ObamaCare web site.

  10. All Programs Are Like That by Greyfox · · Score: 5, Insightful
    In 20+ years in the industry I haven't seen a single well-designed piece of code. The problems are twofold; the project itself most likely evolved out of a need. Frequently they start out small in scope, perform tasks that nothing else does better than anything else the company had, and grew out of necessity. They weren't so much designed as taped together based on needs that were not clearly enumerated and are poorly documented if they're documented at all. Second, you probably don't understand the business process at the company. I've found it generally takes about a year to really start to understand the processes behind the code. Until then things that look like side effects or bugs probably have a very good reason. One you won't discover until you "fix" them.

    The new programmer, in this situation, may very well be seized by the impulse to throw that old turd out and rewrite it, but a turd in the hand is worth two in the bush. Replacing the application wholesale usually leads to an expensive boondoggle that has all the bugs that the old program has already fixed and delivers a fraction of the original functionality. You hear stories about this all the time.

    That doesn't mean you can't improve the design as you're adding new features or fixing bugs. Especially once you start to understand how the program works. You can isolate it into a test environment (because most of the time they're just building and deploying directly to production,) push the thing up to a version control server if they don't already do that, improve the build and deploy process and improve the design of the code in ever increasing scope until that turd has a really nice polish on it.

    Or, you know, not. It's really up to you.

    --

    I'm trying to teach myself to set people on fire with my mind... Is it hot in here?

  11. I know which broken project we are talking about.. by recoiledsnake · · Score: 5, Informative
    --
    This space for rent.
  12. find out why you were hired by v1 · · Score: 4, Insightful

    I think that's the first thing you need to do before deciding how to react.

    Did the author decide he'd created an unmanageable hack and push management to pull in a contractor to either clean up the project or simply suffer through trying to maintain it, so he could get back to focusing on his other work?

    Did management rush the author to get something "usable" out the door so they could put him on another project, and you're just the mop-up crew?

    It's very likely one of those two things. You could respond to either of them by simply "run, forrest, run!", or you could roll up your sleeves and get to work. If you choose to take it on, your approach will depend on why you are there. First off, trashing on the author won't get you anywhere with anyone, don't even consider it. The author may realize he made a mess, management may not. But right now the author is your best ally. Don't burn that bridge by running to management and telling them the reason it's going to be expensive to fix is because the author created a mess.

    That being said, document everything, in case it comes back to bite you. You don't need to share that documentation with anyone unless necessary. It's your safety net in case the excrement strikes the oscillating unit and the author tries to blame the problems on you.

    Have a private chat with the author and find out which of the two above is the reason you're there. You'll notice that in either case, he's probably very happy to have you taking over, and you should be able to easily leverage that to get his cooperation. That will make your job monumentally easier. Projects by good authors that get into this state are usually the result of inadequate planning, or a late change in requirements. The author probably had a fairly-well fleshed out plan that went south at some point, and that plan is probably not very clear to you right now. Ask about that plan, find out where the code was meant to go, why it didn't end up going there, and mosts importantly what problems did that create and how did he work around them. Those work-arounds are what's causing your grief. Knowing what they are is half the battle (that's why stuff broke when you edited), knowing why they were necessary is the other half. (THAT'S why other unrelated stuff started breaking) Get this information from the author.

    At that point, you can take a very well-informed look at the project and decide if it's worth your hassle to take on. Then either take it or leave it. If you decide to bail, you can look back on your documentation and decide how much of that is necessary to justify your decision and get some compensation for your trouble. If you do decide to take on the project, discuss the issue again with the author and get their input on how to explain the maintenance costs. Even if it has to come down to "this is going to be expensive because Bob created a mess", giving him a chance to have some input on how this is addressed will help keep him in your corner down the road. If he's anywhere near reasonable, he'll understand that he's going to have to accept some of the responsibility for what he started.

    --
    I work for the Department of Redundancy Department.
  13. Also.... Re:Make a real assesment by Fubari · · Score: 5, Insightful

    Excellent points r.e. "real assessment"

    Also, things to consider: without knowing these, all advice offered here is less focused (and hence less useful) than it could be otherwise.
    1) Who are the stakeholder(s)?
    1.B) What is the stakeholders' definition of "success"?
    2) What is your budget - fixed bid, time & material? (if the later, do you have a max budget or is it open ended)
    3) What is an ideal outcome for you personally?
    4) What is the least-sucky outcome for you personally that you would accept?

    Some general advice (this applies to the excellent "real assessment" mentioned above): Whatever bad news you have for your client, the SOONER you deliver it the BETTER OFF everyone will be, including yourself. If you go heads-down a pile of crap code for 6 months and end up stuck and unable to deliver anything useful enough and timely enough to satisfy the stakeholders then things will NOT end well for you.
    Also... what you think may be "bad news" may be something the client is aware of and fully expects, so don't sweat it too much. Talk to them and do some brainstorming about how to rearrange things to make success possible.

  14. This is why poeple call their jobs "work" by Glires · · Score: 5, Insightful

    Your description sounds exactly like the only thing that I've ever been paid to do in my entire career. My job is to fix broken things and make them work. It sounds like that's your job, too. If everything were working perfectly, they wouldn't have needed to hire you in the first place. If fixing the project is beyond your skill, then perhaps moving on to a different employer is a good idea.

    --
    -Glires