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 all,
Vanilla are planning an update to the site on April 24th (next Wednesday). It is a major PHP8 update which is expected to boost performance across the site. The site will be down from 7pm and it is expected to take about an hour to complete. We appreciate your patience during the update.
Thanks all.

Coding Horror

2456737

Comments

  • Registered Users Posts: 4,275 ✭✭✭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 Posts: 2,145 ✭✭✭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 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 Posts: 7,859 ✭✭✭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 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 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 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 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 Posts: 267 ✭✭Codpeas


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


  • Registered Users 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 Posts: 40,055 ✭✭✭✭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 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 Posts: 4,275 ✭✭✭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 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


  • Registered Users Posts: 7,379 ✭✭✭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 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 Posts: 7,468 ✭✭✭Evil Phil


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


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


    Evil Phil wrote: »
    If you remember the name of it zynaps can you post it here? Sounds really good.
    After a bit of googling, I remembered there were two that we used, along with
    • "Checkstyle" (and corresponding Eclipse plugin, sadly not updated since 2006)
    • "Findbugs", seems more recently updated, but some of the website is down anyway :rolleyes:

    In fact, both of these (as well as a Cobertura test coverage report) were generated automatically by Maven whenever we were thinking about checking in some changes to the SVN repo. Kind of amazing how powerful coding tools (especially free, open source ones!) have become in the last decade! :) Needs a lot of horror to compensate for all that goodness...

    [edit]
    Actually I think we used a third (!) static code analyser, PMD for some reason... :P


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


    zynaps wrote: »
    After a bit of googling, I remembered there were two that we used, along with
    • "Checkstyle" (and corresponding Eclipse plugin, sadly not updated since 2006)
    • "Findbugs", seems more recently updated, but some of the website is down anyway :rolleyes:

    In fact, both of these (as well as a Cobertura test coverage report) were generated automatically by Maven whenever we were thinking about checking in some changes to the SVN repo. Kind of amazing how powerful coding tools (especially free, open source ones!) have become in the last decade! :) Needs a lot of horror to compensate for all that goodness...

    [edit]
    Actually I think we used a third (!) static code analyser, PMD for some reason... :P
    yeah we use all of those, PMD is quite good apart from it moaning about silly things like creating objects in loops or complaing about too many if statements. However if a project is run well and code reviewed and all PMD errors have to be ok'd to insert a NO PMD comment beforehand then it works out quite well.

    On the horror story, i cant believe people cant distinguish between unit tests and integration tests and the need for both. My current project has integration tests and unit tests all thrown into the one test directory, the integration tests require a huge db import( and no one knows now at this stage what data is in it ffs ) and its a pain to setup. No xml's for data just needed for 1 test and remove it afterwards, arrghhh lol


  • Closed Accounts Posts: 12 edbar2


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

    I've been doing sql since MSSQL 1.0 when Microsoft partnered with Ashton Tate and agree there is NO formal standard. I've seen some real hack jobs, like creating databases and tables directly in the query box instead of maintaining source files.


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


    Last app I inherited there was no handover, and it was a few weeks before I discovered there was about 3 versions of the application and another 3 versions of the database, none of which matched the live app or database, no comments, no notes. Located across different machines, none of which backup up to source safe, or on the network.


  • Closed Accounts Posts: 12 edbar2


    BostonB wrote: »
    Last app I inherited there was no handover, and it was a few weeks before I discovered there was about 3 versions of the application and another 3 versions of the database, none of which matched the live app or database, no comments, no notes. Located across different machines, none of which backup up to source safe, or on the network.

    What kills you is the guy who created all of that garbage probably got stock options for all of his wonderful (sic) work, and then moved on. Leaving all of that unmaintainable garbage behind.

    I actually knew someone like that.

    Then his replacement came in, thinking "oh boy, I'm at Microsoft, now I'll get stock". Instead he gets nothing, because you don't get stock options for sitting around doing maintenance / fixing bugs in old code, all of the time.


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


    Is that their idea of seo maybe? :D


  • Registered Users Posts: 16,402 ✭✭✭✭Trojan


    I just had to share this one. I was working on an ecommerce site a couple of months back. The original coders charged an arm, a leg, and a good chunk of torso for this site, so you'd hope it'd be well coded. No such luck :)

    It's a kind of specialist ecommerce site, can't say which, but you might be able to guess. When a customer views a product, they need to select from a list of basic options.

    Now we needed to change this list of options, remove and simplify the list to tidy it up a bit, make the labels clearer to the end user what each one did for usability and conversion.

    We removed a couple of the options, no problem, obviously we didn't change element id's. But when we changed the text titles on the form input elements, the whole page broke!

    On investigating the problem, I discovered that the back end of the options code looked like as follows:
    if($_value->getTitle() == "None") { /* do stuff */ }
    else if($_value->getTitle() == "Basic Widget") { /* do stuff */ }
    else if($_value->getTitle() == "More Expensive Widget A" || $_value->getTitle() == "More Expensive Widget B") { /* do stuff */ }
    else if($_value->getTitle() == "Contact my specialist, I do not have XXXX") { /* do stuff */ }
    else if($_value->getTitle() == "I will fax a copy to +353 (0)123 4567890" 
    	|| $_value->getTitle() == "You already have my details on file" 
    	|| $_value->getTitle() == "I will scan and email a copy to <a href='mailto:info@12345672222domain.com'>info@12345672222domain.com</a>" 
    	|| $_value->getTitle() == "I will fax a copy to 1890 123456")  { /* do stuff */ }
    else if($_value->getTitle() == "I will be responsible for my details and i will input it below")  { /* do stuff */ }
    

    There are several ways to reference an input in HTML forms -> PHP, but hardcoding the title text in has got be one of the dumbest. In this case, if the company had changed their fax number, their ecommerce processing would break.

    This site cost approximately a junior developer's entire annual salary. *boggle*


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


    That's quite horrific. I get scolded if I hard code even the slightest thing. Somehow people with this coding "in"ability manage to squeeze their way to the top!


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


    The next time a company gets named I'm deleting this thread and banning the offender.


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


    Someone discovered this over in AH in the source code of a website:

    [HTML]<!--
    -\-
    \-- \-
    \ - -\
    \ \\
    \ \
    \ \\
    \ \\
    \ \\
    \ \\\
    \ \\
    \ \\
    \. . \\
    \ . \\
    \ . \\
    \ . \\
    \ . \\
    \ <=)
    \ <==)
    \ <=)
    \ .\\ _-
    \ . \\ _-//
    \ . \\ _-_/ /
    \ . . . \\ _--_/ _/
    \ \\ _- _/ _/
    \ \\ ___-(O) _/ _/
    \ \ __-- __ /_ / ***********************************
    \ \\ ____--__---- / \_ I AM A MOTHER****ING PTERODACTYL!
    \ \\
    / \_ \_ HERE TO PTERO-YOU A NEW ASSHOLE
    \ \ // // \__ \_ [url]HTTP://PTERODACTYL.ME[/url]
    \ \\ // // \_ \_ **********************************
    \ \\ /// // \__-
    \ - \\///////// //
    \ - \_ //
    / - //
    / - ///
    / - //
    __--/ ///
    __________/ // |
    //-_________ ___ //// |
    ____\__--/ ///// |
    ______ -/---________//// |
    _______/ --/ \ |
    /_________-/ \ |
    // \ /
    \. /
    \ . /
    \ . /
    \\ . /
    \ /
    \ __|
    \ ==/
    / //
    / . //
    / . . //
    /. /
    / //
    / /
    / //
    / //
    --/ /
    / //
    //// //
    ///_________////


    -->[/HTML]

    **Phil, I'm assuming since we shouldn't name companies, the same goes for websites?


Advertisement