| soul. (SSLR) Oh, that's right...YOU HAVE NO SOUL!!!
Forcing this stupid OO event-driven model on me when all I'm doing is trying to tick off a list of things that need to get done on this page, IN ORDER, is hideously unfair.
I'm not an event-driven programmer, and I can't wrap my head around it except in the most perfunctory way. I don't wanna have my code skipping all over the place in what should be a LINEAR FRELLING PROCESS!
Fine, if people are doing something with lots of interactivity, or where any of a dozen things can happen at any time and must be handled appropriately at that time, they can use the event-driven model.
But there should ALSO be a way for me to tell the page "just catch your breath for a couple dozen milliseconds until this is done". And no, setTimeout() isn't the answer...it wants a function to call.
I don't wanna move on and call a function when it's done....I want it to stay here, right HERE, for the very short amount of time it takes to load this here image. And then move on.
But no, I have to:
var image = new Image();
image.onload = function()
{
//blah- whatever I want to do next
return;
}
image.src = URL;
Why why why couldn't they slip in a waitfor() or a while(<obj>.notloaded) or ANYTHING that would let me make something linear that should be linear.
The punchline is, even if they had slipped in a while() of some sort that would work, THERE IS NO SUCH THING AS A DELAY LOOP. And even if I used an onload function that set a boolean variable, doing that and going
while(!img.loaded)
{
}
makes the browser take up all your CPU time, get cranky, and ask if you want to terminate the script. Brilliant...was sleep(n) too hard for you guys? Seriously?
When I'm doing a UI or something like that needs events, I'll use the frelling events and be happy to do it, but all this needs to do is A>B>C. Not nested onloads that take my code all over creation and back!
*throws a burning napalm-doused sperm whale at JavaScript*
</rant>
(No, I am not looking for solutions. Please accept in the spirit in which this was given, that being I HAD TO YELL AT SOMEBODY. And for your entertainment.) |