Home AMX User Forum AMX General Discussion

When is "enough" enough?

I just got back from doing some fixes on a job I did about a year and a half ago. I'm not proud of the job, but it is our biggest to date. Bugs keep popping up, and it's not very solid. But it works decently. I did the job with only a year's true work experience and to say I was still a rookie would be accurate. The job consists of 18 touch panels in a residential setting (4 x 8400, 2 x CV12, 7 x CV7, and 5 x four inch panels.) There are several panels that are literally no more than 20 feet from eachother, so there is a lot of tracking that is needed.

To do this type of tracking, and management after a year's experience was difficult and I'm not entirely sure I actually grasped it at the time. I did however have some outside help which eased the pain. I have had to go back to the job numerous times and even still after a year and a half, I am still going back to fix things. The client is perhaps the best I've ever worked with. He knows what he wants, and has been very greatful and patient with my work. However, I think that even the most patient person loses their patience and I'm not really sure how much more my boss, the client or I can take.

At what point do you say enough is enough and re-write the entire thing? I look back at the code and it makes me cringe, and I dread having to work on it. Many of the things we have worked on lately is a direct result of doing this particular job. There is so much more we can offer him now, but the main problems of having to rewrite it is: 1) the time it would take to check out the system, and 2) the time it would take to rewrite it. Obviously, none of this time would be billable, which most of the time I spend over there fixing stupid problems is not billed. Thirdly, we're so busy that I don't have a lot of time to do it.

So - my question is when do you bite the bullet and rewrite it? And also how do you convince your boss to allow you to rewrite it? Sure, I could rewrite on my own time. But checking it out on my own time would be questionable. So - ideas? Thoughts? Anyone?

Comments

  • TurnipTruckTurnipTruck Posts: 1,485
    I re-wrote most of what I did in my first two years of Netlinx programming. After those two years, I've seemed to really get my groove on and the style and methods I'm using now have been quite solid for the last few years.

    I would say that a re-write is in order if you find the system shooting itself in the foot due to overly complex routines or you lack the ability to add functionality without substantial re-coding. Some of my first few programs make me want to either shrivel up or vomit depending on the mood of the particular day that I think about them. I have re-wrote most of those early dogs when time allowed and incorporated all I have learned since.

    You mentioned a residential project with lots of panels. I'm assuming that it's a one-master system. I may be flamed, but I find panel tracking, even in a system with this may panels, to be overrated. The vast majority of master-to-panel events can be sent to a device array of all of the panels without major complication even if some panels are off-line. Just be sure that online events update individual panels with anything that may have changed while the panels were napping.
  • GSLogicGSLogic Posts: 562
    I've rewritten code just because there wasn't anything good on TV. It's good to hear you're thinking about it, as it seems there are fewer people with real pride in their work. It's all about money and getting the job done quick.
    If you got the time I say do it over, it will only help your programming skills and it seems to always come back to help you.
  • viningvining Posts: 4,368
    It's a nice idea but do you really have the time it would take? If I built a house five years ago and in the years following I learned new techniques and started using better materials I would even think about going back and rebuilding the house for free so you shouldn't really think about rebuilding the program either.

    You did the best you could at the time and that's the best that any of us can do. You don't owe them a thing but that's not to say if you have new and improved modules that were develope afterwards during other projects that could easily be inserted into that program when onsite for maintenance or remotely then by all means spend a little extra time on your dime or the boss's to make some improvements. It's good for business to have the best system available up and running for them to show off to their friends. Just don't go out of your way and take quality away from the current projects.

    Suggest a tune up with added features at a compromised fee so every one makes out. You and your employer don't lose money and the customer doesn't really pay twice.
  • TurnipTruckTurnipTruck Posts: 1,485
    vining wrote:
    Suggest a tune up with added features at a compromised fee so every one makes out. You and your employer don't lose money and the customer doesn't really pay twice.

    Excellent suggestion. I have several systems that I have added equipment to over time. I take the opportunity to touch-up any old programming while adding the new stuff.
  • jjamesjjames Posts: 2,908
    I see what you're all saying. I have in fact revamped some of the code, but it's almost so horrid that I have to be very careful not to mess anything up further. The way I look at it now is that it was nearly coded in stone. You can barely change anything without having the need to change ten other things. It is not a very forgiving system when making changes (or fixing bugs.)

    As far as not having the time . . . I do have my own time. To be able to sit down adn re-write the code would be a little painful, but not as painful as it is each time I go over there and see all the bugs, then trying to fix them.

    I do take pride in my systems when I can. There have been a few jobs where things went off without a hitch and I have not had to make one revision yet - that makes me happy (as I'm sure it does my boss as well.) This job . . . ugh. I just wish I knew then what I know now. (Some might say that I did, but that I was too bull-headed at the time. ;))
  • NMarkRobertsNMarkRoberts Posts: 455
    Coding time is free, but testing time isn't

    I say go for it. I've done it myself. If your family / job circumstances allow, indulge your pride in your work and go fix it, take all weekend. BUT: coding is only half the job; or a third, or a quarter, depending on the circumstances. What matters most is the client's willingness to cooperate, and to test the result and to report the test results accurately. You will be judged by how many hassles you cause. That's what matters.
  • viningvining Posts: 4,368
    jjames wrote:
    I do have my own time.
    True, but even your own time has value. Of course if rewriting this code could be useful in current & future projects then it's an investment even if only in knowledge gained.
    This job . . . ugh. I just wish I knew then what I know now.
    Unless you stop learning and developing new programs and techniques that's never going to change. Five years from now you'll look back on what you're writing today and think the same thing. So, When is "enough" enough? Who knows!
  • viningvining Posts: 4,368
    NMarkRoberts wrote:
    indulge your pride in your work and go fix it, take all weekend.
    If it were a week end project that's no big deal. I waiste week ends on some of the most stupid coding endeavors and this would be a noble effort. But with 18 panels and god only knows what kind of equipment we're talking about this took take a dedicated month of 80 hour weeks to accomplish. Ok, I may be slower than some of you guys but I've spent that much time on just one module so in reality this could take much more time than that. And as NMarkRoberts mentions the amount of onsite time required to test code etc.

    Now in regard to your own time, I'm sure you already spend a good majority of that on current projects as I think most of us do. So, it's a hard. Ideally, go for it but reality is, can you!
  • DHawthorneDHawthorne Posts: 4,584
    I have a similar situation - large job, and it was started when I was very new at NetLInx programming, There is stuff in there that makes me shudder when I have to re-visit it, and my boos is not about to authorize free program updates; neither does the customer want to pay for it. So I have been, as time permits, updating chunks of the code when I am doing other things on the project. I have the advantage of it being stable as-is, but the customer is constantly adding and changing things. So, I'll make his changes, and fix a block of code or a dodgy routine while I'm at it.
  • jweatherjweather Posts: 320
    I think the "rewrite threshold" is very fuzzy -- sometimes it's clear that rewriting will be faster than troubleshooting, or that rewriting would be such a huge effort that band-aids work better, but most of the time it's pretty fuzzy. Besides coding time, however, another factor to take into consideration is your mental anguish as you work on this beast... if it's causing you undue stress to have to keep patching things, just rewrite the sucker. Customer anguish is another issue... if the customer is getting disgruntled, you're losing a good reference.

    As a pro for rewriting, you should be able to fly through the systems testing if 1) all the devices worked in the old system and 2) you already know how you want to wire the guts of the code (TP tracking, etc.) and have used that method in other systems. Sure, there will be the usual typos and head-desking, but you've got a head start if you're already talking to all your devices successfully.

    Jeremy
  • ericmedleyericmedley Posts: 4,177
    I think your experience has been shared by us all.

    I'm a semi-retired music producer/audio engineer and musicians suffer from the same thing. They hate what they did in the past. As a producer, I've always tried to get the artists out of the mindset that what they are doing is a 'grand work of art' that will be carved in stone. I've tried to steer them in the direction of thinking that what we're recording now is mearly a snapshot of what's going on now.

    If you transfer this idea to programming, you have the total advantage that a program on the same set of gear can be altered without loosing what it fundamentally is. You can just improve how it goes about doing something. Or you can, as you suggest, improve the user's experience by adding functionality. This does amazing things for the long-term relationship of the customer and doesn't really cost you too much.

    I too have older projects that I wonder what was in my tea when I typed. I made my boss understand that the way I operate in general is to slowly improve chunks of code and after testing them on the newer systems, propegate them out to the older systems. I make arrangements to make a 'courtesy' call to the residence and do the upload. I can upload remotely, but I always want to be there to test and make sure it works.

    The clients don't seem to mind and appreciate the attention. Quite often, they'll start chatting and asking for different things and it ends up being a sales call for the designers.

    I'd say try to work it into your routine. We always have some kind of down time when we're waiting 5-10 minutes for something.

    As I said, we all have those skeletons in our closet. You were just brave enough to voice it. :)

    The music producer in me says, "embrace this feeling and grow from it." I'm sure in 2 years we'll look back at the 'improved' code we're writing now and roll our eyes and declare it 'garbage.' Meanwhile the Earth just keeps turning and turning....
  • toddttoddt Posts: 28
    I know for me it is a pride thing. I have rewritten code on my own time. We have had customers that have added equipment and when I look at what I had done 2 or 3 years before, I scrach my head and go what was I thinking. Of course this was all written pre programmer II class and was 1st grader programming.

    To me it was easier to rewrite it and update the flow and stuff then to try and patch work it. Plus I felt better about it also. I want the customer to be happy and a self pride in knowing that they are getting what they paid for. I did the best that I could at the time, but now that I can do better, lets fix it.
  • I'll jump in too. Quite a few of my early projects are "rev2" now. I've done most re-writes with better code I've cut and pasted from newer jobs (we use a pretty consistent equipment library). Mostly, if the client wants to add something, I over-estimate the time allowance by a bit to allow me to re-do what I need to, plus I make sure that the rewrite gives them a couple of new features.

    Do it if it'll stop you shuddering when you see the client's number on your call display. This job is stressful enough from the things you CAN'T control.

    Jeff
  • wcravenelwcravenel Posts: 114
    I also do the re-writes as time permits and without charging. One of the biggest offenders for me was favorites logic.

    Vining's comment cracked me up - I have so many "lost weekends" (some embarassing and some very cool) -- for me to then think some productive clean up is too precious...(especially for a client that put you on the map) -- ROFL.

    Bill
  • funkyskierfunkyskier Posts: 48
    Re-Write It!

    If you have landed other jobs because of the work you initially did, then you can justify the time and expense as advertising. There is no better advertising than a happy customer!! Customers that can afford AMX have friends that can afford AMX. While you are at it, sell the customer some newer interfaces. Let him know you want to take care of him and at the same time do some timely upgrades.
Sign In or Register to comment.