Scripting News: Possibly dumb JavaScript question.

I just read through this piece about callback-less JavaScript coding, and it raises a question I’ve never seen answered, that I’ve been puzzled about ever since I learned that there are just a couple of threads in a JavaScript app running in the browser.

The question is this — why?

It’s been a long time since I worked in an environment that had such a constraint.

I kept looking for the JavaScript verb that forks off another thread. Until I realized there was no such verb. Why not just relax the rule and let a JavaScript app spawn a certain number of threads. And if it needs more, ask the user if that’s okay. Like getting more memory in an iPad app.

It crossed my mind that this might be a way for a web page to crash your browser. But I’m pretty sure I can already do that with a simple loop that does nothing and never terminates.

  • while (true) {}

Anyway — if you have any idea please post a comment. 😉

Advertisements

About Dave Winer

Dave Winer, 54, pioneered the development of weblogs, syndication (RSS), podcasting, outlining, and web content management software; former contributing editor at Wired Magazine, research fellow at Harvard Law School, entrepreneur, and investor in web media companies. A native New Yorker, he received a Master's in Computer Science from the University of Wisconsin, a Bachelor's in Mathematics from Tulane University and currently lives in Berkeley, California.
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s