Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

The best programming tip ever written

Options

Comments

  • Registered Users Posts: 2,150 ✭✭✭dazberry


    The code I've just inherited (no pun intended) is seriously going to turn me into a serial killer.

    ... and what p1sses me off no end is that I knew this was going on for the last 2 years and would they do anything about it - No. So know I can "told you so" to myself. Wonderful :mad:

    D.


  • Registered Users Posts: 7,468 ✭✭✭Evil Phil


    I found the best solution to that situation is to very clearly explain how its going to save them money if they do it your way. It's all about the dotted line at the end of the day.

    That being said I have worked in a bank where it was policy not to comment code.


  • Registered Users Posts: 273 ✭✭stipey


    Evil Phil wrote:
    That being said I have worked in a bank where it was policy not to comment code.

    If its hard to code it should be hard to understand!

    Actually I comment my code fairly heavily - mainly because I remember going back to a piece of code I had written for a pharma client 6 months after it was deployed. Their industry is very heavily regulated and it had to pass all kinds of coding standard reviews (including comment to code ratios), best practice reviews and other industry regulations.... which it did with flying colours. Despite all this, i found myself looking at the code for 10 minutes and thinking "what the f**k where you playing at here".

    I'm currently editing an app written for our client by another company... complete spaghetti code that is riddled with bugs, needless database hits and seems to be held together by chewing gum and sticky tape. It includes highlights such as
    if (condition1)
        boolValue = true
    else
        boolValue = true
    

    and

    intQuantity = intQuantity
    


  • Closed Accounts Posts: 5,029 ✭✭✭um7y1h83ge06nx


    Jesus, that's first year of college mistakes! :eek:


  • Closed Accounts Posts: 198 ✭✭sh_o


    I think all of us programmers have been guilty of such things at some stage - you do not leave college being an expert - how could you when you consider that a programming course might be 25 weeks at say 4 hours a week = just over two weeks full time work!

    Reading back over my own early code, I had a habit of doing the following:
    if(boolean_test == true) {
    ...
    }

    Nobody is perfect, at least not at first :rolleyes:


  • Advertisement
  • Registered Users Posts: 6,790 ✭✭✭cornbb


    stipey wrote:
    I'm currently editing an app written for our client by another company... complete spaghetti code that is riddled with bugs, needless database hits and seems to be held together by chewing gum and sticky tape. It includes highlights such as

    Christ, thats fairly bad alright! :eek:

    I posted that after months of frustration from trying to convert an academic prototype system into a commercially viable product. Headwrecking to say the least! Even spaghetti is not the word...


  • Closed Accounts Posts: 888 ✭✭✭themole


    stipey wrote:
    intQuantity = intQuantity
    
    A good compiler should pick that up. I know at least that Eclipse does.


  • Registered Users Posts: 15,065 ✭✭✭✭Malice


    There are some interesting programming techniques illustrated on The Daily WTF.
    For my sins I worked on a huge application last year that contained numerous memorable features such as the word Validation being misspelt as Validatation in both function calls and database tables. Somehow nobody noticed the mistake and worse, when it eventually was noticed it was too much trouble to fix it :mad: That used to cause me no end of grief. I'm getting annoyed just thinking about it!


  • Registered Users Posts: 21,264 ✭✭✭✭Hobbes




  • Registered Users Posts: 15,443 ✭✭✭✭bonkey


    Evil Phil wrote:
    That being said I have worked in a bank where it was policy not to comment code.
    Without being sarcastic, I can see how that could actually work.

    I can also see how it is far more likely to be one of the most braindead policies in the histiory of braindead policies.


  • Advertisement
  • Registered Users Posts: 68,317 ✭✭✭✭seamus


    A screenshot of the table list from a bespoke app someone installed in our place. I don't have to maintain it, luckily. Any table names blanked out are a bit more obvious, though cryptic enough - one named "RESRES".


  • Registered Users Posts: 15,065 ✭✭✭✭Malice


    seamus wrote:
    A screenshot of the table list from a bespoke app someone installed in our place. I don't have to maintain it, luckily. Any table names blanked out are a bit more obvious, though cryptic enough - one named "RESRES".
    Wow! Is that ported from a an old application where table names were shortened to save space or something? Otherwise who in their right mind could think that three letter table names were a good idea? :confused:


  • Registered Users Posts: 68,317 ✭✭✭✭seamus


    My suspicion is that whoever wrote it went through some obscure obfuscation process to make sure that only they can maintain it. The bulk of the frontend is ASP, so I cringe at the thought of what that looks like.


  • Registered Users Posts: 2,150 ✭✭✭dazberry


    We have a similar problem with one of our systems - however the system was orignally written nearly 20 years ago. Coupled with table size limitations (at the time I'd guess) and we have tables like mast, mas1, mas2, cust, paye etc.

    The sin comes from the fact that the last major project 2 years ago - we were initially forced to maintain the same table structures for some key areas - I actually had running battles over this one - and initially lost - but the decision was revised and a compromise was eventually reached.

    ... of course alot of decisions related to that project were politically motivated. I so want a proper job :(

    D.


Advertisement