Advertisement
MODs please see this information notice in the mod's forum. Thanks!
Boards Golf Society are looking for new members for 2022...read about the society and their planned outings here!
How to add spoiler tags, edit posts, add images etc. How to - a user's guide to the new version of Boards

Coding Horror

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


«13456736

Comments



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




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




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




  • 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!




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

    What expense?


  • Advertisement


  • Their website's performance.




  • 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;
    




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




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




  • 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


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




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




  • 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!




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




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




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




  • 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




  • Didn't know where to post this.


    compiling.png




  • 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 ;)




  • 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


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




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





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




  • 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




  • 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]
    }
    




  • 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:




  • 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;).




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




  • 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


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


Advertisement