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

1568101122

Comments

  • Moderators, Recreation & Hobbies Moderators, Science, Health & Environment Moderators, Technology & Internet Moderators Posts: 93,127 Mod ✭✭✭✭Capt'n Midnight


    Id love to see the code behind what allowed that to happen. lol.
    Quantum Cryptography.

    We all know that spacebar represents the mythical "Any Key" ergo it could also be every key at the same time.


  • Registered Users, Registered Users 2 Posts: 2,815 ✭✭✭SimonTemplar


    I emailed a new vendor to send me config details for an install of a new system. He sent them by txt :confused:


  • Closed Accounts Posts: 4,763 ✭✭✭Fenster


    I emailed a new vendor to send me config details for an install of a new system. He sent them by txt :confused:

    Could be worse. Spotted on Reddit last week: Someone wrote out a BSOD message by hand.


  • Registered Users, Registered Users 2 Posts: 2,021 ✭✭✭ChRoMe


    Fenster wrote: »
    Could be worse. Spotted on Reddit last week: Someone wrote out a BSOD message by hand.

    Really? after working in support I'd ****ing commend them for it.


  • Registered Users, Registered Users 2 Posts: 419 ✭✭Mort5000


    ChRoMe wrote: »
    Really? after working in support I'd ****ing commend them for it.

    +1
    It definitely beats "I didn't see, I just clicked OK"


  • Moderators, Recreation & Hobbies Moderators, Science, Health & Environment Moderators, Technology & Internet Moderators Posts: 93,127 Mod ✭✭✭✭Capt'n Midnight


    Fenster wrote: »
    Could be worse. Spotted on Reddit last week: Someone wrote out a BSOD message by hand.
    Wayyyy off topic but

    http://www.419eater.com/html/joyce_ozioma.htm


  • Registered Users, Registered Users 2 Posts: 406 ✭✭Gotham


    Haha love the comments in the source code
    http://www.reddit.com/r/programming/comments/1bnezw/jedi_outcastjedi_academy_source_code_released/

    And of course this beauty:
    /*
    ** float q_rsqrt( float number )
    */
    float Q_rsqrt( float number )
    {
        long i;
        float x2, y;
        const float threehalfs = 1.5F;
    
        x2 = number * 0.5F;
        y  = number;
        i  = * ( long * ) &y;                       // evil floating point bit level hacking
        i  = 0x5f3759df - ( i >> 1 );               // what the ****?
        y  = * ( float * ) &i;
        y  = y * ( threehalfs - ( x2 * y * y ) );   // 1st iteration
    //  y  = y * ( threehalfs - ( x2 * y * y ) );   // 2nd iteration, this can be removed
    
        return y;
    }
    


    This is Carmack's fast inverse square approximation, used for lighting algorithms that would otherwise be impossible on hardware of its time. This is genius code I'll have you know. :D
    http://en.wikipedia.org/wiki/Fast_inverse_square_root

    Edit: I see somebody already explained this.

    I'll share some cool stories then:
    http://www.catb.org/jargon/html/story-of-mel.html
    http://www.catb.org/jargon/html/magic-story.html


  • Registered Users, Registered Users 2 Posts: 891 ✭✭✭Mmmm_Lemony


    This!
    Always wanted to be able to post an xkcd comic as a response. Feel like I've joined a special club or something. I would like to thank my family, baby jesus and the OpenSSL developers.

    All right, all right, all right!


  • Closed Accounts Posts: 2,537 ✭✭✭Arthur Beesley


    Mort5000 wrote: »
    I blame poor business requirements.
    The developer is never wrong.

    Yeah. There's a business case for users being able to bypass authentication.


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 1,019 ✭✭✭carlmango11


    Yeah. There's a business case for users being able to bypass authentication.

    Yeah I think it might have been a joke.


  • Moderators, Computer Games Moderators, Technology & Internet Moderators Posts: 19,242 Mod ✭✭✭✭L.Jenkins


    Coding horror, I know people who've done the following and the picture says it all :P

    302813.png


  • Subscribers Posts: 4,076 ✭✭✭IRLConor


    Uploading code to production without testing? Why not just edit it straight on the live machines? :D

    When I started at boards.ie the development process was "ssh into the production machines and use vim". Terrifying doesn't even begin to describe it.


  • Moderators, Science, Health & Environment Moderators, Social & Fun Moderators, Society & Culture Moderators Posts: 60,105 Mod ✭✭✭✭Tar.Aldarion


    I know, vim :eek:


  • Subscribers Posts: 4,076 ✭✭✭IRLConor


    I know, vim :eek:

    Shush. I will have nothing bad said about the one true editor.


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


    IRLConor wrote: »
    Uploading code to production without testing? Why not just edit it straight on the live machines? :D
    Seen that, but with telnet instead of ssh... :eek:


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


    I know, vim :eek:
    Banned for a month :D


  • Registered Users, Registered Users 2 Posts: 7,518 ✭✭✭matrim


    Sparks wrote: »
    Banned for a month :D

    Maybe he meant it like this



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


    Starting working on a new project recently and met with the technical lead of the company I will be working with. He was going through the design of the application during which we looked at some of the code. It was a case of another MVC application, which was not MVC at all. I questioned this but got a blank stare in response.

    Anyway, I noticed that there were no comments on the code at all, and I mean absolutely none, so I asked him about code commenting and the company standards that were in place relating to same. He replied that they don't comment code as it is "a waste of resources/time", followed by "code is code and if a developer cannot read and understand code, they shouldn't be in the business".


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


    303244.gif


  • Technology & Internet Moderators Posts: 28,822 Mod ✭✭✭✭oscarBravo


    COYW wrote: »
    He replied that they don't comment code as it is "a waste of resources/time", followed by "code is code and if a developer cannot read and understand code, they shouldn't be in the business".
    You should do everything in really terse Perl and hand it off to him sans comments. Code is code, innit.


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


    oscarBravo wrote: »
    You should do everything in really terse Perl and hand it off to him sans comments. Code is code, innit.
    Why do it that way? Just write it in C, compile it to assembler, and hand in the assembler :D


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


    oscarBravo wrote: »
    You should do everything in really terse Perl and hand it off to him sans comments. Code is code, innit.

    I was thinking exactly along those lines. I haven't written Perl in two years or so. Time to brush up on it. :)


  • Moderators, Science, Health & Environment Moderators, Social & Fun Moderators, Society & Culture Moderators Posts: 60,105 Mod ✭✭✭✭Tar.Aldarion


    What's with all these non binary casuals clouting up the forum?


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


    COYW wrote: »
    Anyway, I noticed that there were no comments on the code at all, and I mean absolutely none, so I asked him about code commenting and the company standards that were in place relating to same. He replied that they don't comment code as it is "a waste of resources/time", followed by "code is code and if a developer cannot read and understand code, they shouldn't be in the business".

    Run. Don't walk.

    That can only be a precursor to problems.


  • Closed Accounts Posts: 4,763 ✭✭✭Fenster


    COYW wrote: »
    Starting working on a new project recently and met with the technical lead of the company I will be working with. He was going through the design of the application during which we looked at some of the code. It was a case of another MVC application, which was not MVC at all. I questioned this but got a blank stare in response.

    Anyway, I noticed that there were no comments on the code at all, and I mean absolutely none, so I asked him about code commenting and the company standards that were in place relating to same. He replied that they don't comment code as it is "a waste of resources/time", followed by "code is code and if a developer cannot read and understand code, they shouldn't be in the business".

    I would have probably had a panic attack then and there.


  • Registered Users, Registered Users 2 Posts: 7,498 ✭✭✭BrokenArrows


    COYW wrote: »
    Starting working on a new project recently and met with the technical lead of the company I will be working with. He was going through the design of the application during which we looked at some of the code. It was a case of another MVC application, which was not MVC at all. I questioned this but got a blank stare in response.

    Anyway, I noticed that there were no comments on the code at all, and I mean absolutely none, so I asked him about code commenting and the company standards that were in place relating to same. He replied that they don't comment code as it is "a waste of resources/time", followed by "code is code and if a developer cannot read and understand code, they shouldn't be in the business".

    tumblr_mbjaxkrJzi1roglxl.gif


  • Registered Users, Registered Users 2 Posts: 2,021 ✭✭✭ChRoMe


    My head of operations and project manager asked me what a use case was yesterday.


  • Registered Users, Registered Users 2 Posts: 2,038 ✭✭✭Colonel Panic


    if(pSomething != NULL)
    {
    	if(pSomeThingElse != NULL)
    	{
    		//  200 lines of Stuff
    	}
    }
    
    // Let's change a few globals, I mean singletons here for the craic.
    // And now we'll block the UI thread
    
    return TRUE; // Always true and caller doesn't even check the return value
    


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


    200 lines?


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


    I'm all for commenting code, including doing that little XML documentation at the top of things that you get in Visual Studio.

    But when I am head of a team I will ban the use of GhostDoc and any of those documentation-generating tools. In fact, anyone who produces XML documentation like this:
    /// <summary>
    /// Automatics the convert.
    /// </summary>
    /// <param name="type">The type.</param>
    /// <param name="value">The value.</param>
    /// <returns></returns>
    private object AutoConvert(Type type, string value)
    
    
    /// <summary>
    /// Processes the and save.
    /// </summary>
    private void ProcessAndSave()
    

    will first be sent on a six-week course in English, and then afterwards sacked. No warnings. No mercy.

    (This was more of a rant than a coding horror, but it makes my blood boil to see people using these tools to generate nonsense XML documentation and then not even bother their arse to correct it to something that is actually useful.)


  • Advertisement
  • Moderators, Science, Health & Environment Moderators, Social & Fun Moderators, Society & Culture Moderators Posts: 60,105 Mod ✭✭✭✭Tar.Aldarion




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




  • Registered Users, Registered Users 2 Posts: 4,778 ✭✭✭cython


    Came across this beaut being committed today (variables renamed to remove business-related naming) - this line in a test:
    Assert.assertTrue("Record id's are the same!!", (recordId.longValue() != linkedRecordId.longValue() ));
    
    got changed to be this line:
    Assert.assertTrue("Record id's are the same!!", (recordId.longValue() == linkedRecordId.longValue() ));
    

    So if the test starts failing at this assert, the assertion message is actually lying - cue confusion for developers working on the test down the line!


  • Registered Users, Registered Users 2 Posts: 1,182 ✭✭✭Beef


    ******************  Version 2  *****************
    * User:         [COLOR="Red"]Date: 5/01/01[/COLOR]    Time: 11:10a
    **********/
    MESSAGE "Option available soon" SKIP 
        VIEW-AS ALERT-BOX INFORMATION BUTTONS OK.
    RETURN NO-APPLY.
    

    This code is in our production system. I only found it today. It's coming soon!


  • Registered Users, Registered Users 2 Posts: 7,498 ✭✭✭BrokenArrows


    Beef wrote: »
    ******************  Version 2  *****************
    * User:         [COLOR="Red"]Date: 5/01/01[/COLOR]    Time: 11:10a
    **********/
    MESSAGE "Option available soon" SKIP 
        VIEW-AS ALERT-BOX INFORMATION BUTTONS OK.
    RETURN NO-APPLY.
    

    This code is in our production system. I only found it today. It's coming soon!

    Only 13 years behind schedule.


  • Registered Users, Registered Users 2 Posts: 1,066 ✭✭✭thewheel2.0


    Beef wrote: »
    ******************  Version 2  *****************
    * User:         [COLOR="Red"]Date: 5/01/01[/COLOR]    Time: 11:10a
    **********/
    MESSAGE "Option available soon" SKIP 
        VIEW-AS ALERT-BOX INFORMATION BUTTONS OK.
    RETURN NO-APPLY.
    

    This code is in our production system. I only found it today. It's coming soon!

    Christ there's other people out there developing Progress 4GL/OpenEdge???


  • Registered Users, Registered Users 2 Posts: 18 jonster


    Christ there's other people out there developing Progress 4GL/OpenEdge???
    They were certainly hopeful in 2001 that there would be to make this happen!


  • Closed Accounts Posts: 4,436 ✭✭✭c_man


    BoKf2UWIAAASklj.png


  • Moderators, Science, Health & Environment Moderators, Social & Fun Moderators, Society & Culture Moderators Posts: 60,105 Mod ✭✭✭✭Tar.Aldarion


    Just scrolling through code and had to laugh at the comment above a function:

    /* FIXME */

    :D


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 26,584 ✭✭✭✭Creamy Goodness




  • Technology & Internet Moderators Posts: 28,822 Mod ✭✭✭✭oscarBravo




  • Registered Users, Registered Users 2 Posts: 2,213 ✭✭✭MajesticDonkey


    Despite the name, and unlike <code>DateTime::modify</code>, this function does <i>not</i> modify the DateTimeImmutable object. Code inspection leads me to believe that it <i>copies</i> the DateTimeImmutable object, modifies the copy, and returns that.
    It's still bloody stupid though.


  • Registered Users, Registered Users 2 Posts: 7,498 ✭✭✭BrokenArrows


    long propertyID;
    if (//some validation here)
    {
     // Some stuff
    }
    else
    {
    [B] propertyID = (long)1;[/B]
    }
    
    Why the cast?


  • Moderators, Science, Health & Environment Moderators, Social & Fun Moderators, Society & Culture Moderators Posts: 60,105 Mod ✭✭✭✭Tar.Aldarion


    Because it's a big one.


  • Closed Accounts Posts: 9,046 ✭✭✭Berserker


    long propertyID;
    if (//some validation here)
    {
     // Some stuff
    }
    else
    {
    [B] propertyID = (long)1;[/B]
    }
    
    Why the cast?

    I have seen this with boolean types too.
    var somevar = (bool) false;
    


  • Advertisement
  • Moderators, Technology & Internet Moderators Posts: 1,336 Mod ✭✭✭✭croo


    Code:
    long propertyID;
    if (//some validation here)
    {
    // Some stuff
    }
    else
    {
    propertyID = (long)1;
    }
    Why the cast?
    I've not seen it myself but might it be (mistakenly) instead of adding the L to the end of the literal where it might be misread?

    The literal 1 being an int while 1L is a long value, right? Not that leaving off the L will cause an issue with the value 1. And, of course, if the 1 was replace with a real "long" value (i.e. one larger than allowed by int) it would fail anyway.

    My guess is someone was told to always use the modify to be explicit but they misunderstood!

    I cannot think of any reason why someone would do the same with boolean however.


  • Registered Users, Registered Users 2 Posts: 2,021 ✭✭✭ChRoMe


    Opened up the class I've been asked to retro fit with unit tests (the code is 10 years old).

    The class is 30k lines....


  • Registered Users, Registered Users 2 Posts: 2,038 ✭✭✭Colonel Panic


    One static method in a class with no member variables?


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


    Lads, srsly, stop following me around! :D


  • Registered Users, Registered Users 2 Posts: 7,498 ✭✭✭BrokenArrows


    ChRoMe wrote: »
    Opened up the class I've been asked to retro fit with unit tests (the code is 10 years old).

    The class is 30k lines....

    I have one with 32793
    There are plenty of others around the 20k mark.

    Every time a change request comes in for this software I die a little. Annoying thing was it was discontinued years ago but we have a few customers who refuse to let it go and are paying for continued development.


  • Advertisement
Advertisement