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

Coding Horror

  • 18-09-2009 10:18am
    #1
    Registered Users Posts: 7,468 ✭✭✭Evil Phil


    This is a place to vent your frustration however there is one rule:

    1. Do not name a company, organisation or individual as an attempt to undermine or discredit them in any way. This will really be a question of moderator discretion but use your common sense here. Boards.ie Ltd does not want to have fight what is rightfully somebody else's slander case.

    Other than that feel free to discuss programming gotcha's, frustration with badly managed projects (just don't name anyone), frustration with technology or just plain idiotic things you've encountered.


«13456737

Comments

  • Registered Users Posts: 40,055 ✭✭✭✭Sparks


    How about trying to be a sysadmin when management insists that you only need three basic servers with 2Gb of RAM to run websites for twenty or thirty clients, half of whom are major clients running very heavy lamp-stack applications?

    It's amusing after a few years to look back and remember days when your job involved sitting at your desk logged into the server watching top and restarting apache when the load hit 20...


  • Registered Users Posts: 197 ✭✭pauldiv


    lol I bet it made you a much better sys admin though


  • Registered Users Posts: 981 ✭✭✭fasty


    Oh god, I think this thread is going to be quite popular with me. I maintain a lot of code that was originally written (badly) over 15 years ago... business logic inside UI code, functions copy and pasted with one slightly different parameter, pointless comments like //end while, blatant disregard for the differences between unsigned and unsigned ints and 16 and 32 bit ints. 10 dialogs and 15 "classes" to do the same thing. Not that the classes are classes, more structs with random functions, a complete fail when it comes to the implementation and use of inheritance and interfaces. MEGA memory leaks made because of assumptions of how Win32 cleans up when windows are closed with no actual debugging... I can, and will, go on and on...


  • Registered Users Posts: 40,055 ✭✭✭✭Sparks


    pauldiv wrote: »
    lol I bet it made you a much better sys admin though
    Yes, but somehow I think the clients would have preferred I not be given that lesson at their expense!


  • Registered Users Posts: 197 ✭✭pauldiv


    "Yes, but somehow I think the clients would have preferred I not be given that lesson at their expense!"

    What expense?


  • Advertisement
  • Registered Users Posts: 40,055 ✭✭✭✭Sparks


    Their website's performance.


  • Registered Users Posts: 7,182 ✭✭✭Genghiz Cohen


    It takes a very special man to create a C++ class and then go back and rename the class without changing the filename.
    #include SomeClass.h
    
    RandomClass *PointerToRandomClass;
    


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


    What is up with SQL?

    Almost every time I encounter SQL written by other developers, it seems that it has been somehow considered exempt from all rules regarding coding style.

    Indentation and structure? apparently "its all one query" means "no indentation required"
    Casing? SQL is case-sensitive, right, so there's no need to worry about case. There's no need to even worry about consistency of case.
    Comments? Are you mad? That nested set of n functions doesn't need a comment.
    Aliasing? Aliasing table names to a, b, c and d is plenty, right?

    What's amazing is that most of the people who I see writing sql write really nicely structured code in Java or whatever....but as soon as its time to hit the DB, then its Sin City.


  • Registered Users Posts: 40,055 ✭✭✭✭Sparks


    SQL also seems to be immune from even efforts at version control and deployment controls. The number of times I've seen a dev team working on one SQL codebase only to find there's a different codebase on the live server...


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


    Sparks wrote: »
    SQL also seems to be immune from even efforts at version control and deployment controls. The number of times I've seen a dev team working on one SQL codebase only to find there's a different codebase on the live server...

    Oh, don't get me started.


  • Advertisement
  • Registered Users Posts: 40,055 ✭✭✭✭Sparks


    bonkey wrote: »
    Oh, don't get me started.
    But isn't that the point of the thread? :D


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


    Not really a coding horror, but once saw a programmer turn their app they were working into one line of text to protest someone taking over from them. Took them a couple of hours. They also gloated about it when the new guy turned up.

    They died a little inside when the other guy pressed CTRL-SHIFT-F (auto formats the text).


  • Registered Users Posts: 981 ✭✭✭fasty


    A database I work on has no foreign key constraints set up. None. And I'm not allowed make any. Indeed, I'm not allowed to make attempts to fix the schema in any way because it would break MAX 15 reports, which once fixed would run faster anyway.

    Also, if you don't understand what byte alignment is, don't ****ing change it!


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


    Well since we're on the database thing, we've 3 core databases that support the concept of a financial agreement (FYI: a proposal is an unactivated agreement).

    On the oldest 20yo system, the primary key on the mast table for instance is agno (most of the tables are limited to 4 character names, so table names like mast, mas2, cust, payh, dats, deco, ucod, sprm, and my personal favourate - tits).

    Under the proposal capture system, you will generally find proposal_no, propno or agno. Under the MIS system you will find agreement_number, and under the collections sytem you will either find agreement_number (because of the feeds from MIS) or agno.

    select blah from ifs_agreements a
    left outer join agreement_status s on (s.agno=a.agreement_number)
    left outer join proposal p on (p.proposal_no = a.agreement_number)
    etc.

    D.


  • Closed Accounts Posts: 179 ✭✭gdael


    Or the unwritten rule :D

    You decide that whatever code came before you were there, is shlte.

    And eventually when you are gone, others will come declaring your work shlte too.

    And it will go on an on like that.

    All this has happened before, and it will happen again .......


  • Registered Users Posts: 2,800 ✭✭✭voxpop


    A place I worked before had this developer - he was rubbish - one of those guys that got into software when companies were hiring anyone who could spell computer.

    Anyway this guys is working on a large web app, web pages,com objects,database,etc. He just manages to finish the project (after about 6 month work) before leaving the position. When we go to actually deploy the project we find that it will only run on his machine! Somehow this guy has managed to hardcode his own machines details into the web app so it wont run on any other machine.

    There was this other guy who joined the company and was given the task of writing a bunch of stored procedures for an application - just general stuff and reports. All in all there were about 60 stored procedures. The guy is found out to be a dud and let go. (was hired cus he was a mate of one of the managers). Anyway when we finally get around to checking on the work he has done, there is no SQL - its all just comments. So we have 60 SQL procedures just filled with comments on how he was going to select this from that, but no actual SQL.


  • Registered Users Posts: 1,529 ✭✭✭zynaps


    dazberry wrote: »
    (most of the tables are limited to 4 character names, so table names like mast, mas2, cust, payh, dats, deco, ucod, sprm, and my personal favourate - tits).

    That's quite good. :D


  • Registered Users Posts: 2,445 ✭✭✭Jako8


    Didn't know where to post this.


    compiling.png


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


    voxpop wrote: »
    Somehow this guy has managed to hardcode his own machines details into the web app so it wont run on any other machine.

    Write an installer to add his machine name to 127.0.0.1 ;)


  • Registered Users Posts: 1,028 ✭✭✭Hellm0


    It has been a while since I have had to deal with any real train wrecks, though the worst I have encountered to date would have to be a classic ASP app which utilized inline SQL. On a database with zero normalization and no defined relationships. Bug tracking was a difficult task to say the least.

    I think my least favorite thing to hear in a job is the word "Agile". The moment I hear the words "We are an agile shop!" I know to expect nil documentation, no concept of architecture and unreasonable deadlines.


  • Advertisement
  • Closed Accounts Posts: 2,930 ✭✭✭COYW


    I am only in the industry about 5 years in total but have seen some unmerciful rubbish in my time.

    Everywhere I go, I find applications written in classic asp and VB6 in which any rules relating to syntax or commenting are completely ignored. Most managers I come accross fell into software developement and IT by accident and are now completely out of touch with when the likes of .Net is now for example. It is a massive struggle trying to convince these people to allocate time for upgrading to .Net.

    There are still to many 'jobs for the boys' in this country as well. Ive lost count of the amount of times that a son/..../nephew of some manager or director has come in to a place where I worked. Also, they all tend to be rubbish.


  • Registered Users Posts: 3,130 ✭✭✭oneweb


    Reusing code time and again to workaround the regional setting and non Daylight Saving setting on the internal server in the room next door.

    It is what it's.



  • Closed Accounts Posts: 18,056 ✭✭✭✭BostonB


    The same field appearing throughout an almost zero normalised database. Renamed something different everytime it appears. Date, StartDate, Current_Date, and sometimes as date and some times as datetime, and sometimes as null, then displaying/sorting records by datatime. Which puts them in a meaningless order.

    No meaningful information in the error handlers, so that users think the system has a bug/crashed, and they log a support call each time.

    The helpdesk system has more bugs than the system its logging calls on.

    Being handed a legacy project, developed over a decade or longer, by too many cooks who couldn't code properly, so no comments, no meaningful names to modules, functions etc, and then expected to fix it when it falls over.

    You can do in in access but you shouldn't. But that was 5 yrs ago. No I can't open the database either.

    Versioning, they've heard of it. Ditto testing.


  • Registered Users Posts: 1,529 ✭✭✭zynaps


    BostonB wrote: »
    No meaningful information in the error handlers, so that users think the system has a bug/crashed, and they log a support call each time.
    Aha yes, catching errors with an empty handler - even deleting the autogenerated "e.printStackTrace()". Error handlers that don't handle the error, so things appear to have worked and didn't work, and you have no idea why. :p


  • Registered Users Posts: 558 ✭✭✭wobbles-grogan


    Need i say more than this?
    public static void main(){
    [INDENT]try {
    [INDENT]// Imagine entire application here[/INDENT]
    } [/INDENT]
    [INDENT]catch (Exception e) {
    
    } // end program[/INDENT]
    }
    


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


    Need i say more than this?
    public static void main(){
    [INDENT]try {
    [INDENT]// Imagine entire application here[/INDENT]
    } [/INDENT]
    [INDENT]catch (Exception e) {
    
    } // end program[/INDENT]
    }
    

    Is that real? If so :eek: if not :pac:


  • Closed Accounts Posts: 2,930 ✭✭✭COYW


    Need i say more than this?
    public static void main(){[INDENT]try {[INDENT]// Imagine entire application here[/INDENT]} [/INDENT][INDENT]catch (Exception e) {
    
    } // end program[/INDENT]}
    

    Well its better than no error handling, I suppose;).


  • Closed Accounts Posts: 18,056 ✭✭✭✭BostonB


    Naming things with the date, but so they do not appear in Date order anywhere.

    Jan10
    MyFileJan10
    30 Jan 2010

    Then changing the naming convention randomly but never using one that sorts numerically. Then Imagine this after 15 years, as is the case with the database/app I'm currently working on.


  • Closed Accounts Posts: 2,930 ✭✭✭COYW


    BostonB wrote: »
    Then Imagine this after 15 years, as is the case with the database/app I'm currently working on.

    Databases are a different kettle of fish. Had one unbelievable whopper before where the database wasnt even in 1NF. It was just one massive table where the same records were entered in month after month and it had been going on for years before I worked there.

    I have lost count of the number of times I have come accross dbs with no integrity constraints, indexes, keys, ....... These tables were created by both internal staff and external "consultants".


  • Advertisement
  • Registered Users Posts: 1,529 ✭✭✭zynaps


    COYW wrote: »
    These tables were created by both internal staff and external "consultants".
    Fixed that for you. :)


Advertisement