Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on [email protected] for help. Thanks :)
Hello All, This is just a friendly reminder to read the Forum Charter where you wish to post before posting in it. :)

Coding Horror

1235736

Comments

  • Registered Users Posts: 5,246 ✭✭✭ conor.hogan.2


    That link is evil :) and also it runs on the premise that there is no code overviews or even anyone with half a brain looking at your code even on a weekly basis to see it is maintainable.


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


    I've seen obscurification a couple of times. Pages of code that goes all over the place fore no reason. First time was a student, that was more like just badly written. The second time, was a programmer who did it to the source code of the company he was working for, just before he left to set up in competition. They only realised after he left there was deliberate errors in the code, and in their product.


  • Registered Users Posts: 1,100 ✭✭✭ Skrynesaver


    I saw a beautiful example of 49 in the International Obfuscated C contest many years ago, someone had used #define to effectively turn cc into a COBOL compiler. Truly shock and awe inducing.


  • Closed Accounts Posts: 8,200 ✭✭✭ G-Money


    This isn't a coding horror issue, more just a rant.

    I'd been working on a script change and it had been through several rounds of code review where people gave me feedback on various changes to be made. All changes were made and I got the thing tested finally (our environment is very restrictive/inflexible and testing can take a long time).

    Sent the thing off for the next stage of the process which is to be approved and someone pipes up with several changes they want made. Even though they were on the code review list from the start.

    Some of the suggested changes are possibly valid but quite a few I think are personal preferences. Let's just say I'm not best pleased.

    I find it massively frustrating that this person had numerous chances to give feedback before this and they said nothing. Then when they do, it's after I've completed testing (which was frustrating to do itself) and which may set me back a week or two due to the way things run.

    Lets just say they're going to need jedi mind powers to convince me to make their changes, especially at this stage.


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


    I had that problem on contract, but the person was trying to derail the project and discredit me. I assume though it would replace them, which is couldn't, just save them a bunch of time. Lucky enough the people in charge could see this and basically got the problem person to sign off the project each week at a regular meeting to keep it on track.

    A paper trail and a few stats, kept them from causing trouble anymore.


  • Advertisement
  • Moderators, Politics Moderators Posts: 33,859 Mod ✭✭✭✭ Seth Brundle


    G-Money wrote: »
    This isn't a coding horror issue, more just a rant.

    I'd been working on a script change and it had been through several rounds of code review where people gave me feedback on various changes to be made. All changes were made and I got the thing tested finally (our environment is very restrictive/inflexible and testing can take a long time).

    Sent the thing off for the next stage of the process which is to be approved and someone pipes up with several changes they want made. Even though they were on the code review list from the start.

    Some of the suggested changes are possibly valid but quite a few I think are personal preferences. Let's just say I'm not best pleased.

    I find it massively frustrating that this person had numerous chances to give feedback before this and they said nothing. Then when they do, it's after I've completed testing (which was frustrating to do itself) and which may set me back a week or two due to the way things run.

    Lets just say they're going to need jedi mind powers to convince me to make their changes, especially at this stage.
    Four words: Change Control Request Form
    Let the buggers know the amount of work that it would take now along with the cost of doing them!


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


    Someone forgot to comment on where the author tag is, sheer laziness...
    (!)
    <head>
    <link href="/favicon.ico" type="image/x-icon" />
    <!--This is the Document CHARSET -->
    
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15" />
    
    
    
    <!-- This is the Title Element -->
    
    <title>StatCentral.ie - The Portal to Ireland's Official Statistics</title>
    
    
    
    <!-- This is the META Description Tag -->
    
    <meta name="description" content="The home page of StatCentral.ie" />
    
    
    
    <!-- This is the META Keywords Tag -->
    
    <meta name="keywords" content="Home, Statcentral.ie, CSO, Central Statistics office, Statistics Ireland" />
    
    
    
    <!-- This is the beginning of the DCMI Element Set -->
    
    <link rel="schema.DC" href="http://www.purl.org/dc/elements/1.1/" />
    
    
    <!-- Element Name: Title -->
    
    <meta name="DC.title" content="StatCentral.ie - The Portal to Ireland's Official Statistics" />
    
    
    
    <!-- Element Name: Creator -->
    
    <meta name="DC.creator" content="Central Statistics Office; Statcentral" />
    
    
    
    <!-- Element Name: Subject -->
    
    <meta name="DC.subject" content="Home, Statcentral.ie, CSO, Central Statistics office, Statistics Ireland" />
    
    
    <!-- Element Name: Description -->
    
    <meta name="DC.description" content="The home page of StatCentral.ie" />
    
    
    
    <!-- Element Name: Publisher-->
    
    <meta name="DC.publisher" content="Central Statistics Office; Statcentral" />
    
    
    
    <!-- Element Name: Contributor -->
    
    <meta name="DC.contributor" content="Central Statistics Office; Statcentral" />
    
    
    
    <!-- Element Name: Date -->
    
    <meta name="DC.date" scheme="W3CDTF" content="2008-01-31" />
    
    
    
    <!-- Element Name: Type -->
    
    <meta name="DC.type" scheme="DCMIType" content="Text" />
    
    
    
    <!-- Element Name: Format -->
    
    <meta name="DC.format" scheme="IMT" content="text/html" />
    
    
    
    <!-- Element Name: Identifier -->
    
    <meta name="DC.identifier" content="/meta-tags/dublin/" />
    
    
    
    <!-- Element Name: Source -->
    
    <meta name="DC.source" content="/meta-tags/" />
    
    
    
    <!-- Element Name: Language -->
    
    <meta name="DC.language" scheme="RFC1766" content="en" />
    
    
    
    <!-- Element Name: Relation -->
    
    <meta name="DC.relation" content="/meta-tags/" />
    
    
    
    <!-- Element Name: Coverage -->
    
    <meta name="DC.coverage" content="World" />
    
    
    
    <!-- Element Name: Rights -->
    
    <meta name="DC.rights" content="Copyright Government of Ireland" />
    
    
    
    <meta name="author" content="Central Statistics Office; Statcentral" />
    
    
    
    
    
    
    
    
    
    
    
    

    It is what it's.



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


    oneweb wrote: »
    Someone forgot to comment on where the author tag is, sheer laziness...
    (!)


    <!--This is the Document CHARSET --> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15" /> <!-- This is the Title Element --> <title>StatCentral.ie - The Portal to Ireland's Official Statistics</title> <!-- This is the META Description Tag --> <meta name="description" content="The home page of StatCentral.ie" /> <!-- This is the META Keywords Tag --> <meta name="keywords" content="Home, Statcentral.ie, CSO, Central Statistics office, Statistics Ireland" />
    [...etc...]
    <!-- This is the jovial sarcasm element --> Man, I'd never have expected mind-numbing comment bureaucracy from them! <!-- This is the smiley --> ;)


  • Registered Users Posts: 2,320 ✭✭✭ Q_Ball


    That link is evil :) and also it runs on the premise that there is no code overviews or even anyone with half a brain looking at your code even on a weekly basis to see it is maintainable.

    This is the case where I work. Peer reviews are supposed to be done, but they're never factored into estimates. Logic behind this is that we've never done them before so why add additional cost and time to the estimate. After all, we've "built" similar for the client before, they are expecting a cost that is less or in line with.

    We propose improvements to the underlying codebase, "under the hood" so to speak, but why would the client pay for that when they are not getting any new functionality.

    I won't tell you what we were actually told to do. I died a little on the inside.

    Funny thing is, if the client actually had a technical person who could evaluate our code, I'm sure we'd have been fired long ago. The problem is they don't. So they see the figures coming in, thinking we're great and management are giving themselves a pat on the back for a "job well done".

    Meanwhile, the application (d)evolves quite rapidly into an unmaintainable mess. It really is enough to break a person.

    New job time methinks.


  • Registered Users Posts: 4,271 ✭✭✭ km991148


    Q_Ball wrote: »
    This is the case where I work. Peer reviews are supposed to be done, but they're never factored into estimates. Logic behind this is that we've never done them before so why add additional cost and time to the estimate. After all, we've "built" similar for the client before, they are expecting a cost that is less or in line with.

    We propose improvements to the underlying codebase, "under the hood" so to speak, but why would the client pay for that when they are not getting any new functionality.

    I won't tell you what we were actually told to do. I died a little on the inside.

    Funny thing is, if the client actually had a technical person who could evaluate our code, I'm sure we'd have been fired long ago. The problem is they don't. So they see the figures coming in, thinking we're great and management are giving themselves a pat on the back for a "job well done".

    Meanwhile, the application (d)evolves quite rapidly into an unmaintainable mess. It really is enough to break a person.

    New job time methinks.

    I (Briefly) worked in a place like this. Soul destroying - and as a result had very high turnover. Good developers left quickly, not so good ones stayed a while longer and polluted code further making it increasingly harder for new comers to figure out what half the products were doing/ supposed to be doing. Management couldn't understand the problem as products were still being shipped and were not interested in investing time in improving quality even although it would altos certainly decrease overall development time (It even took ridiculous amounts of time to find code, never mind work out what the fu(k it was doing due to half ars3d practices of previous 'developers').


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


    "Hey, this didn't save my input."
    "Oh yeah?"
    "Yeah, I put in the names then clicked 'Save For Later' and when I came back it didn't load them. Any ideas?"
    "Oh, that 'Save For Later' button doesn't actually do anything."


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


    How about the secret button.

    "Hey these calculations don't work"

    "Hit ALT Z T H"

    "What the .... does that do"

    "Fixes the numbers"

    Some coder decided to code hidden buttons to do things, so he could fix things in his apps, and others wouldn't be able to.


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


    Another one I don't get is coding error handlers, but then not putting any plain text explanation so users don't understand the errors, or coding to UI to to provide feedback to the user . IE "Truncated String Error" you've entered too much text. Then repeat that for every type of user input that requires validation. Or not checking a record/data already exists on input, so users enter duplicated data constantly, requiring records to be merged and fixed.

    Just ARRRTGGGGGHHH. :mad:


  • Registered Users Posts: 981 ✭✭✭ fasty


    A friend of mine recently did some development on a game I've been working on...

    Seeing people use boost::function and boost::bind when a C style callback will do makes me cry.

    Boost is the business and the above has it's place in an event driven Windows app, but not sprinkled liberally in code where performance matters inside loops processing hundreds of elements in some other data structure.

    Plus he really does not give a crap about thread safety which is why things are crashing on him and thanks to his liberal use of the above event system, I'd have to slap mutexes all over the place to make it thread safe.

    Thank **** for source control...


  • Registered Users Posts: 7,041 ✭✭✭ Seachmall


    Figured this was suited to here (if not just delete it),

    [Too wide to embed, NSFW language]

    "That's The F'ing Business"


  • Closed Accounts Posts: 6,151 ✭✭✭ Thomas_S_Hunterson


    Spotted on StackOverflow: link

    Closely related to thread title.


  • Registered Users Posts: 7,157 ✭✭✭ srsly78


    Spotted on StackOverflow: link

    Closely related to thread title.

    Ok I just spat my coffee all over monitor :D


  • Registered Users Posts: 2,172 ✭✭✭ Flojo


    How come on this forum the BBcode is turned off in sigs? Surely it would prevent a lot of "sig too big" crap if allow alignment BB code NoYes?


  • Moderators, Education Moderators, Technology & Internet Moderators Posts: 34,599 Mod ✭✭✭✭ AlmightyCushion


    Flojo wrote: »
    How come on this forum the BBcode is turned off in sigs? Surely it would prevent a lot of "sig too big" crap if allow alignment BB code NoYes?

    I don't know about anyone else but I find right or centre alligned sigs very distracting.


  • Registered Users Posts: 2,172 ✭✭✭ Flojo


    I don't know about anyone else but I find right or centre alligned sigs very distracting.

    Really hehe, how so? Surely it's better than looking at a car crash sig!


  • Advertisement
  • Registered Users Posts: 83 ✭✭ fatlog


    Spotted on StackOverflow: link

    Closely related to thread title.

    love the comment...

    #include "fritzl.h".


  • Registered Users Posts: 3,981 ✭✭✭ Korvanica


    if (newConfirm("<%=CO_Corrections_p%>", checkMessage, 2, 1, 0)) 
    {
         document.CorDetails.ApplyToAllDays.value = 1;
    }
    
    document.CorDetails.ApplyToAllDays.value = 1;
    

    ffs....


  • Closed Accounts Posts: 884 ✭✭✭ spider guardian




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



    Oh my christ.
    @@ -348,7 +348,7 @@ case "$DISTRO" in
       ln -s /usr/lib/mesa/ld.so.conf /etc/alternatives/gl_conf
       rm -rf /etc/alternatives/xorg_extra_modules
       rm -rf /etc/alternatives/xorg_extra_modules-bumblebee
    -  rm -rf /usr /lib/nvidia-current/xorg/xorg
    

    :eek: :mad:


  • Closed Accounts Posts: 5,082 ✭✭✭ Pygmalion


    Been looking over some of my old code, found this gem (was scrolling through the file and the 7 levels of indentation immediately piqued my interest).

    PUmir.png

    Not something I'm particularly proud of :o.

    In fairness it was something I wrote as part of a competition and I was in "get something compiled before time runs out mode" (with a tiny bit of "oh god my brain stopped working an hour ago mode").


  • Closed Accounts Posts: 884 ✭✭✭ spider guardian


    Pygmalion wrote: »
    Been looking over some of my old code, found this gem (was scrolling through the file and the 7 levels of indentation immediately piqued my interest).

    PUmir.png

    Not something I'm particularly proud of :o.

    In fairness it was something I wrote as part of a competition and I was in "get something compiled before time runs out mode" (with a tiny bit of "oh god my brain stopped working an hour ago mode").

    Good lord man. Have you entered that into the obfuscated java contest?


  • Registered Users Posts: 1,235 ✭✭✭ Odaise Gaelach


    This is probably a stupid question, but... what does it do? :D


  • Registered Users Posts: 5,246 ✭✭✭ conor.hogan.2


    Pygmalion wrote: »
    ...7 levels of indentation...

    I used to do that….. :D Well, the gist of it, I carriage return the opening braces.

    Not coding horror, but I love random/funny comments sometimes. obviously they can be abused as comments are supposed to be helpful.

    I saw "hacked from some f'in place" in some code the other day, needless to say it was bad code….


  • Registered Users Posts: 981 ✭✭✭ fasty


    But what's the fix for such deep indentation? :D


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


    fasty wrote: »
    But what's the fix for such deep indentation? :D
    Maybe to extract a method or two, or maybe some of the logic can be "flattened" somehow to mitigate the real problem (apart from a lack of comments); the nested loops 4-levels deep.
    It might be faster to walk the list of frames and then do whatever "bubbling up" process happens in the deepest loop, rather than testing frame.ontile(x,y) for every position on the grid.

    Still, it's a polynomial runtime at worst, which isn't a big deal :)


Advertisement