Pray for my soul



  •  how many lines of code in what language are we talking about here?  

     Also, I don't know if it would help, but there are some excel APIs out there.  



  • I feel for you, man. Most programmers would. Yes, the code is bad.

    You have to realise though that you're just ranting here. That's not necessarily a bad thing; people need to let off steam. A lot of shit code in the world exists, it's a fact of life and there's worse stuff than this.

    If you alone own this code then you have the power to change it for the better. If you know you should change it but choose not to then you are turning to the Dark Side. Refactoring is the way forward. You have code that at least mostly works and you can ask it any questions you need. This is a huge advantage. You need to step up to the plate. If you've never done this before, you'll learn a lot, grow personally and help your company. This is a good thing.

    If you have to work alongside people who defend this kind of crap and have no interest in fixing it, only in propagating it, then you have a real problem unless you can change their attitude. In this case, you need to make a choice between walking away or fighting a battle with the odds against you.

    Bad software isn't a real problem; it's what you're paid to do. So, do it.

     



  • How many lines?  Uhh... your guess is as good as mine, I'm guessing at least a hundred thousand, if not more (god knows how many pages there are) in good old VBScript (Classic ASP).  The real kicker is that there are two nearly-identical databases and sites (we do the order processing and fulfillment for another company in the same line of business), so usually (not always) any changes I make to our site, I have to  make to theirs as well, or I'll get a request that "<Feature> in the Initech backoffice works, but not in the Intertrode backoffice." (names, obviously, changed to protect the guilty). 

     Half the reason for my wanting to redo the thing is so I can consolidate the sites together, and at least have one database with seperate tables (e.g. Customers => our customers, IntertrodeCustomers => their customers, etc.) and some menu or something in the site to work on the other company's info instead of our own, so there isn't 100% duplicated logic across the whole thing (there's going to be SOME duplication, sadly, but there's no way to avoid that).

    I'll look into Macros - ironically I've never once looked into them to see how they work.  Anything to speed up the load would help greatly, although even though it sometimes takes me a few days to do a request (do to having to sort through all the shit), the old guy they had (the one who wrote it) would take months.  From what they've said, they've gone two weeks without their customer-facing sites working properly, because he didn't know how to fix it or whatnot (no documentation or workflow processes either, of course).  So the real irony is that, even with all the problems I'm facing, they think I'm doing great.

    And yes, I am ranting.  But I needed to rant :)  Also, I guess I do "own" the code - I'm the sole IT person and "IT Director".  If I get the chance I'll start to refactor some of the stuff.  What I really need to do is set up a local copy of it so I can play with and refactor the code (Yes, I admit that I do fixes in production, well actually I copy the file so I can test it first at least - I know that's the greatest sin to commit but at the time I had no choice), and then move that change into production.  I'll start to work on it.  Do or do not, there is no try :) 



  • For your own sake and for the sake of your company, you need to get decent source control up. This will help you to track your revisions as well as enable you to have both a storage for production and development. That way you can branch off what you have now and fix portions at a time. I highly recommend Subversion (www.tigris.org).  They also got a windows Explorer plugin to make things easier called TortoiseSVN. I know you are the only developer, but this is necessary for every development department. And Subversion is free, so you have nothing to lose.  Maybe down the line you can also setup an issue tracker to help you follow up on bugs and it would help you document issues and prioritize them to help lay everything out better. The good thing about using an issue tracker is that once you get it going good, you can try to use it to ease communication with management, by having tangible proof of problems and bugs that are encountered and what got fixed. Good luck.



  •  Yeap, I'm aware of Subversion, just never really got into it (up until 6 months ago I had never used version control or even knew what it was!).  I actually have it set up on the dev server, I'm just trying to learn more about it.. I can do basic check in/out stuff, but the trunk things I haven't tackled yet.  Pragmatic Version Control with Subversion is on my reading list :-)



  • Sounds to me like you have some vision of how to improve it. Take that, pick off a couple of small but nasty issues you can fix in week or two while still moving towards that vision, fix them and release. Consolidate a bit of logic here, move/re-normalise a table there... look back at what worked and what didn't, refine your vision and repeat.

    Refactoring is re-writing. It's just re-writing bit by bit over a period of several releases with the ability to test at each stage against something you know works. You get more chances to get it right and learn from where you went wrong.

    Fix the problems that slow you down and cause you problems. Automate. See a way through even if you can't take it all in one go.

    The impression of doing a good job is a big plus point even if you feel you aren't. It's a lot better than the other way around.

    Any project you can't learn something from isn't worth doing and learning is never easy, it takes time, practice and effort.

    I'm guessing you really know all this already. Keep the faith.



  •  I'm definitely with those who say refactoring is the way to go. Wanting to rewrite everything from scratch, especially using "insert new technology of choice", is something that IMHO marks someone out as inexperienced.  Only very occasionally is a complete rewrite the way to go, and even then you should try to salvage as much as possible from the existing code.  Otherwise you risk spending a lot of your and users time falling down all the same pits as your predecessor did - during which process your lovely shiny new system will migrate towards something of the mess you started with.  This process is usually a foregone conclusion as the time pressure increases near the end of the project and so the likelihood of cutting corners.

    The other advantage of refactoring is that you always have a product to ship, and during each release cycle can prioritise new features and refactoring.  As an example I once worked on a product that was in Pascal, then was translated wholesale into C due to a forced technology change.  During this process there was a general cleanup (e.g. removal of global data) but this was always done piecemeal so we always had a running system.  Later we moved into C++ but could only justify rewriting a given subsystem when significant features were added.  So over time we were approaching a nice OO system but we kept the new features and existing support going at the same time.

     Good to hear you have a test server as well as one for production.  And definitely take the time to read the Subversion book and try things out on a dummy source control project.



  • @JukeboxJim said:

    you'll learn a lot, grow personally and help your company
    @JukeboxJim said:
    You need to step up to the plate
    @JukeboxJim said:
    Refactoring is the way forward
    @JukeboxJim said:
    you are turning to the Dark Side
    @JukeboxJim said:
    you have the power to change it for the better
     

    This particular post is particularly marketing-heavy and without substance



  • @belgariontheking said:

    post is

    @belgariontheking said:

    particular

    @belgariontheking said:

    particularly

    @belgariontheking said:

    heavy

    @belgariontheking said:

    substance
     

    Why, thank you. Now, could I interest you in... 



  • @JukeboxJim said:

    @belgariontheking said:

    post is

    @belgariontheking said:

    particular

    @belgariontheking said:

    particularly

    @belgariontheking said:

    heavy

    @belgariontheking said:

    substance
     

    Why, thank you. Now, could I interest you in... 

    touché 



  • Hey ObiWayne, once things move further along, please give us an update. I hope that you were able to take something useful from here and apply it to your task. Let us know how its going.


Log in to reply