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. When you aren't even sure WHY you're writing bad code

When you aren't even sure WHY you're writing bad code

Scheduled Pinned Locked Moved The Weird and The Wonderful
helpsalestutorialquestion
7 Posts 7 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.
  • P Offline
    P Offline
    philip_cole
    wrote on last edited by
    #1

    Our old customer service system has some brilliantly bad code in it, but I just had to share this one I spotted this morning. I think the guy got halfway through and forgot exactly what he was even meant to be fixing, let alone how to fix it.

    'ISSUE 2862 ?
    If CurrentUser.WorkingSession.Market.TaxInclusiveInCatPrice Then
    'Me.lblTotalOutstanding.Text = String.Format("{0:c}", decOutstanding)
    Else
    '?
    End If
    Me.lblTotalOutstanding.Text = String.Format("{0:c}", decOutstanding)

    I just wish we still had our old issue tracker to see what the mystical ISSUE 2862 is...

    Phil

    J S F Y R 5 Replies Last reply
    0
    • P philip_cole

      Our old customer service system has some brilliantly bad code in it, but I just had to share this one I spotted this morning. I think the guy got halfway through and forgot exactly what he was even meant to be fixing, let alone how to fix it.

      'ISSUE 2862 ?
      If CurrentUser.WorkingSession.Market.TaxInclusiveInCatPrice Then
      'Me.lblTotalOutstanding.Text = String.Format("{0:c}", decOutstanding)
      Else
      '?
      End If
      Me.lblTotalOutstanding.Text = String.Format("{0:c}", decOutstanding)

      I just wish we still had our old issue tracker to see what the mystical ISSUE 2862 is...

      Phil

      J Offline
      J Offline
      joe_j
      wrote on last edited by
      #2

      I have seen something like that, but this time the reason being, the contractor didn't get paid, yup so he eloped with the pending code.. thankfully he didnt' leave behind any ISSUE 2862 for us to figure out :)

      1 Reply Last reply
      0
      • P philip_cole

        Our old customer service system has some brilliantly bad code in it, but I just had to share this one I spotted this morning. I think the guy got halfway through and forgot exactly what he was even meant to be fixing, let alone how to fix it.

        'ISSUE 2862 ?
        If CurrentUser.WorkingSession.Market.TaxInclusiveInCatPrice Then
        'Me.lblTotalOutstanding.Text = String.Format("{0:c}", decOutstanding)
        Else
        '?
        End If
        Me.lblTotalOutstanding.Text = String.Format("{0:c}", decOutstanding)

        I just wish we still had our old issue tracker to see what the mystical ISSUE 2862 is...

        Phil

        S Offline
        S Offline
        StM0n
        wrote on last edited by
        #3

        Mhm... it was DenverCoder9[^]

        (yes|no|maybe)*

        C 1 Reply Last reply
        0
        • P philip_cole

          Our old customer service system has some brilliantly bad code in it, but I just had to share this one I spotted this morning. I think the guy got halfway through and forgot exactly what he was even meant to be fixing, let alone how to fix it.

          'ISSUE 2862 ?
          If CurrentUser.WorkingSession.Market.TaxInclusiveInCatPrice Then
          'Me.lblTotalOutstanding.Text = String.Format("{0:c}", decOutstanding)
          Else
          '?
          End If
          Me.lblTotalOutstanding.Text = String.Format("{0:c}", decOutstanding)

          I just wish we still had our old issue tracker to see what the mystical ISSUE 2862 is...

          Phil

          F Offline
          F Offline
          Fred Flams
          wrote on last edited by
          #4

          Actually I found a piece of code very similar but using a C# switch case

          switch(someEnumVariable)
          {
          case enumVal1: throw Exception("enumVal1");
          case enumVal2: throw Exception("enumVal2");
          case enumVal3: throw Exception("enumVal3");
          default: throw Exception("Unknown enum value");
          }

          weirdly enough it looks like some kind of debugging technique..... but again the title of the forum says it all !!!!

          1 Reply Last reply
          0
          • P philip_cole

            Our old customer service system has some brilliantly bad code in it, but I just had to share this one I spotted this morning. I think the guy got halfway through and forgot exactly what he was even meant to be fixing, let alone how to fix it.

            'ISSUE 2862 ?
            If CurrentUser.WorkingSession.Market.TaxInclusiveInCatPrice Then
            'Me.lblTotalOutstanding.Text = String.Format("{0:c}", decOutstanding)
            Else
            '?
            End If
            Me.lblTotalOutstanding.Text = String.Format("{0:c}", decOutstanding)

            I just wish we still had our old issue tracker to see what the mystical ISSUE 2862 is...

            Phil

            Y Offline
            Y Offline
            YvesDaoust
            wrote on last edited by
            #5

            Apparently, issue 2862 was the total outstanding amount not being updated in case the the "cat" price did not include tax. ;)

            1 Reply Last reply
            0
            • P philip_cole

              Our old customer service system has some brilliantly bad code in it, but I just had to share this one I spotted this morning. I think the guy got halfway through and forgot exactly what he was even meant to be fixing, let alone how to fix it.

              'ISSUE 2862 ?
              If CurrentUser.WorkingSession.Market.TaxInclusiveInCatPrice Then
              'Me.lblTotalOutstanding.Text = String.Format("{0:c}", decOutstanding)
              Else
              '?
              End If
              Me.lblTotalOutstanding.Text = String.Format("{0:c}", decOutstanding)

              I just wish we still had our old issue tracker to see what the mystical ISSUE 2862 is...

              Phil

              R Offline
              R Offline
              RafagaX
              wrote on last edited by
              #6

              I'm pretty sure Issue 2862 was "Unnecessary If". ;P

              CEO at: - Rafaga Systems - Para Facturas - Modern Components for the moment...

              1 Reply Last reply
              0
              • S StM0n

                Mhm... it was DenverCoder9[^]

                (yes|no|maybe)*

                C Offline
                C Offline
                CHill60
                wrote on last edited by
                #7

                Scarily Issue 2862 on our tracking system was raised in 2003 - I'm now searching our codebase for DenverCoder9 :-D

                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