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

13132333436

Comments

  • Registered Users Posts: 4,325 ✭✭✭iLikeWaffles


    test



  • Registered Users Posts: 4,325 ✭✭✭iLikeWaffles


    test
    
    
    test
    


  • Registered Users Posts: 4,325 ✭✭✭iLikeWaffles


    test



  • Registered Users Posts: 4,325 ✭✭✭iLikeWaffles


    lol




  • Registered Users Posts: 4,325 ✭✭✭iLikeWaffles


    tset



  • Advertisement
  • Registered Users Posts: 4,325 ✭✭✭iLikeWaffles


    feel free to delete no issue in this on this page of the thread with a codeblock. Unless it is the use of multiple codeblocks in a thread?!



  • Registered Users Posts: 10,817 ✭✭✭✭the_amazing_raisin


    I was wondering if this thread was becoming the definition of it's title 😁

    "The internet never fails to misremember" - Sebastian Ruiz, aka Frost



  • Registered Users Posts: 1,459 ✭✭✭Anesthetize


    ^ Was that the forum equivalent of adding "Here" print statements while trying to debug your code? 😄



  • Registered Users Posts: 17,496 ✭✭✭✭Mr. CooL ICE


    DATEADD(day, -6+14, getdate())
    

    Like, it being a parameter in dateadd(), I assume it has to be 6 days before a two week period, but writing this way must have meant something to the developer (long gone) who wrote this. But why not just put in 8 and add a comment? Bizarre



  • Registered Users Posts: 793 ✭✭✭FobleAsNuck



    >The music files you purchase from the Apple Music Store (AMS; formerly the iTunes Music Store) contain approximately 6 % of the digital equivalent of nothingness. I’m not referring to silence, but continuous blocks of empty space set aside inside the files. It serves no purpose other than to pad the files to make them 0,5 MB larger.



  • Advertisement
  • Registered Users Posts: 17,496 ✭✭✭✭Mr. CooL ICE


    Again, less a horror and more a jaded previous developer. In this case, a simple RETURN -1 could have sufficed:


    IF TRUE
    	-- Do SQL-ey stuff
    ELSE
    BEGIN
    	PRINT 'today is not the day to do this';
    END;
    


  • Registered Users Posts: 49 d mc


    public class Order
    {
        public int Id { get; set; }
        public int Quantity { get; set }
    }
    

    Somewhere in a PR....

    David, your code coverage has dropped.....

    ...

    But I only added one class...

    ...

    But we can't let our coverage drop ...

    *deep sigh*

    [Test]
    public void DumbestFuckingTestOnEarth()
    {
        var order = new Order 
        {
            Id = 7,
            Quantity = 100
        };
    
        Assert.Equal(order.Id, 7);
        Assert.Equal(order.Quantity, 100);
    }
    


    Great job David!




  • Registered Users Posts: 2,565 ✭✭✭PommieBast


    A few companies ago we were told that the code coverage was too low. Turned out the devel who got the best increase in coverage did so by stripping out various sanity checks. 😖



  • Registered Users Posts: 1,459 ✭✭✭Anesthetize


    I assume that the class(es) that are using that new Order class already have their own unit tests? Did the code you modified to use an Order object not already have unit test coverage?

    It looks like an issue with existing test coverage.



  • Registered Users Posts: 49 d mc


    My point was - the tests I had to add to raise coverage was effectvely unit testing the get set properties provider by .net... completely useless

    var x = 5

    Assert.Equal(x, 5)



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


    So are there tests that use the Order POCO or not? Apart from the pointless ones you list.



  • Registered Users Posts: 442 ✭✭RickBlaine


    Not the worst offense but I was looking at a method I wrote myself in a personal project a few months ago and found code structured like this:

    if (myObject is null)
    {
       myObject = new myObject();
       DoSomething(myObject);
    } else 
    {
       DoSomething(myObject);
    }
    

    Not sure what I was thinking at the time. I guess I wasn't thinking clearly in the middle of a late night coding session. I refactored it to:

    if (myObject is null)
    {
       myObject = new myObject();
    }
    DoSomething(myObject);
    


  • Registered Users Posts: 10,817 ✭✭✭✭the_amazing_raisin


    There's a point where caffeine can no longer help 😂

    "The internet never fails to misremember" - Sebastian Ruiz, aka Frost



  • Registered Users Posts: 27,031 ✭✭✭✭GreeBo


    Trying to debug an issue this week and found that the code has been deliberately changed from the original code to create the bug.

    Checked the git commit message to find:

    "Making the code changes as per the user story"

    No mention of the story of course. FML.



  • Registered Users Posts: 10,817 ✭✭✭✭the_amazing_raisin


    Ah, this is what you call job security. Write deliberately buggy or poorly optimised code for the initial release

    Then in the weeks before your annual review you suddenly roll out a bunch of "improvements" and put down a 500% performance enhancement as your accomplishments for the year

    I'm guessing since you're fixing someone else's code that strategy didn't work for them 😂

    "The internet never fails to misremember" - Sebastian Ruiz, aka Frost



  • Advertisement
  • Registered Users Posts: 27,031 ✭✭✭✭GreeBo


    Well when I say "deliberately changed" I dont mean they made a bug on purpose. More that the result was the expected result.

    But now no one knows why as the requirement is unavailable.


    Its people like this who dont have any understanding of why we have coding and check-in standards and they get annoyed when the commit hook fails their check-in so they just put in rubbish.



  • Registered Users Posts: 6,487 ✭✭✭daymobrew


    Was the company paying people to fix bugs per the Dilbert classic: https://www.reddit.com/r/ProgrammerHumor/comments/k5hka0/bug_free_programs_a_dilbert_classic/



  • Registered Users Posts: 27,031 ✭✭✭✭GreeBo


    No, it was part of another requirements change....just no one know what or why now, since the commit comment doesnt refer to anything.



  • Registered Users Posts: 9,555 ✭✭✭DublinWriter


    I worked as a 'code monkey' for most of my career, before landing a hands-on IT Project Leader for a big multinational in the mid-90s.

    In the second week there, the IT Manager came in and plonked a bill from Eircom for £20,000IEP for a months worth of usage on an ISDN line we had linking our Dublin office to our Belfast office so they could run a terminal session to our IBM AS/400.

    A week later, the Belfast office get a £17,000GBP bill from BT for the same ISDN line for the same period.

    The link should be costing the company around £400 a month to operate, but suddenly it's now £40,000.

    Just before I joined, the company had employed a small two-man Dublin based company to set up the ISDN network link between the two offices and the Netware file server in the Belfast office.

    I contact the initial two man company who set up the link, but they're next to useless.

    Coming from a coding background, I pull out the gigantic ring-binder manual for the Cisco router and get cracking. I also get hold of some packet sniffing software. It's all new to me and totally daunting.

    Again, this is going to turn into a long IT war-story, so let me know if you want Part II.



  • Registered Users Posts: 24,208 ✭✭✭✭recode the site


    Rather a dated technology and evidently extremely bad value for a slow (in modern terms) data packet transfer.

    Can I get away with anything if I pay the piper, so to speak?



  • Registered Users Posts: 5,454 ✭✭✭Charles Babbage


    Not a dated technology in the mid 90s when the poster was doing this.

    I expect that both lines were dialling into America or some such, but it would be interesting to know if this was a code error or bad design.



  • Registered Users Posts: 22,002 ✭✭✭✭Esel


    Jebus, I knew ISDN lines were expensive back in the day, but that's crazy!

    Not your ornery onager



  • Registered Users Posts: 24,208 ✭✭✭✭recode the site


    Lol, got the timeline wrong 🤣 was wondering what a company was doing with such a line in modern times

    Can I get away with anything if I pay the piper, so to speak?



  • Registered Users Posts: 5,454 ✭✭✭Charles Babbage


    The past was a different place, at least in relation to technology




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


    ...let me know if you want Part II.

    I, for one, need closure on this anecdote.



Advertisement