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

Options
1161719212237

Comments

  • Registered Users Posts: 1,275 ✭✭✭tobsey


    Remind me of a conversation I had a long time ago.

    The "programmer" didn't know that both .com and .exe were executables in DOS

    Seriously, who didn't know that :o:o


  • Banned (with Prison Access) Posts: 963 ✭✭✭Labarbapostiza


    Remind me of a conversation I had a long time ago.

    The "programmer" didn't know that both .com and .exe were executables in DOS

    I have worse stories, only they're just too unbelievable. Bigger companies are the worst. Their recruitment policies value people who are of the right "type" over the wrong "type" (the wrong type are "know it alls" who make the stupid feel stupid). The bigger companies have can have "coders" who are not even allowed run a compiler. (They do things like emailing a "coder" with precise details of edits they need to make to source files. They just edit the text file, and they don't even know, understand, or care, what the edits do. )

    If I started telling stories, I wouldn't be able to stop, and if I mentioned the name of companies, I'd have angry people wading in to accuse me of lying. Of course I would not be lying. Like if I said, a programmer from Microsoft called a support line, and didn't know what the Internet Explorer was or how to launch it, and then they started crying and hung up the phone, and made complaints about the support tech's meanness, it wouldn't sound believable, and someone working for Microsoft would rush in with accusations of lying. So, it's not a story I'm going to tell.

    (This stuff isn't as funny as it sounds. Some of these companies have people who are not even script kiddies working as software "engineers", there is a name for them I can't remember it's something along the lines of people who can barely manage a GUI. But it results in support calls like "Woah, woah, stop..you're trying to hack me", when the tech agent after a long struggle gets the "engineer" to launch the command line. )


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


    Can't say I've ever heard of Companies preventing "Developers" from doing their jobs, unless they were Support Engineers, given the title of Software Developer.


  • Banned (with Prison Access) Posts: 963 ✭✭✭Labarbapostiza


    Itzy wrote: »
    Can't say I've ever heard of Companies preventing "Developers" from doing their jobs, unless they were Support Engineers, given the title of Software Developer.

    I've heard everything. And don't get me started on the Downton Abbey/Upstairs Downstairs social status nonsense with titles.

    And as I have said, the bigger the companies the worse it is. But you also have small companies where the "guru"/lead developer, doesn't do any development work (just walks around like a C). There's a lot of Twilight Zone out there.


  • Registered Users Posts: 7,500 ✭✭✭BrokenArrows


    Over a year ago our company went through a merger.
    Somehow one of the developers/team leaders got a principal engineers role during the transition between the old and new company. He team lead one person in his previous role!!

    I got put on a project with him and the other guy.
    They're both pretty bad but at least the other guy is just a standard developer.

    I'm having daily calls with these two guys and explaining basic coding principals.
    This "principal" engineer apparently has 20 years of development experience but is relatively new to c# ie. 2 years!!

    Disregarding being new to c# someone which 20 years experience should at least be able to get logic correct. So how does someone like this write code like this:

    Seriously writing a method to compare two strings which is only used once and inside a simple if condition. Nevermind the false == or the empty brackets.
        public IsMatch(string var1, string var2)
        {
            if(var1 == var2)
                return true;
            
            return false;
        }
    
        if(false == IsMatch(Str1, Str2))
        {;}
        {
            // bleh bleh some code. 
    
        }    
    
    

    or another instance where he has 15 nested IF conditions.
    If i ever saw this guys pay packet id probably go on a murder spree.


  • Advertisement
  • Registered Users Posts: 1,717 ✭✭✭Raging_Ninja


    Ternary operators nested 5 deep. Give me strength.


  • Registered Users Posts: 11,977 ✭✭✭✭Giblet


        if(false == IsMatch(Str1, Str2)) 
    

    There is a small argument that because
    bool x = true;
    if(x = false)
    {
    }
    
    is valid, that putting false first is less error prone. It's a very small argument and it should be shortcut anyway, but it exists :D


  • Registered Users Posts: 793 ✭✭✭FobleAsNuck


    Giblet wrote: »
    There is a small argument that because
    bool x = true;
    if(x = false)
    {
    }
    
    is valid, that putting false first is less error prone. It's a very small argument and it should be shortcut anyway, but it exists :D

    in your example x will always be false


  • Registered Users Posts: 13,080 ✭✭✭✭Maximus Alexander


    in your example x will always be false

    I believe that's his point. You couldn't make that mistake if you said
    if(false = x)
    {
    }
    

    because 'twould be a compilation error.


  • Registered Users Posts: 1,717 ✭✭✭Raging_Ninja


    Came across this insanity earlier on StackOverflow:

    http://stackoverflow.com/questions/33996777/task-scheduler-doesnt-work-when-select-run-whether-user-is-logged-in-or-not
    We are using WebBrowser control to download a certain file in console application. We scheduled this console application in task scheduler with this selected option "Run only user is logged on", its working fine. But we scheduled this for "Run whether user is logged in or not". It will not work. We couldn't see any error in command prompt. Can any faced this scenario?

    And in response to my prodding:
    Yes, when we select option "Run only user is logged on". If we turn off the machine, it will not work


  • Advertisement
  • Registered Users Posts: 6,250 ✭✭✭Buford T Justice


    Came across this insanity earlier on StackOverflow:

    http://stackoverflow.com/questions/33996777/task-scheduler-doesnt-work-when-select-run-whether-user-is-logged-in-or-not



    And in response to my prodding:
    Seriously though.......
    replacethedamnuser_zps5105d07f.png


  • Registered Users Posts: 36,164 ✭✭✭✭ED E


    SO users should have to pass "purgatory" of 1000 rep in SU before being allowed to post....


  • Registered Users Posts: 6,250 ✭✭✭Buford T Justice


    ED E wrote: »
    SO users should have to pass "purgatory" of 1000 rep in SU before being allowed to post....

    Much like here, there is an ethos on SO that you have tried the most rudimentary solutions or at least make some effort before posting. One wold think that having the machine turned on would be fall into the former category there.


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


    ED E wrote: »
    SO users should have to pass "purgatory" of 1000 rep in SU before being allowed to post....

    Ah I dunno, I think the rep situation on SO is... lacking. How many times do you find yourself being downvoted for no good/explained reason?

    I (foolishly perhaps) gave an answer to a question which was a little vague recently. After some back and fro with the submitter on the comments to my answer, he updated the original question. Now my answer looked very much out of date and got a heft of downvotes. /disgruntled


  • Registered Users Posts: 6,250 ✭✭✭Buford T Justice


    c_man wrote: »
    Ah I dunno, I think the rep situation on SO is... lacking. How many times do you find yourself being downvoted for no good/explained reason?

    I (foolishly perhaps) gave an answer to a question which was a little vague recently. After some back and fro with the submitter on the comments to my answer, he updated the original question. Now my answer looked very much out of date and got a heft of downvotes. /disgruntled

    Yeah, its very easy to get down voted, I was close to getting banned from posting at one stage in the early days, :o Took a while, but i've built up a decent enough rep there.


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


    StackOverflow is okay. Programmer Stack Exchange has become unworkable ime and it turned me off the network pretty much.


  • Registered Users Posts: 68,317 ✭✭✭✭seamus


    Itzy wrote: »
    Can't say I've ever heard of Companies preventing "Developers" from doing their jobs, unless they were Support Engineers, given the title of Software Developer.
    It does happen in bigger companies. And companies that aren't "software" companies, but who do some in-house programming - they try to develop programming practices based on the legal or regulatory guidelines for their non-software business, and come up with bizarre processes. Banks are notorious for it.

    Role drift can also play a big part. So in the above example, imagine that a company notices that 25% of QA time is being wasted because code can't run/compile and so the QAs are just batting these things straight back to the developers instead of actually doing some testing.
    Someone suggests code reviews - no commits unless its reviewed by another dev. Hurray!

    Six months later, they notice 30% of dev time is spent reviewing, the backlog is growing, and the problem is cumulative.

    They throw more devs into the mix, hurray.

    But then someone notices that payroll has increased by 30% even though the code throughput hasn't. Hang on, why are we paying expensive developers to do nothing but read code instead of writing it? Let's hire graduate developers instead, they can review the code. Woohoo.

    Three years later they've a problem; their grads only stay 3 months on average, and any that do get moved up the ranks are pretty poor coders and know very little about the systems they've been working on. Oh, I see, developers aren't interested in doing nothing but reviewing and committing code. Well, what if we hire data entry clerks? They can be told how to edit the files and compile it, and be given a process to follow if it doesn't. Hurray!

    Two more years pass, the technology is becoming more varied and complex and the maintenance overhead of making sure the data entry clerks have the correct IDEs and compiler versions is nearly beyond control. What if we just have the developers compile their code locally to make sure it works and then send the amendments onto the data entry clerks? Genius!

    And so, ten years after the original process was put in place, the process remains in place more-or-less but the entire point of the process has been lost.

    In very large companies inertia is a big problem with these processes - a new person says, "Hey, what if we just have an automated testing environment that does basic compile and exception checks before moving to QA?", and the response is, "Great idea. Just fill out a process change request form and schedule a summary meeting with your team lead, who will then set up a forwarding meeting with the section manager. If he likes it, he'll discuss it at the monthly regional technology leadership meeting, who will schedule it with the CTO at a quarterly meeting. Though the agenda for these meetings fills up quickly, so it may be 6 months before the CTO has a chance to properly look at it. And we can't change the process without CTO sign-off. Once the CTO has signed off on it, the legal team will have to review it to make sure it's OK and then it'll be passed to the IT department's change process to ensure that it's implemented properly. Once that's done, it goes to the training guys who'll need 3 months to develop a staff training programme and a further 3 months to roll out the new process before it goes live".


    Interestingly enough, the Hawthorne effect suggests that a programmer's code is more likely to be error-free when they know it's going to be reviewed, so there may be some benefit to have a non-programmer "review" code before committing. Bit wasteful though.

    One suggestion in the last place I was in was a script which matched the production logs against the Git commit database and produced a scoreboard which showed whose code was generating the most errors in production. It was originally built to try and find the "owner" of a piece of broken code, but then the potential was realised.

    Unfortunately it was scuppered and the scoreboard, affectionately known as "Wanker of the Week", was permanently mothballed.


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


    ^^^^

    Why I'd rather not work for a multinational, ever again.


  • Registered Users Posts: 428 ✭✭[Rasta]


    I'm in a 3 man development team and I asked the Senior Developer (SD) why we don't have any strategy for working on projects.
    SD says, something along the lines of:
    In the real world there is no time to plan projects, you just have to do stuff as you go along.

    The only way the SD tackles projects is by simply going to 1 meeting to get some specifications from the user and then cracking away writing code.

    And here's me wondering why there is no source control, no project plan, no documentation, no best practices, no software patterns used...
    The SD is adamant on writing everything in one class. If the SD sees more than 2-3 classes in a library you need to rewrite.


    We have an email group for error messages.
    I redirect those into a sub folder.
    It has about 7.5k emails after 6 months or so.
    When I questioned the SD about these, the SD said that i'll get used to seeing the ones that are actually bad errors

    I checked one of the server's event viewer.
    About 4k error entries in there.

    There is possibly new management rolling in, so I'm sure they'd spot and sort this madness.
    Gladly the other Developer is on the same page as me, so there seems to be a bit of hope.


  • Registered Users Posts: 7,515 ✭✭✭matrim


    [Rasta] wrote: »
    I'm in a 3 man development team and I asked the Senior Developer (SD) why we don't have any strategy for working on projects.
    SD says, something along the lines of:
    In the real world there is no time to plan projects, you just have to do stuff as you go along.

    The only way the SD tackles projects is by simply going to 1 meeting to get some specifications from the user and then cracking away writing code.

    And here's me wondering why there is no source control, no project plan, no documentation, no best practices, no software patterns used...
    The SD is adamant on writing everything in one class. If the SD sees more than 2-3 classes in a library you need to rewrite.


    We have an email group for error messages.
    I redirect those into a sub folder.
    It has about 7.5k emails after 6 months or so.
    When I questioned the SD about these, the SD said that i'll get used to seeing the ones that are actually bad errors

    I checked one of the server's event viewer.
    About 4k error entries in there.

    There is possibly new management rolling in, so I'm sure they'd spot and sort this madness.
    Gladly the other Developer is on the same page as me, so there seems to be a bit of hope.

    Even with new management I'd say get out now. They will listen to the senior dev and things will continue.


  • Advertisement
  • Subscribers Posts: 4,075 ✭✭✭IRLConor


    matrim wrote: »
    Even with new management I'd say get out now. They will listen to the senior dev and things will continue.

    And even if they don't and they get rid of or re-educate the senior developer, you'll end up cleaning up the old mess for years to come.

    Best cut your losses and go somewhere else.


  • Registered Users Posts: 6,250 ✭✭✭Buford T Justice


    [Rasta] wrote: »
    I'm in a 3 man development team and I asked the Senior Developer (SD) why we don't have any strategy for working on projects.
    SD says, something along the lines of:
    In the real world there is no time to plan projects, you just have to do stuff as you go along.

    The only way the SD tackles projects is by simply going to 1 meeting to get some specifications from the user and then cracking away writing code.

    And here's me wondering why there is no source control, no project plan, no documentation, no best practices, no software patterns used...
    The SD is adamant on writing everything in one class. If the SD sees more than 2-3 classes in a library you need to rewrite.


    We have an email group for error messages.
    I redirect those into a sub folder.
    It has about 7.5k emails after 6 months or so.
    When I questioned the SD about these, the SD said that i'll get used to seeing the ones that are actually bad errors

    I checked one of the server's event viewer.
    About 4k error entries in there.

    There is possibly new management rolling in, so I'm sure they'd spot and sort this madness.
    Gladly the other Developer is on the same page as me, so there seems to be a bit of hope.

    Wow, that's all I can say. The place I work are fairly bad but at least they've heard of source control and proper OO design principles


  • Registered Users Posts: 13,104 ✭✭✭✭djpbarry


    [Rasta] wrote: »
    I'm in a 3 man development team and I asked the Senior Developer (SD) why we don't have any strategy for working on projects.
    SD says, something along the lines of:
    In the real world there is no time to plan projects, you just have to do stuff as you go along.

    The only way the SD tackles projects is by simply going to 1 meeting to get some specifications from the user and then cracking away writing code.

    And here's me wondering why there is no source control, no project plan, no documentation, no best practices, no software patterns used...
    The SD is adamant on writing everything in one class. If the SD sees more than 2-3 classes in a library you need to rewrite.


    We have an email group for error messages.
    I redirect those into a sub folder.
    It has about 7.5k emails after 6 months or so.
    When I questioned the SD about these, the SD said that i'll get used to seeing the ones that are actually bad errors

    I checked one of the server's event viewer.
    About 4k error entries in there.

    There is possibly new management rolling in, so I'm sure they'd spot and sort this madness.
    Gladly the other Developer is on the same page as me, so there seems to be a bit of hope.
    I work in a one-man development team in an academic environment - I've never actually worked with other developers.

    But, even I know that all of the above is appallingly bad practice.

    Get out.

    Now.


  • Registered Users Posts: 7,500 ✭✭✭BrokenArrows


    Had a look at some of our automated tests today and came across this test class which dozens of test methods like this:
    [TestMethod()]
    public void OpenTimeTest()
    {
        MyClass target = new MyClass();
        target.OpenTime = DateTime.Now;
        DateTime ActualTime = target.OpenTime;
        Assert.AreEqual(target.OpenTime, ActualTime);
    }
    

    The OpenTime is a field so no work is being done when it is set.

    I guess someone just wants to see lots of green ticks beside their automated tests.


  • Moderators, Arts Moderators, Regional Abroad Moderators Posts: 11,011 Mod ✭✭✭✭Fysh


    I'm a sysadmin rather than a developer, but dealing with Microsoft infrastructure means writing and maintaining PowerShell scripts that will be used/maintained by a number of people - at least, if you like doing things the smart way. While trying to figure out a problem for someone in another team who was using an Exchange 2010 PowerShell script that had been supplied by my team, I discovered the following:
    • the script uses try-catch blocks, but the catch block ignores that more than one error could trigger it and returns a text string specifying one particular error rather than the actual error message;
    • the script is triggered, for no reason I can see, from a batch file, which in turn is called from an AutoIt executable;
    • looking at the AutoIt script in question shows that it requires access to a specific network share for an input file (which is referenced using a drive mapping rather than a UNC path), but the script doesn't test if the mapping exists or attempt to map it, just fails gracelessly if the mapping isn't available;
    • the only reason for using an AutoIt executable that anyone could give me was to "obfuscate what was being done";
    • the whole thing is configured to run as a scheduled task using a service account at 4am, but only if the service account is logged on to an interactive session on the server, for what were described as "security reasons". (This would be a service account which is also regularly used by other teams to do all sorts of things, because it has a truly stupid number of memberships to privileged groups/roles);
    • the service account doesn't have a persistent mapping to the required network path, so every time the server reboots automatically after patching, the scheduled tasks fail until someone remembers to log in as the service account and manually map the drive.

    Fortunately, this is soon to be my previous role...


  • Registered Users Posts: 13,080 ✭✭✭✭Maximus Alexander


    I've worked in the same company for a good number of years now, and have changed role a couple of times. My original role was in IT, but in a niche sub-team (almost a mini-department in itself) and the role was not development related. At some point I decided I wanted to get into development and started consuming books on the topic and began putting it to use by developing little one-off tools in Java to help the team save time on regular, repetitive tasks. I knew how to write code that worked, but not good code.

    I have long since moved into an actual development role and am a far more accomplished coder than I was then (though still learning every day). I'm in a different department on a different floor, working on totally different projects, but it turns out my old team are still using some of those tools I knocked together back then. Just got a call from a friend on the old team who asked me to do him a favour and make a small tweak to one of the tools. Opened the code and it's wall to wall coding horror!

    I'm in a unique situation on this thread where the person I hate is my former self.

    A few quick examples:

    A 100 line method housing a switch statement where all of the logic for each of the cases is written in the switch, rather than farmed out to other methods, despite the fact that they are broadly repetitive.

    All debug logs from testing were just written to the project root, so the package explorer is just filled with debug log files.

    All classes are in the default package.

    Utility classes that have names beginning with 'My' :o

    Magic numbers (well, magic strings) litter the code, plenty of which are the same string.

    It's a horror show. I hate myself.


  • Moderators, Science, Health & Environment Moderators Posts: 8,811 Mod ✭✭✭✭mewso


    It's a horror show. I hate myself.

    I doubt you're the only one. I still regularly update code on projects I wrote over 10 years ago. Thats guaranteed grimacing on a daily basis but if the boss gives you two weeks to develop a crm solo from scratch then they get what they deserve if you ask me. The constant phrase for me is "Just fix this bit now. One of these days I'll rewrite it all from scratch".


  • Registered Users Posts: 7,500 ✭✭✭BrokenArrows


    Yes i used to have to revisit my code that i wrote when i was still learning.
    Thankfully that job has been farmed out to another team.

    Occasionally i find out that some program or other has a change request and i just know that whoever ends up doing the change request would be posting in this thread if they were irish!!


  • Registered Users Posts: 6,250 ✭✭✭Buford T Justice



    I'm in a unique situation on this thread where the person I hate is my former self.

    Ermm, no. Your're not. I've had the same problems when I look back at code I wrote in the early days. I even have some change requests for a project that I wrote 18 months ago and some of the code in it is a cringe fest.


  • Advertisement
  • Administrators Posts: 53,355 Admin ✭✭✭✭✭awec


    I have worse stories, only they're just too unbelievable. Bigger companies are the worst. Their recruitment policies value people who are of the right "type" over the wrong "type" (the wrong type are "know it alls" who make the stupid feel stupid). The bigger companies have can have "coders" who are not even allowed run a compiler. (They do things like emailing a "coder" with precise details of edits they need to make to source files. They just edit the text file, and they don't even know, understand, or care, what the edits do. )

    If I started telling stories, I wouldn't be able to stop, and if I mentioned the name of companies, I'd have angry people wading in to accuse me of lying. Of course I would not be lying. Like if I said, a programmer from Microsoft called a support line, and didn't know what the Internet Explorer was or how to launch it, and then they started crying and hung up the phone, and made complaints about the support tech's meanness, it wouldn't sound believable, and someone working for Microsoft would rush in with accusations of lying. So, it's not a story I'm going to tell.

    (This stuff isn't as funny as it sounds. Some of these companies have people who are not even script kiddies working as software "engineers", there is a name for them I can't remember it's something along the lines of people who can barely manage a GUI. But it results in support calls like "Woah, woah, stop..you're trying to hack me", when the tech agent after a long struggle gets the "engineer" to launch the command line. )

    Actually the wrong type is usually the know it all who really isn't as smart as they think. If they are the sort of person that belittles other people then that's just icing on the cake for rejection really.


Advertisement