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! We have been experiencing an issue on site where threads have been missing the latest postings. The platform host Vanilla are working on this issue. A workaround that has been used by some is to navigate back from 1 to 10+ pages to re-sync the thread and this will then show the latest posts. Thanks, Mike.
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

1161718192022»

Comments

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


    test



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


    test
    
    
    test
    


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


    test



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


    lol




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


    tset



  • Advertisement
  • Registered Users, Registered Users 2 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, Registered Users 2 Posts: 11,901 ✭✭✭✭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, Registered Users 2 Posts: 1,465 ✭✭✭Anesthetize


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



  • Registered Users, Registered Users 2 Posts: 17,644 ✭✭✭✭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, Registered Users 2 Posts: 798 ✭✭✭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, Registered Users 2 Posts: 17,644 ✭✭✭✭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, Registered Users 2 Posts: 2,805 ✭✭✭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, Registered Users 2 Posts: 1,465 ✭✭✭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, Registered Users 2 Posts: 2,029 ✭✭✭Colonel Panic


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



  • Registered Users, Registered Users 2 Posts: 607 ✭✭✭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, Registered Users 2 Posts: 11,901 ✭✭✭✭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, Registered Users 2 Posts: 27,253 ✭✭✭✭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, Registered Users 2 Posts: 11,901 ✭✭✭✭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, Registered Users 2 Posts: 27,253 ✭✭✭✭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, Registered Users 2 Posts: 6,523 ✭✭✭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, Registered Users 2 Posts: 27,253 ✭✭✭✭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, Registered Users 2 Posts: 9,559 ✭✭✭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.





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



  • Registered Users, Registered Users 2 Posts: 5,898 ✭✭✭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.

    Post edited by Boards.ie: Paul on


  • Registered Users, Registered Users 2 Posts: 22,505 ✭✭✭✭Esel


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

    Not your ornery onager





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



  • Registered Users, Registered Users 2 Posts: 5,898 ✭✭✭Charles Babbage


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


    Post edited by Boards.ie: Paul on


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


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

    I, for one, need closure on this anecdote.



  • Registered Users, Registered Users 2 Posts: 8,096 ✭✭✭Tow


    A Board's Coding Horror:


    When is the money (including lost growth) Michael Noonan took in the Pension Levy going to be paid back?



  • Registered Users, Registered Users 2 Posts: 11,901 ✭✭✭✭the_amazing_raisin


    I remember my brother being given one of those before packing off on a J1 to the US (or rather, the international equivalent)

    It was for calling home every week, had something like £100 on it to start in case he needed to make an emergency call

    The clown blew threw the whole balance in the space of a week from calling his long distance girlfriend who dumped him about a week later 😂

    Parents told him if he called again he'd be paying the phone bill before they'd buy him a flight home. I think this was the days you got charged for receiving international calls as well

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



  • Registered Users, Registered Users 2 Posts: 11,901 ✭✭✭✭the_amazing_raisin


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



  • Registered Users, Registered Users 2 Posts: 35,492 ✭✭✭✭Hotblack Desiato


    He must have been reversing the charges (and they foolishly let him). You didn't get charged for receiving calls.

    Scrap the cap!



  • Registered Users, Registered Users 2 Posts: 5,898 ✭✭✭Charles Babbage


    Probably not. The Eircom card stored its value on the chip, but of course only an appropriate payphone could read this, it did not travel.

    Most likely the $100 was on a calling card, where you dial a freephone number and then enter the card number. You could use these from any phone and were a good way of avoiding high international charges on the regular tariff. I used use Swiftcall and gave such "cards" to family members as presents. On my first mobile I could make international calls effectively this way, the phone had a feature that if you held down the send button it automatically called the freephone number and then sent the number you were dialling, instead of allowing Digifone gouge me.

    As noted in the previous post there was no charge for receiving calls, but you could reverse charges. But by the 90s you would be a tightwad if you did this, since by then 7-11s in the US had cards on sale and their rates were a fraction of reversing charges, so you parents were spot on.



  • Advertisement
  • Registered Users, Registered Users 2 Posts: 9,559 ✭✭✭DublinWriter


    So, the ISDN connection was set-up on the Cisco to 'spoof' a permanent fixed-line connection.

    Unlike traditional dial-up, ISDN could establish a connection almost instantly.

    The original selling-point of ISDN 'spoofing' was it was supposed to be cheaper than a fixed leased-line.

    So if a user in Belfast wanted to establish a terminal session to our mainframe in Dublin, it would do so almost immediately as if they were already on our network. The Cisco routers were configured to make the call once it saw a user sending packets to a particular port.

    When I analyzed the bills from both Eircom and BT, where were dozens of calls being made per-second between both networks. Standard call cost at the time was about 20p, so imagine that happening dozens of times a second, 24/7 for months.

    I really felt totally out of my depth coming from a coding background, using a packet sniffer and trying to decode and monitor what traffic was triggering the connections. It was late one Friday evening and I was about to give up when suddenly I saw some strange traffic on a very unfamiliar port coming through that was triggering the ISDN connection.

    Looking up the port, it was one used by tape backup software called Arcserve, which the small provider company set up on the Netware servers in both Dublin and Belfast. It was just a service-advertisement packet, but it was triggering the ISDN to connect.

    When I checked how the company filtered the ports on the Cisco to trigger the ISDN, they started with the premise of allowing everything but just putting a deny list of known packets they didn't want to trigger the connection.

    WRONG!!!1!! I learnt later that you start from the position of denying everything and only allowing known calls to known ports through. They had gone totally the other way around it - allow everything and provide a deny list. They had totally neglected to filter out the port used by the Arcserve software.

    Apparently we weren't the only company 'stung' by so-called exports setting up routers incorrectly for ISDN spoofing and resulting in mega-bucks phone bills. Eircom issued an advisory letter to all it's ISDN business customers later that year.

    In retrospect, the company were a small-two man operation in Dublin that were completely chancing their arm when it came to setting up Cisco routers and out of their depth.

    And did this lead me to having a successful change of a career-path into Networking and router configuration? Like f*ck it did! It was fun, but no thanks!



  • Registered Users, Registered Users 2 Posts: 9,559 ✭✭✭DublinWriter


    Again, network related, but this one is straight out of Dilbert.

    A lot of shops in the 90's were running IBM Token-Ring networks, as opposed to Ethernet.

    Basically Token-Ring is supposed to be a contention-less network. There's a 'token' passed round-robin between nodes that acts as a 'talking-pillow', so only nodes in possession of the token can transmit on the network.

    They were upgrading said Token Ring network from 4Mbps to 16Mbps as they were having performance issues.

    The company CIO had to brief other senior management on the project and why they were spending so such money on it.

    Brace yourselves. He said that the upgrade project was essential because the current high traffic on the network was causing the token to be ejected from the ring due to centrifugal force.



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


    I lolled.

    Oof, I remember star-wired token rings, with fibre segments joining the MSAUs. Big chunky square connectors - what were they called, type 2 or something? The MSAUs were powered by the devices connected to the ring, and each port had a relay to steer traffic to the connected device when power was applied from that device.

    Them was the days, Joxer. Them was the days.



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


    @DublinWriter

    When I analyzed the bills from both Eircom and BT, where were dozens of calls being made per-second between both networks. Standard call cost at the time was about 20p, so imagine that happening dozens of times a second, 24/7 for months.

    So it was basically doing a call per packet rather than maintaining any sort of persistence? 😲



  • Registered Users, Registered Users 2 Posts: 8,096 ✭✭✭Tow


    Those IBM Token Ring cards were big bucks, especially the 16Mbps version. I place I worked for spent over 2M upgrading a building to use them. This was on instruction of 'Head Office'. Our IT wanted to to use 10 Base T Ethernet. The kicker was the IBM Mainframe was not 100% 'compatible' with them and always had issues. Even after the experts from IBM were flown in from the States to sort it out. We had the IBM hardware division blaming the IBM software division... Another manufacturers mainframe worked fine on the network! Within a year or two 100 Base T had come out and the cards and routers were much cheaper.

    When is the money (including lost growth) Michael Noonan took in the Pension Levy going to be paid back?



  • Advertisement
  • Registered Users, Registered Users 2 Posts: 9,559 ✭✭✭DublinWriter



    SNA was a nightmarish network architecture. I installed Novel Netware for SNA in a few shops back in the day to bridge TR/SNA networks to Ethernet/IPXSPX networks with 5250/3270 terminal emulation software installed on the PC clients.



  • Registered Users, Registered Users 2 Posts: 9,559 ✭✭✭DublinWriter



    True. As late as 2005 I had to get Eircom to install an ISDN line to my house (was in Meath) as we were on what's called a 'group line' shared on the local exchange with five other houses. Great for voice, but even with a 56Kbps modem, you'd be lucky if you got a 9Kbps connection.

    In 2005 Eircom at the time said that BB couldn't be installed at my house. So once I got ISDN, I was taken off the 'group line' and suddenly my number was compatible for Broadband, which I ordered the month after I had the ISDN installed.

    Crazy times.



  • Registered Users, Registered Users 2 Posts: 9,559 ✭✭✭DublinWriter


    No. The backup software the company installed was triggering the connect via a service advertisement packet on a port they didn't anticipate when they where configuring the Cisco routers.



  • Registered Users, Registered Users 2 Posts: 607 ✭✭✭RickBlaine


    I developed an API to be consumed by one of my clients. I sent the API documentation to the client's project manager.

    A few weeks later their developers had developed their solution to call my API but were getting invalid request errors. I asked them if they were referencing the correct documentation and they said they were. The version number matched the version I had sent the PM. But looking at their JSON in their requests, they were definitely not matching my spec. It turns out that their PM incorrectly thought I had made mistakes in the document and took it upon himself to make changes without informing anyone or even incrementing the version number of the document.



  • Registered Users, Registered Users 2 Posts: 12,605 ✭✭✭✭Flinty997


    Our dept created an API to talk to another organisations system and never asked the team who worked on the source application what all the events were. Was weeks later when they realised it wasn't sending all the events. Or even that they were for..

    Worked in another place and the token ring network would always go down the same time Fri afternoon. Took them a while to realise that it was one of the managers taking their pc home for the weekend.



  • Registered Users, Registered Users 2 Posts: 12,605 ✭✭✭✭Flinty997


    Final story about ISDN was working as a contractor for the provider of ISDN lines and couldn't get a ISDN line installed in their own building. They said it would take 6 months. In their own building. Name of the building. Telecom house.



Advertisement