|
Don't know about win/win but the thought of dumping 10,000 pieces of paper on a business analyst's desk does have some appeal.
"You get that on the big jobs."
|
|
|
|
|
Big ouch.
|
|
|
|
|
Whenever we need to evaluate a performance problem at a customer the first thing we do is look for a missing index. Usually, this is the result of a messed up database installation but sometimes the damn thing is just not there. This kind of problem, as shameful as it is, is actually quite common. I've seen this on tables with millions of rows - no performance problem there eh?
|
|
|
|
|
|
StartLongRunningProcess()
While (Some Condition That Last 3 Minutes)
Application.DoEvents()
End While
StartAnotherLongRunningProcess()
While (Some Condition That Last 3 Minutes)
Application.DoEvents()
End While
...found this today, almost died.
|
|
|
|
|
At least, you found it...
(yes|no|maybe)*
|
|
|
|
|
And they didn't even have the decency to use Thread.Sleep in the loop?
StartLongRunningProcess()
While (Some Condition That Last 3 Minutes)
Application.DoEvents()
End While
StartAnotherLongRunningProcess()
While (Some Condition That Last 3 Minutes)
Application.DoEvents()
End While
Even pseudo code benefits from indents and PRE tags.
|
|
|
|
|
I have yet to see a problem where Application.DoEvents is the right solution..
|
|
|
|
|
Lazy@$$Co-Worker.DoEvents!
It's an OO world.
|
|
|
|
|
|
I found found only one place - when using the unmanged function "SHAppBarMessage", with ABM_SETPOS.
|
|
|
|
|
JNochowitz wrote: ...found this today, almost died.
read this today, and almost wet myself!
I may or may not be responsible for my own actions
|
|
|
|
|
By the way, how does the author know that long running process takes exactly 3 minutes? And where is parallelism? It can spare you 3 minutes!
|
|
|
|
|
Sadly I have seen a lot of legacy code where loops and Application.DoEvents()is the standard way to handle long processing times.
Just because the code works, it doesn't mean that it is good code.
|
|
|
|
|
One of my friend complained about a wierd problem while designing the website in visual studio.
All the controls, (labels here) are drawn on the page. But then, the text was not appearing.
Checked the visible property, this, that and everything.
Finally, We could trace out the problem to an unassuming CSS file somewhere in the whole project structure (among 5 other CSS files) which had the following lines (among 100 other lines)
.body{
foreground:#FFFFFF
}
Lucky, I knew #FFFFFF was white!
-
Bits and Bytes Rules!
10(jk)
|
|
|
|
|
Google Chrome, right-click label, inspect element, computed style, see what looks fishy
-if anything ever looks weird in a webpage, that the first place I look
I may or may not be responsible for my own actions
|
|
|
|
|
|
I found this revisiting a cell validation module - simplified for readability
A=B
B=A
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Now just what was I on that morning..
Ger
|
|
|
|
|
A guy that used to work at my company used to do that all the time.
He got some function of the internet and did something in the line of:
Private Sub DoStuff(ByVal a As Integer)
Dim b As Integer = a
End Sub
And even better:
Private Sub DoMoreStuff(ByVal a As Integer)
a = a
End Sub
This guy really had not understood anything from 4 years of college! And he actually was quite bitter when he got fired. He thought he was the best and could not get fired
It's an OO world.
|
|
|
|
|
|
I've written some code like that too, usually after coding for 30+ hours
Just because the code works, it doesn't mean that it is good code.
|
|
|
|
|
My issue is worse, I'm still new to this and by no means am an expert, but I look at code I wrote as little as 6 months ago and think WTF was I thinking. Can't wait to see my opinion of myself in a couple years looking back at now.
Programming is a race between programmers trying to build bigger and better idiot proof programs, and the universe trying to build bigger and better idiots, so far... the universe is winning.
|
|
|
|
|
|
Don't worry, you're not the only one. Besides, that's a good thing: It means you're learning. It also means trying to build any project that takes more than a couple weeks to build ends up taking an eternity as you continuously go back to make older stuff better, always learning just enough more to need to go back and improve the old stuff continuously.
|
|
|
|
|
happens... i often ask myself "wth was i thinking!?"
|
|
|
|