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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Coding Horror

  • 18-09-2009 10:18am
    #1
    Registered Users, Registered Users 2 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.


«13456722

Comments

  • Registered Users, Registered Users 2 Posts: 40,038 ✭✭✭✭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, Registered Users 2 Posts: 197 ✭✭pauldiv


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


  • Registered Users, Registered Users 2 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, Registered Users 2 Posts: 40,038 ✭✭✭✭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, Registered Users 2 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, Registered Users 2 Posts: 40,038 ✭✭✭✭Sparks


    Their website's performance.


  • Registered Users, Registered Users 2 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, Registered Users 2 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, Registered Users 2 Posts: 40,038 ✭✭✭✭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, Registered Users 2 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, Registered Users 2 Posts: 40,038 ✭✭✭✭Sparks


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


  • Registered Users, Registered Users 2 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, Registered Users 2 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, Registered Users 2 Posts: 2,152 ✭✭✭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, Registered Users 2 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, Registered Users 2 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, Registered Users 2 Posts: 2,445 ✭✭✭Jako8


    Didn't know where to post this.


    compiling.png


  • Registered Users, Registered Users 2 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, Registered Users 2 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, Registered Users 2 Posts: 3,177 ✭✭✭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, Registered Users 2 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, Registered Users 2 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, Registered Users 2 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, Registered Users 2 Posts: 1,529 ✭✭✭zynaps


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


  • Registered Users, Registered Users 2 Posts: 4,277 ✭✭✭km991148


    BostonB wrote: »
    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.

    do you work with me? ALL of the above (except versioning, its used, but no branches, just bulk copy and paste) and then some..


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


    I work in a sh1thole (commonly referred to as a financial institution). So we get this guy in that was just a horror, and after a few months I beg for the guy to be fired, which of course doesn't happen, and lo and behold we're left with 2 years of mess.

    Coding horrors don't just happen in isolation, you need someone with an almost narcissistic belief in their skills and a matching aggressive streak just to liven up things. Like when I needed to run thru' code like this:
    if (condition == true) 
     some block of code
    else
    if (condition == false)
     some block of code
    else
     the block of code I needed to run
    
    ... it takes me 30 seconds to see to the problem (it was about 20 lines of code), and involves a 30 minute argument with the owner (who always kept their code - and half the rest checkout out to themselves) - eventually shouting at me "WHAT DO YOU WANT ME TO DO" even though I've explained it 5 times at this stage. Never trust anyone who can't read their own code :(

    When the guy had been let go (I wish they had let me go and kept him - they're a much better match), I found myself cleaning and commenting a lot of the system - those bits I could. All these comments would have been on his code.
      //[dd] [functionxxx] is supposed to be a class function, but it is only called 
      //     in an instantiated version of the already existing class, and it returns 
      //     a second instance - real stupidity - its leaking like a rusty bucket. 
    
    
      //[dd] 30.10.2007 This is so broken its not even funny 
      //                I've depreciated due to the reference to PropList 
    
    
      //[dd] For the time being - just find the respective node, and pretend it has 
      //     been clicked. Its wasteful but... what the fcuk are you to do in this 
      //     mess? really??? 
    
      //[dd] 16.11.2007 Removed Delete Proposal - WTF was this added in the first place? 
    
      //[dd] 25.09.2007 [function name] - WTF is this in [unit] and not here??? 
      //                It doesn't appear to be referenced anywhere else, I've moved it here 
    
      aNewPanel := CustomerPanel; 
      Ntype := 'CUST'; // <--- wtf is this about? ntype? 
    
       {----- comment--- 
         This method below was required because of problems with *** 
         sufacing message record changed by another user etc 
         This method is used after a save to resolve the *** issues. 
         ----- new comment 
         there probably isn't any problem - its just the screen has 
         been written by an idiot. 
    
      //[dd] FFS popping up a messagebox inside a transaction is fupping criminal 
    
      //[dd] 19.12.2007 THIS SHOULDN'T BE HERE FFS. 
    
      //FFS main. <- this is sick 
    

    This one is interesting, because as the framework was coming together there were stubs written that had no proper implementation at that time. One was focused on in a meeting and Narcissist coder freak comes out with the classic line "Oh you'd do that in the base class". I cringed, I protested, but they had their easy answer and he did it - and what a mess. This is a comment around code that didn't call the implementation in the base class.
      // sink can edit because it doesn't work for us here - fckn idiot 
      //Inherited CanEdit(bEnabled); 
    

    D.


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


    dazberry wrote: »
    you need someone with an almost narcissistic belief in their skills and a matching aggressive streak just to liven up things.

    Oh yes, I've met one of them. Humility, especially when working with a new team or code base, is vital. It doesn't reflect badly on the new guy if he asks 'Okay, this isn't working for me, can somebody give me a hand?', in fact you almost hear a sigh of relief in some companies when the new guy asks something like that.


  • Registered Users, Registered Users 2 Posts: 7,893 ✭✭✭The_B_Man


    Hellm0 wrote: »
    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.

    You should apply for this job:
    http://www.irishjobs.ie/Jobs/Visual-C-C-Engineer-Dublin-6299664.aspx
    ;)


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


    Just come across a database table which has 25 million rows and no keys. :D The problem with asking questions in Ireland is that it is seen as a sign of weakness.


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


    dazberry wrote: »
    I work in a sh1thole (commonly referred to as a financial institution).

    That made me laugh out loud. I feel your pain. Used to work in one, god it was amazingly bad. DB that wasnt even in 1NF and my senior didnt understand how nested 'for' loops worked.


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


    The_B_Man wrote: »
    Oh man, "agile" and "Visual C/C++" together in a job ad do not promote a sense of wellbeing.

    Also, "Min 2 years recent experience in Net Technologies". What's that? .NET? Networking? Maintenance of fishing nets?

    Also also, where do they get this "min 2 years recent experience of <random half-desired skill>" from? I wish people would stop saying things like that in job ads :rolleyes: Back when .NET was about 4 years old, I remember seeing an ad demanding "min 6 years experience of .NET technologies" or such. :mad:


  • Registered Users, Registered Users 2 Posts: 8,219 ✭✭✭Calina


    zynaps wrote: »
    Oh man, "agile" and "Visual C/C++" together in a job ad do not promote a sense of wellbeing.

    Also, "Min 2 years recent experience in Net Technologies". What's that? .NET? Networking? Maintenance of fishing nets?

    Also also, where do they get this "min 2 years recent experience of <random half-desired skill>" from? I wish people would stop saying things like that in job ads :rolleyes: Back when .NET was about 4 years old, I remember seeing an ad demanding "min 6 years experience of .NET technologies" or such. :mad:

    Yep. But it's hardly new; happened with Java as well.


  • Registered Users, Registered Users 2 Posts: 2,164 ✭✭✭hobochris


    COYW wrote: »
    Just come across a database table which has 25 million rows and no keys. :D The problem with asking questions in Ireland is that it is seen as a sign of weakness.

    Depends on what question and how its asked, for example, in your case: 'Why wasn't a primary key implemented when this table was designed?' would be a reasonable question without showing weakness in my book.


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


    I dunno, Asking "was there a competition to rename the same field as many different ways possible across the database" didn't really get the laugh I was expecting.


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 2,164 ✭✭✭hobochris


    BostonB wrote: »
    I dunno, Asking "was there a competition to rename the same field as many different ways possible across the database" didn't really get the laugh I was expecting.

    Q's like that never seem to get a laugh from the original Developers.


  • Registered Users, Registered Users 2 Posts: 267 ✭✭Codpeas


    One of my pet peevs:
    // We should never get here.
    


  • Registered Users, Registered Users 2 Posts: 1,829 ✭✭✭lil_lisa


    I guess I should be grateful that my boss lives by the "Copy & Paste" rule...except for the fact that its his answer to everthing!


  • Registered Users, Registered Users 2 Posts: 40,038 ✭✭✭✭Sparks


    Codpeas wrote: »
    One of my pet peevs:
    // We should never get here.
    
    That's not quite so horrible as you'd imagine though, it can be good practice. For example, from a switch statement in a freeRADIUS cllient:
    	default:
    		/* Should never enter here */
    		RDEBUG("Internal sanity check failed on eap_type");
    		rcode = 0;
    		break;
    	}
    


  • Registered Users, Registered Users 2 Posts: 267 ✭✭Codpeas


    Sparks wrote: »
    That's not quite so horrible as you'd imagine though, it can be good practice. For example, from a switch statement in a freeRADIUS cllient:
        default:
            /* Should never enter here */
            RDEBUG("Internal sanity check failed on eap_type");
            rcode = 0;
            break;
        }
    

    True, in the right context it's not bad at all. BUT, you should see some of the places I've seen it - in most of them there shouldn't even have been a 'here'...


  • Registered Users, Registered Users 2 Posts: 4,277 ✭✭✭km991148


    lil_lisa wrote: »
    I guess I should be grateful that my boss lives by the "Copy & Paste" rule...except for the fact that its his answer to everthing!

    constantly having to perform a diff on methods that are usually about 100 lines longer than required and vary by 1 line.

    new feature.. f**k it we will c&p feature x..


  • Registered Users, Registered Users 2 Posts: 3,553 ✭✭✭lmimmfn


    classes over 10'000 lines :eek: long and they keep adding to them

    All old guis were implemented using jbuilder, the new ones arent yet thee are jbinit() methods in them

    no comments, no structure, a love of copy and paste( OO IDE's should disallow the copy menu item, and should refuse to compile if code is too similar in long methods and differing by a line or 2 )

    I doesnt take a genius to realise that the larger the code base the more problems will exist, copy and pasting also has the problem of fixing something in one place and forgetting to update the other 10 exact same methods elsewhere

    Ignoring idiots who comment "far right" because they don't even know what it means



  • Registered Users, Registered Users 2 Posts: 7,987 ✭✭✭Trampas


    No code but software FileNet

    Can't handle concurrency. They put a wrapper around a COM Object and said it was a .NET version. "Best Practices" is a laugh. Worst of all is they charge a fortune


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


    lmimmfn wrote: »
    no comments, no structure, a love of copy and paste( OO IDE's should disallow the copy menu item, and should refuse to compile if code is too similar in long methods and differing by a line or 2 )

    I doesnt take a genius to realise that the larger the code base the more problems will exist, copy and pasting also has the problem of fixing something in one place and forgetting to update the other 10 exact same methods elsewhere
    Yep and it has the soul-crushing effect of overwhelming people who are new to the codebase... they open up a couple of files at random to see what's going on and are presented with about 30 pages of redundant crap. If you're lucky, there are comments other than "2/1/1958 not sure why we do this, but leave it in for now... probably to do with that old activemq xml translation threading model we removed a while back, but just in case....".

    Back in 2006 I was working at a place which used CruiseControl to constantly have our projects building and running tests etc. Was quite nice... there was also an Eclipse plugin (can't remember the name now) which ran through the source looking "code smells" - it was very good at identifying blocks of code that seemed copy-pasted. Even if the copies were modified, it would tell you something like "96% similar" and give you a diff-style view.
    What was nice is that having the machine detect redundant code like this meant there was less social stigma for the culprit.

    I should really install it again on the project I'm working on now - it's probably riddled with duplication...


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


    If you remember the name of it zynaps can you post it here? Sounds really good.


  • Advertisement
Advertisement