When you aren't even sure WHY you're writing bad code
-
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
-
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
-
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
-
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
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 !!!!
-
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
Apparently, issue 2862 was the total outstanding amount not being updated in case the the "cat" price did not include tax. ;)
-
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
I'm pretty sure Issue 2862 was "Unnecessary If". ;P
CEO at: - Rafaga Systems - Para Facturas - Modern Components for the moment...
-
Mhm... it was DenverCoder9[^]
(yes|no|maybe)*