|
Logic Chip wrote: contract jobs both state and feral i can empathize with you
Is a Feral job one you wish you hadn't taken?
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
yes, every government job has been feral, those in Canberra especially.
Logic Chip
|
|
|
|
|
Programmer humor. I love it!
My favorite is the singleton with millions of instances.
|
|
|
|
|
Please tell me it was state or local government and not federal...
|
|
|
|
|
Fortunately no, it’s not the federal government. It’s a state government. I’d honestly be too embarrassed to say which one, but let’s just say it wouldn’t be a big surprise.
|
|
|
|
|
Darn. And here I was hoping it was somebody else's government
patbob
|
|
|
|
|
This explains much. I've always suspected that the lunatics are running the asylum. Now I know where NMCI came from.
|
|
|
|
|
I'm no fan of goto at the best of times, but at least this one disappeared quickly:
If Not rsTest.EOF Then
rsTest.MoveLast
If Format(rsTest!OKDATE, "yyyy/mm/dd") > Format(cutOffDate, "yyyy/mm/dd") Then
dataStat = "2"
GoTo UpdAccount
End If
End If
UpdAccount:
I kid you not!
|
|
|
|
|
I'm not quite sure if the GoTo is the horror, or that I just read a block of VB....
Dirty... I feel dirty...
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
It's slightly worse than that, this is VBA.
|
|
|
|
|
My thoughts exactly
return 5;
|
|
|
|
|
Well, the GoTo is important here, otherwise the computer may not know what to do: Sit down and have a coffee, travel to Egypt and visit the pyramides or maybe format the harddisks..
I always suggested to put a GoToNextStatement after each statement. But these dumb guys from microsoft didn't want to listen to me..
|
|
|
|
|
Yeah, if only we could maybe assign a numerical order to the statements...
|
|
|
|
|
What I find deeply disturbing by this and other examples of bad coding is that these people get paid for writing this rubbish. Furthermore, what is more frightening is the fact that they could be writing code for safety systems or banking systems or who knows what else.
No bloody wonder the software industry puts a NO WARRANTIES EXPRESSED OR IMPLIED notice into every EULA D'Oh! They're not even sure it's going to work. Can you imagine buying a new car and the manufacturer said that there were no warranties?
Nobody can get the truth out of me because even I don't know what it is. I keep myself in a constant state of utter confusion. - Col. Flagg
|
|
|
|
|
How about this piece of code:
<br />
if (a == null == false) {<br />
}<br />
Spent some time before figuring out it is a version of
<br />
if (а != null) {}<br />
|
|
|
|
|
when in doubt, you can look it up and then clarify by adding parentheses, like so:
if ( ( (a==null) == false ) == true ) {...}
|
|
|
|
|
Luc Pattyn wrote: if ( ( (a==null) == false ) == true ) {...}
can you extend this recursively? only to be very very sure:
if ( ( ( ( ( (a==null) == false) == true) == true) == true) == true)
to shock afterworkers and make compiler happy, one could sometimes say == true and == false
|
|
|
|
|
Just to make it more subtle add a little "!" at the beginning
if ( !( ( ( (a==null) == false ) == true ) == false)) {...}
|
|
|
|
|
This one would be even more subtle
if ( !( !( !( !(a==null) == true ) == false ) == true)) {...}
|
|
|
|
|
How about this one?
if ( true == (!((!(((a ?? true) is bool) ? true : false) == false) == true) == false)) {...}
|
|
|
|
|
How about overloading those operators? Also, you might want to use the monad- or the decorator pattern to split that up into multiple lines
I are Troll
|
|
|
|
|
I used to work at Accenture, they used to make us bracket like that to "Disambiguate" the otherwise very clear logic
|
|
|
|
|
A a clear and sustainable piece of code, this is truly a horror and definitely deserves its place in the Hall of Shame.
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
Related to the above:
flag = bool(int(flag) - 1);
|
|
|
|
|
I presume this toggles the flag? And that in this language false is zero and anything else is considered true
|
|
|
|