• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Code review - hilarious code snippets

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    #11
    Originally posted by russell View Post
    This is common, especially with programmers who came into development using Java and .NET where the runtime holds your hand and makes it easier for mediocre programmers to survive. If they had to code in C/C++ then they would have been weeded out the business early on.
    Those were the days. Writing C because it was the only way to talk to the cgi-bin. The day that the perl::cgi appeared in 1995 is a day I remember celebrating.
    merely at clientco for the entertainment

    Comment


      #12
      Originally posted by jmo21 View Post
      He said it was a test account that he had set up specifically for email functionality testing and couldn't even remember the password for the account.
      Was the account internal? If so the company should have closed it when he left.

      Comment


        #13
        Originally posted by BrilloPad View Post
        Was the account internal? If so the company should have closed it when he left.
        made my post clearer!

        Comment


          #14
          Originally posted by fullyautomatix View Post
          I am currently doing a code review of my fellow developers in a web project written in .NET. Some of the code I have found need to go in some code hall of fame or something.

          1) A senior developer has written a asp.net page and in that entire page the only control is a label control. I was surprised because in the web app that page was a big form with lots of data. I felt like I was looking at the wrong file. Anyway I open up the code behind and this moron has written lines and lines of code concatenating HTML strings and then finally set that string to the label control as text.

          2) Moron developer has put a checkbox list on the page and someone has told him to make it mandatory. He has tried to apply a required field validator to that list but has got an error. Not being able to google an alternative to this limitation, he has used his lateral thinking brains and has put in a div with display set to none and in this div he has put a text box and a required field validator to this text box. On user clicking the checkbox, using javascript he sets a value to the text box. User checks checkbox, value gets set to "invisible" textbox, user does not check any checkbox , the "invisible" textbox is empty and fires required field validation.

          3) Moron developer has to fill a drop downlist. The business layer has given him a List<generic entity>. Instead of doing a direct databind he has looped through the list and added items to the drop down list. All this is done in page load. Goon has not bothered to check for post back. So on every post back the items in the dropdown keep getting doubled. So clever guy has added a line of code on top the clear the items first before adding items. ( a comment has been added to describe this "bug" )

          I can go on and on but really I am at my wits end.
          Move from web forms to MVC. Blame M$ for creating such a terrible hack as web forms that encourages terrible hacks.

          Comment


            #15
            Next time, don't hire a Bob
            'Orwell's 1984 was supposed to be a warning, not an instruction manual'. -
            Nick Pickles, director of Big Brother Watch.

            Comment


              #16
              Originally posted by jmo21 View Post
              I once worked with a contractor who told me the police arrived at his door one day.

              Apparently he'd left some "test" code in a system that went live, which emailed a gmail account live customer data. This "feature" wasn't found until quite a while after he left.

              He said it was a test account that he had set up specifically for email functionality testing and couldn't even remember the password for the account.

              The police believed him.
              That guy sounds like a right mong.

              Comment


                #17
                Originally posted by DimPrawn View Post
                Move from web forms to MVC. Blame M$ for creating such a terrible hack as web forms that encourages terrible hacks.
                web forms work. Its people that are "hard of thinking" and under pressure which are the problem.
                merely at clientco for the entertainment

                Comment


                  #18
                  Originally posted by russell View Post
                  That guy sounds like a right mong.
                  Watch out, Ricky Gervais got panned for using that word!

                  Comment


                    #19
                    Originally posted by eek View Post
                    web forms work. Its people that are "hard of thinking" and under pressure which are the problem.
                    I hope you are not a programmer. This rant sums up my thoughts on ASP.NET

                    "Seriously. How is it possible that something that has had so much money behind it cannot compete with the likes of the open source offerings. For ****'s sake, stop obfuscating my Request and Response variables behind a daft mechanism that requires me to learn an entire page rendering life cycle according to M$ that has almost nothing in common with how web pages are actually created just so I can get something slightly less ordinary done. We aren't all retards you know. I'm pretty sure we can all get to grips with basics of web servers and HTTP protocols. The web is not Windows. We don't need the stupid on-click hierarchy for our code to make sense. At the very least, can you make the viewstate render at a sensible time the page life cycle please?"

                    Oppugn.us: Where The Rants Go

                    Comment


                      #20
                      Originally posted by russell View Post
                      I hope you are not a programmer. This rant sums up my thoughts on ASP.NET

                      "Seriously. How is it possible that something that has had so much money behind it cannot compete with the likes of the open source offerings. For ****'s sake, stop obfuscating my Request and Response variables behind a daft mechanism that requires me to learn an entire page rendering life cycle according to M$ that has almost nothing in common with how web pages are actually created just so I can get something slightly less ordinary done. We aren't all retards you know. I'm pretty sure we can all get to grips with basics of web servers and HTTP protocols. The web is not Windows. We don't need the stupid on-click hierarchy for our code to make sense. At the very least, can you make the viewstate render at a sensible time the page life cycle please?"

                      Oppugn.us: Where The Rants Go
                      I'd agree with the second half of that rant. As for the first bit yes webforms aren't perfect but the original screwups were due to people not thinking rather than webforms themselves. The idea of having a lifecycle is not brilliant but compared to the other options in 2002 it gave options that just didn't otherwise exist.

                      To be honest I don't particularly like them but compared to MVC 1 or dynamic data its impossible to screw up webforms in the way I've seen MVC or dynamic data websites screwed up to the point that a rewrite is the best option.
                      merely at clientco for the entertainment

                      Comment

                      Working...
                      X