• 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

    Code review - hilarious code snippets

    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.
    Vote Corbyn ! Save this country !

    #2
    You should submit them here:

    The Daily WTF: Curious Perversions in Information Technology
    "A life, Jimmy, you know what that is? It’s the s*** that happens while you’re waiting for moments that never come." -- Lester Freamon

    Comment


      #3
      Take the developers out and shoot them. It's kinder that way. Shoot them in the heart, not the head, as they have no brain to damage.
      Down with racism. Long live miscegenation!

      Comment


        #4
        Try being in infrastructure. Then you'd find that even the supposedly good developers write tulip abstract code.

        I'm often finding software that is meant to be for a distributed server environment being written as if it all runs off one server. Lets take middleware....Why exactly would the server in the application tier be able to find a file dropped onto the C: drive by the SQL server? And why must your tulipty code have hard-coded URIs to talk to 'localhost' when you're trying to talk to a web service in a completely different network?

        Stoopid devs

        Comment


          #5
          SY01 is trying his hardest. Stop being so mean.
          Originally posted by MaryPoppins
          I'd still not breastfeed a nazi
          Originally posted by vetran
          Urine is quite nourishing

          Comment


            #6
            Eons ago, when we used to write real code our chief analyst banned the use of of the Cobol "goto" statement.

            We reached a compromise where we could have 1 "goto" in a program (usually in an logic abend situation) for which I wrote the "RSPCA" logic to record dump details. The "goto" statement had to be "if Cat = Dog goto RSPCA"....

            Great fun during code reviews....
            Any sufficiently advanced technology is indistinguishable from magic

            Comment


              #7
              Neg rep - Do not bad mouth your collegues on a public board. AtW

              AtW, you need help mate. But you are correct, instead of coming on here I need to kick all their butts.
              Vote Corbyn ! Save this country !

              Comment


                #8
                This is why I refuse to work with code monkeys, they are only people behind testers on the evolutionary scale
                Originally posted by Stevie Wonder Boy
                I can't see any way to do it can you please advise?

                I want my account deleted and all of my information removed, I want to invoke my right to be forgotten.

                Comment


                  #9
                  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.

                  Comment


                    #10
                    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.
                    Last edited by jmo21; 13 February 2012, 10:52.

                    Comment

                    Working...
                    X