The Daily Static
  The Daily Static
UF Archives
Register
UF Membership
Ad Free Site
Postcards
Community

Geekfinder
UFie Gear
Advertise on UF

Forum Rules
& FAQ


Username

Password


Create a New Account

 
 

Back to UserFriendly Strip Comments Index

F4 you, JavaScript. F4 you to the depths of your by firehawk 2014-02-08 23:32:54
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.)

[ Reply ]
  Ignore the bad intending on the "while"... by firehawk2014-02-08 23:34:34
  *Eats all the non alphanumeric characters* by ShadowSystems2014-02-08 23:54:01

 

[Todays Cartoon Discussion] [News Index]

Come get yer ARS (Account Registration System) Source Code here!
All images, characters, content and text are copyrighted and trademarks of J.D. Frazer except where other ownership applies. Don't do bad things, we have lawyers.
UserFriendly.Org and its operators are not liable for comments or content posted by its visitors, and will cheerfully assist the lawful authorities in hunting down script-kiddies, spammers and other net scum. And if you're really bad, we'll call your mom. (We're not kidding, we've done it before.)