|
Person is afraid, that someone will steal the "truth" of his true values. He is just watching his TRUE values and virtues, what's wrong with that?
|
|
|
|
|
I think he was actually trying to monitor progress via the VS Unit test UI...
|
|
|
|
|
|
In all of computer programdom, I've never encounterd this arrangement of i & iCount in a for loop:
i = getcountofsomething()
For iCount = 0 To i
If something(iCount)) Then
bOk = True
Exit For
End If
Next iCount
modified on Thursday, February 11, 2010 6:33 PM
|
|
|
|
|
It's not that bad - I assume getcountofsomething() takes a while, so the coder has just manually optimised it out of the loop. If Barbie is so popular, why do you have to buy her friends?
Eagles may soar, but weasels don't get sucked into jet engines.
If at first you don't succeed, destroy all evidence that you tried.
|
|
|
|
|
nah, it's bad. who names their variables like this in a for loop? were it written "for i = 0 to iCount", I'd be giving this guy a high 5 already.
|
|
|
|
|
A high 5 around the earhole? cheers,
Chris Maunder
The Code Project | Co-founder
Microsoft C++ MVP
|
|
|
|
|
|
It's straight from the guide on How To Write Unmaintainable Code[^]:
Never use i for the innermost loop variable. Use anything but. Use i liberally for any other purpose especially for non-int variables. Similarly use n as a loop index.
|
|
|
|
|
lol! I think they were using that as the coding standards document!
|
|
|
|
|
You just don't understand. If the variable was named count you would have a point. Here, the programmer was helping the poor computer with its communications skill. Hence naming the variable that the computer uses to count from its own perspective - "I Count" Please do not read this signature.
|
|
|
|
|
mlNumOfSomething = SomeClass.GetSomething(anIDArray())
For lli = 1 To mlNumOfSomething
SomeClass.GetSomeInfo anIDArray(lli), Description:=aDescription
ReDim Preserve msAllAgencies(1 To mlNumOfSomething)
msSomeArray(lli) = aDescription
Next lli
|
|
|
|
|
I guess they won't need to use an obfuscater...
|
|
|
|
|
That is truely awful. Much better would be:
mlNumOfSomething = SomeClass.GetSomething(anIDArray())
lItemToAdd = 0
For lli = 1 To mlNumOfSomething
SomeClass.GetSomeInfo anIDArray(lli), Description:=aDescription
lItemToAdd = lItemToAdd + 1
ReDim Preserve msAllAgencies(1 To lItemToAdd)
msSomeArray(lItemToAdd) = aDescription
Next lli
That way you can add in logic to exclude items.
Panic, Chaos, Destruction.
My work here is done.
or "Drink. Get drunk. Fall over." - P O'H
|
|
|
|
|
|
Aren't you just so glad we are no longer stuck with 80 character coding sheets... If Barbie is so popular, why do you have to buy her friends?
Eagles may soar, but weasels don't get sucked into jet engines.
If at first you don't succeed, destroy all evidence that you tried.
|
|
|
|
|
Never realized that SQL allows you to place case statements within a join statement, though I guess nothing would syntatically prevent such.
I would highly recommend placing those conversions/etc. into the secondary query being joined (or wrapped in a second query) just to remove the eyebleeding IsNull that trails into the mile long case statements.
|
|
|
|
|
Jeremy Hutchinson wrote: I'm not sure if it's a good or bad thing that I can just forwarded the problem to the original developer.
I think you should hire the original developer if he is not part of your company. Anyone who can handle that monster join is definetly a good asset for the company. I have no smart signature yet...
|
|
|
|
|
That developer does still work here. What I need is someone who is not only smart enough to handle that monster join, but also smart enough not to write it.
At the very least don't write it as one continuous line with no spaces. Throw a little formatting in there.
|
|
|
|
|
Jeremy Hutchinson wrote: Throw a little formatting in there.
I looked, it's still about as appealing as having a limb turned around.
Panic, Chaos, Destruction.
My work here is done.
or "Drink. Get drunk. Fall over." - P O'H
|
|
|
|
|
Jeremy Hutchinson wrote: to handle that monster
Is the monster a manager now? Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep!
|
|
|
|
|
<code>
Private Function SomeCrappyCode(lsDate As String) As Long
On Error GoTo ErrorHandler
Dim llRetval
Dim llPosition As Long
'Updates the US Month Name in SQL Date to Locale
'Month Name in Locale Language
llPosition = InStr(lsDate, "Jan")
If llPosition > 0 Then
lsDate = Left(lsDate, llPosition - 1) & Format(DateSerial(98, 1, 1), "MMM") & right(lsDate, Len(lsDate) - 3)
llRetval = True
Exit Function
End If
'Copy & paste the above code block 11 more times for Feb...December
mlUpdateMonthStringLocale = llRetval
Exit Function
ErrorHandler:
WriteErrorLogEntry Err.number, "SomeCrappyCode", Err.description
Exit Function
Resume
End Function
</code>
|
|
|
|
|
Ingenious solution to the problem indeed. Obviously it'd be better of with a switch statement though Jeroen De Dauw
---
Forums ; Blog ; Wiki
---
70 72 6F 67 72 61 6D 6D 69 6E 67 20 34 20 6C 69 66 65!
|
|
|
|
|
I am not sure how it works in VB exactly, but in a normal language this code would alter local variables lsDate and llRetval without affecting the outside world. So, this function does virtually nothing. Am I right?Greetings - Jacek
|
|
|
|
|
in this case, the incoming parameter defaults to "ByRef", lRetVal defaults to Variant, and the return value is only set when the line of code "ThisFunctionName = aValue", so luckily it sets the lsDate param, but the return value is never set 'cause the author was retarded
|
|
|
|