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

191012141522

Comments

  • Registered Users, Registered Users 2 Posts: 6,260 ✭✭✭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, Registered Users 2 Posts: 36,169 ✭✭✭✭ED E


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


  • Registered Users, Registered Users 2 Posts: 6,260 ✭✭✭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, Registered Users 2 Posts: 6,260 ✭✭✭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, Registered Users 2 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, Registered Users 2 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,241 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, Registered Users 2 Posts: 7,518 ✭✭✭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,076 ✭✭✭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, Registered Users 2 Posts: 6,260 ✭✭✭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, Registered Users 2 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, Registered Users 2 Posts: 7,498 ✭✭✭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,076 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, Registered Users 2 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: 9,012 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, Registered Users 2 Posts: 7,498 ✭✭✭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, Registered Users 2 Posts: 6,260 ✭✭✭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: 54,091 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.


  • Registered Users, Registered Users 2 Posts: 1,275 ✭✭✭bpmurray


    What goes around comes around ...

    On a new project, we're trying to optimise the build process and shoehorn it into a proper CI/CD approach. The traditional build process took about 6 hours, and one reason was the inappropriate list of dependencies in the make files. One of the guys pointed out that there was a dependency of one C file on another C file (not a header file) which surprised me. After a little investigation, I realised that it was a piece of wonderful workaround-code that I had written myself in a former existence 16 years ago!

    Hopefully I'm not as daft any more.


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


    bpmurray wrote: »
    One of the guys pointed out that there was a dependency of one C file on another C file (not a header file) which surprised me. After a little investigation, I realised that it was a piece of wonderful workaround-code that I had written myself in a former existence 16 years ago!

    Hopefully I'm not as daft any more.

    I don't see anything wrong with that or that it's bad practice. I think you need to compile the referenced C file, and then place the OBJ where the linker can see it.

    Are you suggesting writing everything in one monolithic C file is good practice, as opposed to splitting code over many C files?


  • Registered Users, Registered Users 2 Posts: 1,275 ✭✭✭bpmurray


    I don't see anything wrong with that or that it's bad practice. I think you need to compile the referenced C file, and then place the OBJ where the linker can see it.

    Are you suggesting writing everything in one monolithic C file is good practice, as opposed to splitting code over many C files?
    No - having something in multiple C files is fine - for this particular subproject there were probably upwards of 100, with about that number of header files too. My point was that having an "#include <file.c>" is, frankly, bizarre - at the very least, it should have been an "#include <file.h>"


  • Registered Users Posts: 428 ✭✭[Rasta]


    This was the best piece of code that I could find in a class I recently looked at.
    private static void UpdateNode(XmlNode theNode, string nodesNewValue)
    {
        theNode.InnerText = nodesNewValue;
    }
    


    I checked through version control and it has never been changed.

    :)


  • Registered Users, Registered Users 2 Posts: 1,465 ✭✭✭Anesthetize


    [Rasta] wrote: »
    This was the best piece of code that I could find in a class I recently looked at.
    private static void UpdateNode(XmlNode theNode, string nodesNewValue)
    {
        theNode.InnerText = nodesNewValue;
    }
    


    I checked through version control and it has never been changed.

    :)
    Such magnificent naming conventions.


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


    I've been working on this right little... so-and-so of an issue since before Christmas. New scrum-master trying to impress others sends a wide email (I don't know if anybody wasn't CCed on it) this morning,
    Hi c_man,

    As we all know, you're behind on *issue*. I was thinking about this, have you considered asking on Stack Overflow?

    :rolleyes: Never thought of that... Oh and I was the one who happened to notice *issue* the day before they were all set to push this out to thousands of customers. But nah, yeah it's my fault.


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


    c_man wrote: »
    I've been working on this right little... so-and-so of an issue since before Christmas. New scrum-master trying to impress others sends a wide email (I don't know if anybody wasn't CCed on it) this morning,

    :rolleyes: Never thought of that... Oh and I was the one who happened to notice *issue* the day before they were all set to push this out to thousands of customers. But nah, yeah it's my fault.

    Only one thing for a person like that.

    Jakes-Epic-Flying-Punch-To-The-Face-On-Adventure-Time-Gif.gif


  • Registered Users, Registered Users 2 Posts: 890 ✭✭✭moycullen14


    c_man wrote: »
    I've been working on this right little... so-and-so of an issue since before Christmas. New scrum-master trying to impress others sends a wide email (I don't know if anybody wasn't CCed on it) this morning,



    :rolleyes: Never thought of that... Oh and I was the one who happened to notice *issue* the day before they were all set to push this out to thousands of customers. But nah, yeah it's my fault.

    I feel your pain. Every high profile issue seems to attract at least one 'Helen Lovejoy' to the email thread. Stating the bleeding obvious, non sequitors and contributing nothing.

    They seem to have an uncanny knack of rubbing salt in the wound. 'As we all know' - tosser.

    Me, I'd call him out on that email - In public. Why did you send it? What were you hoping to achieve? If you had any constructive ideas, why not sit down with me and go through them?

    You could try an troll him by replaying 'What is this Stack Overflow of which you speak?'

    The other approach is to whack him about the head with a keyboard (using the key side, naturally).


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


    I thought about what to do (lots of similar approaches to the above) but I thought the best thing to do was just let it hang there, no reply. Not worth responding to.


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


    You could try an troll him by replaying 'What is this Stack Overflow of which you speak?'
    Or better still, respond with:

    "I'm not sure Stack Overflow is a suitable forum to seek advice on dealing with a scrum master who's being a dick".


  • Advertisement
  • Moderators, Society & Culture Moderators Posts: 17,642 Mod ✭✭✭✭Graham


    djpbarry wrote: »
    Or better still, respond with:

    "I'm not sure Stack Overflow is a suitable forum to seek advice on dealing with a scrum master who's being a dick".

    http://workplace.stackexchange.com/questions/43068/how-to-handle-the-situation-where-the-scrum-master-is-not-supportive

    :D


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


    Programmers will never be free until the last Product Owner is strangled with the entrails of the last Scrum Master.

    Or something like that :P


  • Registered Users, Registered Users 2 Posts: 14,714 ✭✭✭✭Earthhorse


    In my opinion the best response would be, "Thanks for the suggestion, X. After the issue was raised I investigated it <however you investigated it>. This included looking for answers both on Stack Overflow and other online resources. Unfortunately we have moved beyond that now but I will keep you all posted on any progress made.

    Regards,
    c_man


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


    c_man wrote: »
    I've been working on this right little... so-and-so of an issue since before Christmas. New scrum-master trying to impress others sends a wide email (I don't know if anybody wasn't CCed on it) this morning,



    :rolleyes: Never thought of that... Oh and I was the one who happened to notice *issue* the day before they were all set to push this out to thousands of customers. But nah, yeah it's my fault.

    Or you could reply all and say "Hi ScrumMaster, I would like to have a private discussion regarding your suggestion".

    Fairly clear to everyone on the list what your going to say in this private chat.


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


    Or you could reply all and say "Hi ScrumMaster, I would like to have a private discussion regarding your suggestion".

    Fairly clear to everyone on the list what your going to say in this private chat.

    Perhaps. I'm not good with confrontation and as I'm relatively new enough myself, I don't quite feel I could do that just yet. Don't get me wrong, in previous jobs I have done similar.

    Oh well, I fixed the issue and everyone's happy. Though tbh I don't like this job and don't see myself here in 6 months :(


    Edit: And he does seem to rubbing other engineers up the wrong way. Witnessed two arguments this morning over bloody minor things.


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


    Opening a "manager" class, responsible for all manner of threading funkiness. Then I see this...

    #if defined WIN32
    ......
    #elif defined Linux
    //this is guess work! Have no Linux machine


    Repeated throughout the class.


  • Registered Users, Registered Users 2 Posts: 6,260 ✭✭✭Buford T Justice


    c_man wrote: »
    Opening a "manager" class, responsible for all manner of threading funkiness. Then I see this...

    #if defined WIN32
    ......
    #elif defined Linux
    //this is guess work! Have no Linux machine


    Repeated throughout the class.


    and if its a 64 bit?


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


    and if its a 64 bit?

    It won't cause any problems, Win32 is merely an artifact of days gone by.

    From http://msdn.microsoft.com/en-us/library/b0084kay.aspx
    _WIN32
    Defined for applications for Win32 and Win64. Always defined.


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


    c_man wrote: »
    Opening a "manager" class, responsible for all manner of threading funkiness. Then I see this...

    #if defined WIN32
    ......
    #elif defined Linux
    //this is guess work! Have no Linux machine


    Repeated throughout the class.

    What kind of threading was it? Was it something like Posix , (portable Unix standard). The internal data types and native threading are different between Windows and Linux, and there are differences between the standard C data types and OS types. The handling doesn't always work perfectly, hacking a header file may be required....but that doesn't always work. I'd say the guy(or gal) found their code was crashing because something was switching it to the Linux types........and one fix is to cut and paste those defines from a header. The define as linux may not have been necessary, but the code may have been alternative using both types. Header file hacking can work too, but it can lead to a different kind of hell....code that works perfectly in the environment with the hacked headers, but nowhere else, unless you can figure out what's been hacked. (I get a terrible feeling nerds sometimes do this deliberately, to make building their code a frustrating adventure........I've come across this on Linux)

    Using WIN32 as a generic for all windows OS comes from a feature/bug Microsoft created themselves. Code compiled on Windows NT machines, would have WINNT in the exe's as OS type. This could lead to unpredictable behavior.....Windows NT machines could handle WIN32 as well as the WINNT switch.


  • Registered Users, Registered Users 2 Posts: 1,712 ✭✭✭neil_hosey


    One of the "senior" guys in current place on me pushing for TDD..

    Oh yeah go ahead, but don't write too many unit tests because it will slow down the build..

    :mad:


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 1,465 ✭✭✭Anesthetize


    neil_hosey wrote: »
    One of the "senior" guys in current place on me pushing for TDD..

    Oh yeah go ahead, but don't write too many unit tests because it will slow down the build..

    :mad:
    There's "senior" guys where I work who just won't write unit tests full-stop.


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


    There are plenty of small to medium businesses where unit testing is not a reality - Even companies who's main line of business is software as opposed to those that just happen to have some internal software development.


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


    Another horror from StackOverflow:

    https://stackoverflow.com/questions/35634793/how-to-query-a-database-within-a-loop-in-c-sharp

    Some guy is running his SQL queries from embedded Razor in his MVC views. On phone so will post code later in case it is deleted.


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


    Good lord.


  • Registered Users, Registered Users 2 Posts: 36,169 ✭✭✭✭ED E


    Another horror from StackOverflow:

    https://stackoverflow.com/questions/35634793/how-to-query-a-database-within-a-loop-in-c-sharp

    Some guy is running his SQL queries from embedded Razor in his MVC views. On phone so will post code later in case it is deleted.

    Twas
    Page Not Found
    This question was voluntarily removed by its author.

    Here are some similar questions that might be relevant:


    Here's a cached copy:

    Link


  • Registered Users, Registered Users 2 Posts: 24,460 ✭✭✭✭lawred2


    Another horror from StackOverflow:

    https://stackoverflow.com/questions/35634793/how-to-query-a-database-within-a-loop-in-c-sharp

    Some guy is running his SQL queries from embedded Razor in his MVC views. On phone so will post code later in case it is deleted.

    Jesus H Christ


  • Registered Users, Registered Users 2 Posts: 24,460 ✭✭✭✭lawred2


    [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.

    massive spoofer

    go somewhere else


  • Registered Users, Registered Users 2 Posts: 24,460 ✭✭✭✭lawred2


    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.

    looks like an outcome from one of those 'we need to start unit testing our code' meetings


  • Registered Users, Registered Users 2 Posts: 635 ✭✭✭MillField


    There's "senior" guys where I work who just won't write unit tests full-stop.

    I haven't documented a unit test case in months. :eek:


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


    El Reg has started running a regular article on a similar topic. From todays...
    I once found that an end-of-month report for our supply department had a value at the end of the document that had no meaning from a programming perspective. It used a table column that was long obsolete, and even though the data no longer meant anything, the program still reported the value.

    I removed the report entry, and explained to the supply manager the reasons for doing so. His response was, “I have always reported this figure to senior management, I must continue to do so.”

    All that was needed was a simple change to the code:
    Seed = today;
    ReportValue = random(Seed)*1000;
    
    Happy manager. Senior management none the wiser.


Advertisement