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?"

68 of 308 comments (clear)

  1. Enjoy your Death March by pegr · · Score: 5, Informative
    1. Re:Enjoy your Death March by Agares · · Score: 2

      I wish I had points to mod you up. I have seen this way to often.

    2. 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
    3. 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?

    4. Re:Enjoy your Death March by Anonymous Coward · · Score: 2

      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?

      He eventually got his red Swingline stapler back. Isn't that enough for anyone?

    5. Re:Enjoy your Death March by Gr8Apes · · Score: 2

      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.

      He knows he got screwed in his case, as politics were more important in his company. I can relate to his position, and am sorry to say that I have yet to see a company that doesn't have politics play an important role. You must be willing to play politics in addition to being productive, or you will get used and tossed.

      --
      The cesspool just got a check and balance.
    6. 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.
    7. 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
    8. 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.

    9. Re:Enjoy your Death March by mwehle · · Score: 2

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

      No cheese, ergo, no success.

      Exactly. Like other engineers too often I find myself focused on fixing code which sometimes can't be fixed in the allotted time, or trying to explain to management why the thing is broken. Success may involve "managing up" and diplomatically extricating yourself from blame for the situation, more than finding a way to make the project work.

      --
      Wir sind geboren, um frei zu sein - Rio Reiser
    10. Re:Enjoy your Death March by complete+loony · · Score: 2

      1. Start writing new automated tests for the existing features of the application.

      2. Run them against the original, unmodified code.

      3. When your changes break the tests, work out what *you* did wrong, before you commit your changes.

      How can you get anything done if you don't find out quickly that you broke something?

      --
      09F91102 no, 455FE104 nope, F190A1E8 uh-uh, 7A5F8A09 that's not it, C87294CE no. Ah! 452F6E403CDF10714E41DFAA257D313F.
    11. 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."
    12. Re:Enjoy your Death March by Xest · · Score: 2

      Depends if you just sit their quietly.

      Personally I grew tired of doing that and nowadays I'm just blunt to management. If something is shit, I tell them it's shit, and I use the word shit. If they don't like that I can go work elsewhere where they actually want to know if something is shit so they can act on it. Nine times out of ten though, they are okay with being told the cold hard truth, providing you can justify your reasoning as to why you think it's shit and offer them a solution as to what needs to be done.

      On projects where I've been in this exact situation I've pointed out that I've taken over for example, in one case, a project that was missing enough features to be 3 months behind schedule and still managed to deliver on time. I showed the directors what was missing even though the previous owner had said it was complete to that milestone and they accepted that I was right. Then when I got it all sorted, fixed the project up including all the missing components and delivered on time I got praised for delivering on time and was given max bonus.

      It's only an issue if you keep quiet about it or aren't blunt. It's easy to think someone is respected but you'd be surprised, there will be people with their suspicions that something isn't right and when you bring that to the forefront they'll be happy to have their suspicions confirmed, and the golden boy can rapidly become a pariah if he's 100% talk, 0% walk and you can prove that.

      Highlighting incompetence and time wasters in a convincing manner is in itself a skill that is particularly prominent for contractors to learn. You just need to provide evidence and a persuasive argument as to why something is wrong/bad.

      Of course, a lot of people think something is bad just because they don't have the pre-requisite knowledge to understand what they're doing or why something is the way it is. I'm not saying this is the case here, but when that happens people seem surprised that it blows up in their face when they make a fuss and fail to justify themselves because they're wrong. You have to be pretty fucking sure you're right that it is crap, and that you're not just out of your depth with the project you've been handed.

  2. Short answer: Run. by korbulon · · Score: 4, Funny

    Long answer: Run real fast.

    1. Re:Short answer: Run. by mrchaotica · · Score: 3, Insightful

      Get over it?

      --

      "[Regarding the 'cloud,'] ownership was what made America different than Russia." -- Woz

    2. 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."
    3. Re:Short answer: Run. by korbulon · · Score: 3, Insightful

      He says in the summary that quitting does not "feel right".

      If I conducted my business based on what I deemed to "feel right", I would probably never leave my house.

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

    5. 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.
    6. Re:Short answer: Run. by dreamchaser · · Score: 2

      That plus some advice. Do your due diligence first. Blindly accepting a coding project without at least taking a cursory look at the code isn't very wise.

    7. Re:Short answer: Run. by JoeMerchant · · Score: 2

      Recode from the ground up, congratulate the well respected member of the permanent team on taking the app as far as he did - explain the time required to add the requested functionality - if they don't like your time estimates, find another job.

      If you add your signature to the broken code, the steaming pile becomes your legacy, not his.

      If you provide a good replacement without trumpeting what an incompetent ass the previous author was, nobody is really going to know or care that you ditched all his code and replaced it.

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

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

    10. Re:Short answer: Run. by smpoole7 · · Score: 2

      > that could directly impact the contractor's future work prospects, if they cite how bad a job the contractor has done

      They're going to do that anyway, whether he stays to completion/collapse, or quits now.

      I say quit now, find something else right away and let it blow over. It may not seem like it right now, but it WILL eventually blow over. Get another successful project or two under your belt and the one bad project won't glare too badly on the resume.

      --
      Cogito, igitur comedam pizza.
    11. 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.

    12. 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.
    13. Re:Short answer: Run. by xaxa · · Score: 2

      One of my CS modules in final year was "Software Maintenance". For the coursework, we were given the department's exam results tracking software, which was written in Perl, and asked to plan how we would improve performance and add some new features.

      IIRC, I think my group recommended rewriting it from scratch in either Java or C#, and I think we got full marks...

    14. Re:Short answer: Run. by Jakeula · · Score: 2

      I am in a situation similar to this, but with an organization that is willing to listen. The experience, while equally frustrating on the code end, is much better.

      I maintain a few different code bases for our org. Donor management software, internal apps for job specific duties, and our largest a social-like network built on Drupal. All of these have been touched by at least 3 other developers before arriving in my lap, all of which were contractors. We have so many issues with the Drupal site, its amazing that people visit it everyday without realizing it doesn't work properly. I spend a good amount of time each day chasing tail to ensure that the users don't see there errors. You might say, "well Drupal has plenty of testing options, start there", but most of the modules in play are custom, or community alpha, and have 0 testing built into them. We have far too much AJAX at work that is all poorly written, and they all rely on other AJAX to work properly. I learned this the hard way trying to refactor the code that makes the cookies. The original code created a cookie for your name, another for your the cost of an item in your cart, another for the name, and so on. So I tried to simplify the logic by placing it all in a single cookie, but that somehow impacted our notification system to the point that it completely disappeared from our site, and the emails stopped working. No clue why even to this day.

      So the question became, do I attempt to rebuild this on Drupal but using modules that will work as well as making new ones using the good parts of the previous modules, do I just maintain this code and hope I eventually sort it all out, or do I rebuild the entire site on a more purpose built platform like a more flexible framework? The answer from above was "Yes". meaning I should do all of that at the same time. We are a non-profit so budget is tight, therefore I am the developer and the project manager. They want me to maintain our live code, while building a replacement for it. My time is split, so both projects suffer as a result.

      Where my story differs is that the management are willing to listen that what we are doing is counter productive, and they work hard to reduce my work load. There are still plenty of times where I get tasked with stupid shit like changing a users photo, and it needs to be done right now, but then there are the times when I said a project would take until tuesday, but when its not completed because of all the other things breaking, they listen and we plan a meeting for the next projected completion date.

      So while I would have loved to just drop this entire project (my job would be dropped with it), their willingness to correct their previous mistake of hiring the previous developers and getting stuck on the current system helps me stay motivated to work on both fixing the code, as well as creating something that the entire company will run on. But in the end it could be the fruitless journey that it initially appeared to be, I won't know until I reach the end.

  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 JaredOfEuropa · · Score: 3, Insightful

      Perhaps, and in that case you're damned if you do (stay) and damned if you don't (quit and run). In either case you could be looking at reputation damage.

      It might be worth doing some digging around the company, though. What relation does your boss have with this app and with the previous developer? What is the history of the development of this app? If this is a doomed but high profile app, the scapegoat theory would seem to hold. But if your boss wants the app to succeed and has no reason to be afraid to potentially piss of this darling developer, then it's worth talking to him, especially if he knows a bit about software development. Explain the problem and provide estimates on what it takes to turn this thing around. That's what I would expect a contractor to tell me if I hired him with honest intentions.

      --
      If construction was anything like programming, an incorrectly fitted lock would bring down the entire building...
    2. 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."
    3. Re:You were not hired to finish the project by funwithBSD · · Score: 2

      Yes, and present as a "go -no go" choice and let him make the call.

      If he says no go, you can move on with no consequences. If it is "go" and it fails, you documented why it was in trouble and what the risks were.

      --
      Never answer an anonymous letter. - Yogi Berra
    4. Re:You were not hired to finish the project by cusco · · Score: 2

      He's a contractor, why does he care if the original designer gets the credit? If his manager is any good he may already know that this is a steaming pile, if an outside contractor can fix something without pissing off the original designer he's going to be a happy camper. If the contractor can enlist the assistance of the original writer to fix it, giving him an actual reason to claim some of the credit and an incentive to share, then everyone wins.

      --
      "Think about how stupid the average person is. Now, realise that half of them are dumber than that." - George Carlin
    5. Re:You were not hired to finish the project by smpoole7 · · Score: 2

      > Other times you can work like an actual adult and solve the problems

      I don't know the details in this case, and neither do you. But trust me, it ain't always that simple.

      Years ago, back when I was still doing the contract programming gig on the side, I took a job for a major multinational. This was a relatively simple concept: write some software that read the AutoCAD files for the wire numbers, and then print heat-shrink labels to go on the wires. Sounds good, right?

      First strike: it was done in Visual C++ 1.5, 16 bit. That compiler had some marvelous bugs (such as getting the segment and offset REVERSED when it loaded the ES and SI registers, HA HA that one was fun to track down).

      Second strike: my predecessor had used that silly "frame-document-view" model for this relatively simple program (I can't even remember what they call it now). He decided to put everything in the View, so he had globals everywhere. Of course, they were getting clobbered, and of COURSE, I had to find each of these bugs.

      Third: the people with this company had no idea what they wanted it to actually do. They said, "the stuff for the heater wiring starts with 'H," the motor wiring with 'M', and so on ... except for when it doesn't." (That's not a joke.) In other words, the files that I was reading (with a horrible third-party bolt-on DLL, by the way) weren't even guaranteed to be standardized!

      I left this project and moved on to more pleasant things. That cured me. I went back into radio engineering, even though (with no false modesty) I was actually a very good programmer.

      OH, and did I mention that this was using Visual C++ 1.5? Make sure you don't miss that. :)

      --
      Cogito, igitur comedam pizza.
    6. Re:You were not hired to finish the project by Jane+Q.+Public · · Score: 3, Insightful

      I second smpoole7. As a contractor, you can't fix bad management. No matter how "professionally" you try, you're going to get blamed.

      On lesson I have learned the hard way: if you insist on tackling it anyway, keep records of EVERYTHING. All emails, all memos. Even record conversations if you are where/when you can get away with it, and if you aren't in a position to do that, take good dated notes. Then when all is said and done if they try to blame you, you can prove it wasn't your fault.

      I have worked as a contractor for some very bad managers. Of course I did not know that going in. But later when they tried to blame me for problems I could point to an email, or a Skype conversation I had saved, and say "Uh... just no. That's not what really happened. See?"

      And it really pisses them off when you do it in front of other people. But you might as well, because they're trying to shaft you anyway, right?

    7. Re:You were not hired to finish the project by pspahn · · Score: 2

      My advice: act like a grown-up. They're paying you to code new features? Code new features. Paying you to fix bugs? Fix bugs. If you have the time and resources, refactor and fix existing code as you are able.

      This is the only response you need. Like I once told a previous employer when I was given a shit project, "Hey, I don't really care what you want me to work on, but I do want you to know that this project is doomed and here's why ... "

      --
      Someone flopped a steamer in the gene pool.
    8. Re:You were not hired to finish the project by west · · Score: 2

      > He's a contractor, why does he care if the original designer gets the credit?

      Bingo. I generally do my best to make certain that the permanent workers get credit where it's possible to do so. If there's a permanent worker who is completely incompetent, then I'll simply refrain from praising them to management. Praise is not a zero sum game, bosses are not usually idiots, and a cordial work environment where people are happy to see and help each other is worth its weight in gold.

      It's simply self-interest to endeavor to make everybody look good, and permanent co-workers will return the favor when the next job is available.

  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. Cover your ass and vote for a IT union by Joe_Dragon · · Score: 2

    now as a contractor it's easy for them to drop the blame on you even when it's some PHB who let things get to the point that they are at.

    Maybe even call your staffing agency and tell them what is up before you get a black mark

  6. The fault by glennrrr · · Score: 2

    The fault, dear Brutus, is not in our stars, but in ourselves.

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

    1. Re:Write tests. Write more tests. by digsbo · · Score: 3, Informative

      Too bad the poster here was AC and didn't get modded up, because he is absolutely, positively right. All the people here who talk about code analysis, etc., are completely missing the point. Simply ask, publicly, for the test cases showing a positive path, and the test results. If they can't be provided, go back to management with the statement, "I don't understand why, but I'm not getting the same results as the previous engineering team did. Before I add any features or fix any bugs, we need to baseline what works and what doesn't.

      I inherited a project like this in exactly the same circumstances. It was a dangerous time for me at the company, and the previous engineering lead did make some questionable accusations, but by keeping it non-confrontational he basically ignored me and went back to what he was doing. Management eventually saw that I was dedicated to getting things working so long as they let me do what needed to be done, out of their own self-interest.

      I give a lot of credit to my product manager, who helped me navigate the political waters on that one (which included being called an incompetent liar to my face by the previous engineering lead). It worked out great for me in the long run.

  8. 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"
    1. Re:Make a real assesment by phmadore · · Score: 2

      Why you mods harsh on this guy? Can't see how this got -1.

    2. Re:Make a real assesment by mknewman · · Score: 3, Informative

      I agree with this assessment. Be honest. If management doesn't believe you, quit and go somewhere else. Usually when you try to quit they will freak out and realize you were serious and try to keep you, on your terms.

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

    1. Re:Suck it up by gstoddart · · Score: 2

      You know, I question if that's the case.

      I've seen several instances where someone throws together a proof-of-concept and then says "see, solved problem, the rest is an exercise for the reader". In fact, I once got something thrown at me by a VP who had knocked something together with some cheap hacks, string and tin-foil. In practice, what he'd done worked on a single demo system but couldn't remotely be made to work in a real system.

      Then you get into the problem and discover that so many naive assumptions have been made that it's not really possible to do it as envisioned. Essentially whoever did it ignored all of the real considerations as not important, and then just punts it to someone else to discover all of the underlying flaws.

      So, while it's possible the developer realized it was a turd and wanted to get out from under it -- it's also possible it was seen as well-defined enough to be an app for a contract coder to finalize.

      We once had a developer who could crank out reams of unintelligible, un-maintainable code as a demo/customization for a customer ... but which was brittle, sketchy, and completely not robust. Someone then asked that it be turned into a general solution, only to discover that it barely handled the specific solution because it made unsupportable assumptions, and completely neglected all of the other issues you needed to consider.

      Never underestimate how much trouble can be caused by someone who merely believes they've come up with something brilliant, but which on closer inspection is blatantly garbage.

      --
      Lost at C:>. Found at C.
  10. 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.
    2. Re:If the "well respected guy" is still there by swillden · · Score: 2

      +1

      The right answer is almost always to communicate and then communicate some more. Use both informal and formal channels, staring with the informal ones so no one is blindsided, but with the formal communication ready to go (so whoever you talk to doesn't have an opportunity to blindside you). In the informal communication, be clear that you are going through formal channels as well, in fact it's probably a good idea to approach the original dev and whoever else is appropriate with something "I have written up this analysis of my findings, but before I submit it I wanted to see if you can help me correct anything I may have misunderstood or if you have any suggestions." That way you're engaging them positively, but setting the expectation that you are going to take it through channels. Be positive and professional, not critical, but be forthright and clear about what you're seeing and your best estimate of what it will take to get to end of job.

      If backstabbing and scapegoating is the nature of the company culture, this communication will end badly. But in that case it's going to end badly regardless, and this way at least anyone who looks honestly at what happened will not think less of you. If there's a modicum of honesty and rationality around, you'll come out fine -- and much better than if you just quietly toil away and then fail. You should probably be able to look around and get a pretty good idea in advance which way this is going to go.

      Also, make sure you have something else lined up.

      --
      Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
  11. Don't take the fall by SirGarlon · · Score: 3, Insightful

    The phrase that comes to mind is "set up for failure." Don't be a fool: they dumped this job on a contractor because they knew the project was doomed from the outset. I've been there.

    Which is worse: to walk off a job when you find out you've been tricked, or to stay on for the death march all the way to failure, and then get fired? (or, in your case, "contract not renewed," which is the same thing.)

    My advice is to get out while you can, and be more circumspect about accepting projects next time.

    If your sense of duty requires, you can discuss with your project manager why the job does not look doable any more, and see if he/she is open to major re-planning. But you should be prepared to quit the job on the spot if that meeting does not go your way.

    --
    [Sir Garlon] is the marvellest knight that is now living, for he destroyeth many good knights, for he goeth invisible.
  12. Like Any Other Project by azadrozny · · Score: 3, Informative

    Not many details to go on here, but I would handle this like any other project. Triage the problems and requirements, then work with the system owner to work them off. Be respectful to the developers who came before you. They may have been handed the same lousy situation, and done their best to work within the boundaries provided. If you are nice, they should be willing to help you understand the history of the app. They may have sacrificed robustness to accommodate some other requirement when they first wrote the system. Since you seem to have other options, then you don't have a lot to loose, and perhaps much to gain if you can bring this system under control.

  13. Step one, do not criticize. Step 2, document. by Stolpskott · · Score: 3, Informative

    As you have said that the person who worked on the project before is well liked and respected within the company, while you are the new guy with no good will or social capital built up in the organisation, the last thing you should be doing is forming any kind of criticism of the code or the person who wrote it.
    However, if the project is truly "Broken", then the person who worked on it before will not be the untouchable God type. He may be the asshole programmer from Hell who purposefully wrote code that could not be maintained by anyone else, in which case you are his patsy and you are probably on a losing bet, because he is just waiting in the wings to swoop in, pull an all-nighter bashing away at the keyboard to rescue the company from the incompetence of the new guy, all for a measly 50% pay rise... I have seen it happen to a few contractors and it is not pretty.

    The "obvious" solution, of course, is to quit and find another gig. However, the next place (or the one after that) will probably have a similar scenario, so the best approach would be to start learning to tackle the problem on this project.

    That means that step 1 is to look at where YOU went wrong. By that, I mean that either your initial code analysis was incomplete (you did not check out the code before taking the assignment, or maybe you had no opportunity to check it out), or you started coding before understanding the existing structure (or lack of). Yes, you are under pressure to add value, contribute, justify your existence, and so on... but that will be doubly true next month. If you cannot make the argument in the first week/month that you need to review the existing code before making changes and adding features, then you are not going to be able to make that argument at any point. It takes a particular kind of coder to write updates to existing code without first understanding what the existing stuff does, and that type is rare, especially when dealing with an un-maintainable bird's nest of code.

    If the code is already documented, verify that the documentation is accurate. If it is not already documented, then document it. The code may need to be re-factored before you can make any meaningful contribution, but right at the beginning of the project is the only possible window you will have for that kind of analysis.

    If your response at this point is "I do not have time to document the code", then my advice would be to leave with your sanity and most of your reputation intact. You have already seen that coding hot, without any insight into what you are working with, causes unexpected and unexplained problems.

  14. Nice cloak post by andyring · · Score: 5, Funny

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

  15. 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?

  16. I know which broken project we are talking about.. by recoiledsnake · · Score: 5, Informative
    --
    This space for rent.
  17. Car maintenance price list: by Ihlosi · · Score: 3, Insightful
    Fixing your car: $40/hr
    You want to watch? $50/hr
    You want to help? $80/hr
    You tried fixing it first? $150/hr

    I hope you realized which kind of software work this was going to be and priced it accordingly.

    1. Re:Car maintenance price list: by Anonymous Coward · · Score: 2, Funny

      You want status reports? $200/hr
      You want to ask questions? $300/hr
      You want detailed discussions? $500/hr
      You want to be treated like a human being? $800/hr

  18. Been on that contract by Oligonicella · · Score: 2

    Got a contract a STL phone companyl to examine a system with much the same setup; a billing system purposely avoiding all standards (naming constants "Literal-R" because literals weren't acceptable), no performs, only jumps (not spaghetti, Ramen), etc. I decrypted it's function and what it was supposed to do as well as what it did, wrote a very detailed report on what was wrong and why it was so and turned it in. I spent the last four months of the contract sitting and studying pretty much what I wanted because Mr Silver was a golden, do not touch, boy. Meh, paid very well.

  19. 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.
  20. 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.

  21. 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
  22. Instrument the code by rover42 · · Score: 2

    As others have suggested, talk to the original developer, document the problems and keep your boss informed. If you are a contractor being supplied by one firm to another, keep the appropriate people at both companies informed. Also, look for ways to measure the problems. First, can you run the code through lint(1) or crank the compiler options up to reveal problems? Then can you add runtime error checking or data validation code? This may help you fix things and/or be useful as documentation. Once, when working as a tech writer, I wrote a half a dozen little scripts to inspect 600,000 lines of C from a dozen programmers. Hmmm. Less than 5% of switch() statements had a default: case for error-checking. Less than 20 uses of the assert() macro in the whole code base. And so on. The programmers mostly came from a Pascal-like environment so almost none were using C idioms like if( (p = fopen(...)) == NULL) for error checking. That is OK but I found dozens of cases where they were allocating memory, starting processes or opening files, sockets or pipes with no error checking at all.

  23. All Projects are Broken by some Degree by prefec2 · · Score: 2

    First, determine what is wrong with the project.
    Second, check how much time you have.
    Third, determine different solution scenarios.
    Fourth, discuss your findings with the "customer" or the person who gave the project to you.
    Fifth, agree on a solution. Be clear that this is not a wishes come true situation.
    Sixth, proceed with the agreed plan.

    General rule: Document everything.

  24. Whos fault is this really? by WaffleMonster · · Score: 2

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

    When an app breaks because you fucked with it does all or even most of the blame for this rest on your predecessors shoulders?

    I've seen this show many times before.. I would say it is a crapshoot as to who (old guy or new guy) was actually incompetent...usually some combination of both. A good simple *proxy* for reasoning about this is does the code handle all possible failure modes it is responsible? If shit just crashes or goes bonkers when it runs out of 'x' then you can normally expect that developer to be careless, lazy and incompetent this will manifest in all other aspects of system quality.

    Otherwise it is very difficult to make any kind of determination without becoming intimately involved with the system. Sometimes you as developer just have to be more careful and suck it up as the problem space itself could be pretty gnarly to begin with and you as a nub may lack certain domain knowledge / experience.

    To summarize if someone comes to me and tells me 'x' is shit and needs to be rewritten you should expect to come fully prepared to back up your claims. Introspection required.

  25. Why is everyone assuming the he is competent? by waldozer · · Score: 2

    Why does everyone take his side? He is the one that added a feature and broke it. Sound like he added a feature without discussing with the original developer? When he says "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" sounds like he was the person that hacked the code and not the original person.

  26. Take Control of the Situation by DudeFromMars · · Score: 2

    If you do not document your assessment of the code, then all the problems and cost "overruns" are going to be your fault.

    You will be able to "blame the other guy" for the first handful of bugs.
    After a very short period, all the bugs are your fault.

    You have to be nice, but firm in your assessment of the situation.
    Your boss(es) will try very hard to make you accept the project and commit to adding features fast and cheap.
    If you accept that assignment on their terms, you are doomed.
    If they accept your assessment and your terms (rewrite all or part) then you succeed.

  27. Notes from the trenches.... by erp_consultant · · Score: 2

    Anyone that does programming long enough will find themselves in this situation. The trick is how to get out of it (relatively) unscathed. If you decide you're going to run from it then do it now...not next week...now. If you're going to stick it out then roll up your sleeves and get to it.

    One of the things I discovered in these types of situations is that, often, bad code is the result of bad decisions not bad programmers. So keep that in mind before you start bashing the previous programmer. Do an honest assessment of where the code is now and what it will take to get it right. Document it and bring it to your manager with a plan on how you're going to fix it and how long it will take. If your manager refuses to go along with your estimates then the time to bail is now. You know where the problem lies and if you stick around you will be the scapegoat.

    If, on the other hand, your manager understands the situation and goes along with it then you have won the first battle. Make sure and build in some generous time estimates. After all, you didn't build it so you very well might encounter unforeseen issues along the way. The key thing is that once you have made a commitment to a timeline make sure you can deliver on it. Trust me, management will hold you to it.

    Set some milestones along the way where you can measure progress. If there is any slippage your manager will want to know sooner than later. Sooner means you have time to come up with a contingency plan. Later means you're screwed. Send regular status reports to your manager and other key people on the project. It keeps them in the loop and it covers your ass.

    Conduct some conference room pilots along the way. It gives them a chance to see what you have done and, importantly, it shows progress. As a contractor it is vital that you show progress each and every week. The moment that management senses that you are spinning your wheels your ass is grass and they will bring someone else in.

    One last thing - and I can't stress this enough - document, document, document. Keep all your emails, conversations, memos. If there is a change in scope then get it in writing. If that change is going to impact your timeline then tell them - in writing.

    If you do all that you should be fine. All you can do is your best. Not every project is going to succeed. Work hard, be professional and you'll be ok in the end.