Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Weird and The Wonderful
  4. What the elephant did I just step in?

What the elephant did I just step in?

Scheduled Pinned Locked Moved The Weird and The Wonderful
questioncsharpasp-netcom
12 Posts 9 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Dave Kreskowiak
    wrote on last edited by
    #1

    Picture this. VB.NET code written by a newb that needs to be updated with some support for a new file format. I'm looking at a single method that's 17 pages(!) long and doesn't return anything. It contains NINETY EIGHT If statements. Some are chained together with ElseIf, some are nested down to five levels deep. There is lots of this:

    If _condition-expression_ Then
        ' Do nothing
    ElseIf _condition-expression_ Then
        If _condition-expression_ Then
            ' Empty block
        Else
            ' Holy elephant, do something here!
        EndIf
    ElseIf _condition-expression_ Then
        ' Holy elephant, do something here!
    ElseIf _condition-expression_ Then
        ' Yeah, another empty block here too!
    Else
        ' Oh! And this block is empty too.
    

    End If

    Shoot me. Please. I beg of you.

    System.ItDidntWorkException: Something didn't work as expected. A guide to posting questions on CodeProject

    Click this: Asking questions is a skill. Seriously, do it.
    Dave Kreskowiak

    M R M Sander RosselS N 7 Replies Last reply
    0
    • D Dave Kreskowiak

      Picture this. VB.NET code written by a newb that needs to be updated with some support for a new file format. I'm looking at a single method that's 17 pages(!) long and doesn't return anything. It contains NINETY EIGHT If statements. Some are chained together with ElseIf, some are nested down to five levels deep. There is lots of this:

      If _condition-expression_ Then
          ' Do nothing
      ElseIf _condition-expression_ Then
          If _condition-expression_ Then
              ' Empty block
          Else
              ' Holy elephant, do something here!
          EndIf
      ElseIf _condition-expression_ Then
          ' Holy elephant, do something here!
      ElseIf _condition-expression_ Then
          ' Yeah, another empty block here too!
      Else
          ' Oh! And this block is empty too.
      

      End If

      Shoot me. Please. I beg of you.

      System.ItDidntWorkException: Something didn't work as expected. A guide to posting questions on CodeProject

      Click this: Asking questions is a skill. Seriously, do it.
      Dave Kreskowiak

      M Offline
      M Offline
      madwilliamflint
      wrote on last edited by
      #2

      So do you guys really have no process for vetting noobcode?

      D 1 Reply Last reply
      0
      • D Dave Kreskowiak

        Picture this. VB.NET code written by a newb that needs to be updated with some support for a new file format. I'm looking at a single method that's 17 pages(!) long and doesn't return anything. It contains NINETY EIGHT If statements. Some are chained together with ElseIf, some are nested down to five levels deep. There is lots of this:

        If _condition-expression_ Then
            ' Do nothing
        ElseIf _condition-expression_ Then
            If _condition-expression_ Then
                ' Empty block
            Else
                ' Holy elephant, do something here!
            EndIf
        ElseIf _condition-expression_ Then
            ' Holy elephant, do something here!
        ElseIf _condition-expression_ Then
            ' Yeah, another empty block here too!
        Else
            ' Oh! And this block is empty too.
        

        End If

        Shoot me. Please. I beg of you.

        System.ItDidntWorkException: Something didn't work as expected. A guide to posting questions on CodeProject

        Click this: Asking questions is a skill. Seriously, do it.
        Dave Kreskowiak

        R Offline
        R Offline
        raddevus
        wrote on last edited by
        #3

        Wait! I think I know that guy who wrote that method. I mean, there couldn't be two people in the world that would do that could there? :~ I thought he was drummed out of development years ago though. EDIT Oh, wait, our guy didn't use methods. He wrote all of his code copy/past style and it was something like 20 pages long too. It was the same for loop copy pasted over and over. And, it was in prod and it finally failed in the for loop. So Instead of fixing it in one place... X| Yes, I'm serious. EDIT 2 And I should mention -- and I'm not kidding -- he was a MCSD. Fantastic test taker, I'm sure. :|

        D R 2 Replies Last reply
        0
        • M madwilliamflint

          So do you guys really have no process for vetting noobcode?

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          This isn't a production app. It's a tool that's used by a couple of teams, and no, there was no cuh thing a vetting.

          System.ItDidntWorkException: Something didn't work as expected. A guide to posting questions on CodeProject

          Click this: Asking questions is a skill. Seriously, do it.
          Dave Kreskowiak

          1 Reply Last reply
          0
          • R raddevus

            Wait! I think I know that guy who wrote that method. I mean, there couldn't be two people in the world that would do that could there? :~ I thought he was drummed out of development years ago though. EDIT Oh, wait, our guy didn't use methods. He wrote all of his code copy/past style and it was something like 20 pages long too. It was the same for loop copy pasted over and over. And, it was in prod and it finally failed in the for loop. So Instead of fixing it in one place... X| Yes, I'm serious. EDIT 2 And I should mention -- and I'm not kidding -- he was a MCSD. Fantastic test taker, I'm sure. :|

            D Offline
            D Offline
            Dave Kreskowiak
            wrote on last edited by
            #5

            Quote:

            he was a MCSD. Fantastic test taker, I'm sure.

            I is all book smarts and stuff now. :laugh:

            System.ItDidntWorkException: Something didn't work as expected. A guide to posting questions on CodeProject

            Click this: Asking questions is a skill. Seriously, do it.
            Dave Kreskowiak

            1 Reply Last reply
            0
            • D Dave Kreskowiak

              Picture this. VB.NET code written by a newb that needs to be updated with some support for a new file format. I'm looking at a single method that's 17 pages(!) long and doesn't return anything. It contains NINETY EIGHT If statements. Some are chained together with ElseIf, some are nested down to five levels deep. There is lots of this:

              If _condition-expression_ Then
                  ' Do nothing
              ElseIf _condition-expression_ Then
                  If _condition-expression_ Then
                      ' Empty block
                  Else
                      ' Holy elephant, do something here!
                  EndIf
              ElseIf _condition-expression_ Then
                  ' Holy elephant, do something here!
              ElseIf _condition-expression_ Then
                  ' Yeah, another empty block here too!
              Else
                  ' Oh! And this block is empty too.
              

              End If

              Shoot me. Please. I beg of you.

              System.ItDidntWorkException: Something didn't work as expected. A guide to posting questions on CodeProject

              Click this: Asking questions is a skill. Seriously, do it.
              Dave Kreskowiak

              M Offline
              M Offline
              MarkTJohnson
              wrote on last edited by
              #6

              You owe it to yourself and those that follow to refactor that thing. Otherwise, the next If Then you add might cause the compiler to wave the white flag with a "Nesting too deep" error. Seen it, done it. At least the doesn't have goto's does it? Mine had that too.

              B 1 Reply Last reply
              0
              • M MarkTJohnson

                You owe it to yourself and those that follow to refactor that thing. Otherwise, the next If Then you add might cause the compiler to wave the white flag with a "Nesting too deep" error. Seen it, done it. At least the doesn't have goto's does it? Mine had that too.

                B Offline
                B Offline
                Bernhard Hiller
                wrote on last edited by
                #7

                MarkTJohnson wrote:

                goto

                You mean something like:

                If condition-expression Then
                ' Do nothing
                ElseIf condition-expression Then
                If condition-expression Then
                ' Empty block
                Else
                ' Holy elephant, do something here!
                ...
                Goto Step123
                EndIf
                ElseIf condition-expression Then
                ' Holy elephant, do something here!
                ...
                :Step123
                ...
                Goto Step234
                ElseIf condition-expression Then
                ' Yeah, another empty block here too!
                Else
                ' Oh! And this block is empty too.
                End If
                ...
                :Step234
                ...
                Goto Step123

                Oh yeah, that's much more interesting!

                Oh sanctissimi Wilhelmus, Theodorus, et Fredericus!

                1 Reply Last reply
                0
                • D Dave Kreskowiak

                  Picture this. VB.NET code written by a newb that needs to be updated with some support for a new file format. I'm looking at a single method that's 17 pages(!) long and doesn't return anything. It contains NINETY EIGHT If statements. Some are chained together with ElseIf, some are nested down to five levels deep. There is lots of this:

                  If _condition-expression_ Then
                      ' Do nothing
                  ElseIf _condition-expression_ Then
                      If _condition-expression_ Then
                          ' Empty block
                      Else
                          ' Holy elephant, do something here!
                      EndIf
                  ElseIf _condition-expression_ Then
                      ' Holy elephant, do something here!
                  ElseIf _condition-expression_ Then
                      ' Yeah, another empty block here too!
                  Else
                      ' Oh! And this block is empty too.
                  

                  End If

                  Shoot me. Please. I beg of you.

                  System.ItDidntWorkException: Something didn't work as expected. A guide to posting questions on CodeProject

                  Click this: Asking questions is a skill. Seriously, do it.
                  Dave Kreskowiak

                  Sander RosselS Offline
                  Sander RosselS Offline
                  Sander Rossel
                  wrote on last edited by
                  #8

                  I know the feeling. And in SQL too.

                  Best, Sander arrgh.js - Bringing LINQ to JavaScript SQL Server for C# Developers Succinctly Object-Oriented Programming in C# Succinctly

                  1 Reply Last reply
                  0
                  • D Dave Kreskowiak

                    Picture this. VB.NET code written by a newb that needs to be updated with some support for a new file format. I'm looking at a single method that's 17 pages(!) long and doesn't return anything. It contains NINETY EIGHT If statements. Some are chained together with ElseIf, some are nested down to five levels deep. There is lots of this:

                    If _condition-expression_ Then
                        ' Do nothing
                    ElseIf _condition-expression_ Then
                        If _condition-expression_ Then
                            ' Empty block
                        Else
                            ' Holy elephant, do something here!
                        EndIf
                    ElseIf _condition-expression_ Then
                        ' Holy elephant, do something here!
                    ElseIf _condition-expression_ Then
                        ' Yeah, another empty block here too!
                    Else
                        ' Oh! And this block is empty too.
                    

                    End If

                    Shoot me. Please. I beg of you.

                    System.ItDidntWorkException: Something didn't work as expected. A guide to posting questions on CodeProject

                    Click this: Asking questions is a skill. Seriously, do it.
                    Dave Kreskowiak

                    N Offline
                    N Offline
                    Nagy Vilmos
                    wrote on last edited by
                    #9

                    I could swap your VB with some MATLAB I've got hanging around here.

                    veni bibi saltavi

                    1 Reply Last reply
                    0
                    • D Dave Kreskowiak

                      Picture this. VB.NET code written by a newb that needs to be updated with some support for a new file format. I'm looking at a single method that's 17 pages(!) long and doesn't return anything. It contains NINETY EIGHT If statements. Some are chained together with ElseIf, some are nested down to five levels deep. There is lots of this:

                      If _condition-expression_ Then
                          ' Do nothing
                      ElseIf _condition-expression_ Then
                          If _condition-expression_ Then
                              ' Empty block
                          Else
                              ' Holy elephant, do something here!
                          EndIf
                      ElseIf _condition-expression_ Then
                          ' Holy elephant, do something here!
                      ElseIf _condition-expression_ Then
                          ' Yeah, another empty block here too!
                      Else
                          ' Oh! And this block is empty too.
                      

                      End If

                      Shoot me. Please. I beg of you.

                      System.ItDidntWorkException: Something didn't work as expected. A guide to posting questions on CodeProject

                      Click this: Asking questions is a skill. Seriously, do it.
                      Dave Kreskowiak

                      A Offline
                      A Offline
                      AlphaDeltaTheta
                      wrote on last edited by
                      #10

                      I'm having the same issue here, just the code is in JS.

                      Beauty cannot be defined by abscissas and ordinates; neither are circles and ellipses created by their geometrical formulas. Carl von Clausewitz Source

                      1 Reply Last reply
                      0
                      • D Dave Kreskowiak

                        Picture this. VB.NET code written by a newb that needs to be updated with some support for a new file format. I'm looking at a single method that's 17 pages(!) long and doesn't return anything. It contains NINETY EIGHT If statements. Some are chained together with ElseIf, some are nested down to five levels deep. There is lots of this:

                        If _condition-expression_ Then
                            ' Do nothing
                        ElseIf _condition-expression_ Then
                            If _condition-expression_ Then
                                ' Empty block
                            Else
                                ' Holy elephant, do something here!
                            EndIf
                        ElseIf _condition-expression_ Then
                            ' Holy elephant, do something here!
                        ElseIf _condition-expression_ Then
                            ' Yeah, another empty block here too!
                        Else
                            ' Oh! And this block is empty too.
                        

                        End If

                        Shoot me. Please. I beg of you.

                        System.ItDidntWorkException: Something didn't work as expected. A guide to posting questions on CodeProject

                        Click this: Asking questions is a skill. Seriously, do it.
                        Dave Kreskowiak

                        R Offline
                        R Offline
                        Rob Grainger
                        wrote on last edited by
                        #11

                        Paid by the line?

                        "If you don't fail at least 90 percent of the time, you're not aiming high enough." Alan Kay.

                        1 Reply Last reply
                        0
                        • R raddevus

                          Wait! I think I know that guy who wrote that method. I mean, there couldn't be two people in the world that would do that could there? :~ I thought he was drummed out of development years ago though. EDIT Oh, wait, our guy didn't use methods. He wrote all of his code copy/past style and it was something like 20 pages long too. It was the same for loop copy pasted over and over. And, it was in prod and it finally failed in the for loop. So Instead of fixing it in one place... X| Yes, I'm serious. EDIT 2 And I should mention -- and I'm not kidding -- he was a MCSD. Fantastic test taker, I'm sure. :|

                          R Offline
                          R Offline
                          Rob Grainger
                          wrote on last edited by
                          #12

                          I've been a professional programmer for over 30 years, and can assure you that there are many, many folk who produce that kind of cruft.

                          "If you don't fail at least 90 percent of the time, you're not aiming high enough." Alan Kay.

                          1 Reply Last reply
                          0
                          Reply
                          • Reply as topic
                          Log in to reply
                          • Oldest to Newest
                          • Newest to Oldest
                          • Most Votes


                          • Login

                          • Don't have an account? Register

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • World
                          • Users
                          • Groups