The Great JavaScript Debate: Improve It Or Kill It 482
snydeq writes "Recent announcements from Google and Intel appear to have JavaScript headed toward a crossroads, as Google seeks to replace the lingua franca of the client-side Web with Dart and Intel looks to extend it with River Trail. What seems clear, however, is that as 'developers continue to ask more and more of JavaScript, its limitations are thrown into sharp relief,' raising the question, 'Will the Web development community continue to work to make JavaScript a first-class development platform, despite its failings? Or will it take the "nuclear option" and abandon it for greener pastures? The answer seems to be a little of both.'"
In my opinion... (Score:4, Funny)
In my opinion... kill it! Kill it with fire!
Re: (Score:3)
Everything they may replace it with is worse...
Re: (Score:2)
Oracle controls javascript? Since when?
Re:In my opinion... (Score:4, Insightful)
Nothing can be worse than Oracle. Seriously, you want to talk evil companies...
You do know we're not talking about Java, right?
Re:In my opinion... (Score:5, Funny)
A beautiful rant killed by an ugly fact.
Re: (Score:3)
Earth?
Re:In my opinion... (Score:5, Funny)
Why? This is not 1999. We don't "hate" javascript anymore, like we did years ago.
Now we hate flash. Get on the wave, man.
Re: (Score:2)
Re: (Score:2)
Yes but does Javascript provide access to hardware (camera, microphone) and sockets? Flash does. The sockets in particular (and the new 3d features just added) should make it considerably better for games.
Now don't get me wrong, I'm not flash evangelist. I'm just wondering whether to invest my time in Actionscript or Javascript. One can now develop mobile apps with MXML and Actionscript or one can develop them using Javascript and various new (i.e., experimental) frameworks.
I do find it odd that everyone
Re: (Score:3, Insightful)
Re:In my opinion... (Score:5, Insightful)
It seriously bugs me when people confuse the DOM/JS API for a given platform and the language itself. One is not intrinsically tied to the other. JS has been a favorite language of mine for a very long time (since around 1996). It gets a bad rep. mainly because of the browsers' DOM implementations in the v4 browser war... Don't hate the player, hate the game.
Re: (Score:3)
I understand what you are saying about the language vs. the browser API, but would also like to point out that the enormous variation in API implementations is still a very serious problem for Javascript. This is why you have things like JQuery and Mootools providing a buffer layer between the JS programmer and the browser in the often fruitless attempt to shield a JS programmer from some peculiar browser implementation. One also encounters peculiar browser behavior in flash every now and then when trying
Read Crockford's "Javascript: the good parts". (Score:5, Informative)
You really need to read Crockford's "Javascript: the good parts". You absolutely do make private methods and vars (ever noticed that you can't directly call jQuery's internal methods? Or TinyMCE's? Or any other major library/framework?)
He also makes the case that actually JS has more patterns to allow code re-use. That's why things like Mootools can even fake things that look like classical class inheritance patterns for you, if you really want to do that.
Check out http://www.crockford.com/javascript/inheritance.html [crockford.com] and http://javascript.crockford.com/prototypal.html [crockford.com] and http://www.slideshare.net/douglascrockford/javascript-the-good-parts-3292746 [slideshare.net]
Re: (Score:3)
How does one establish whether methods/vars are public/private/protected?
One doesn't, but that's fairly common in object oriented languages. Very few actually provide this kind of functionality, and generally they're the ones that don't fully support object orientation.
Or inheritance?
JavaScript provides a single chain of prototype inheritance. Any slot lookup is checked along the prototype chain. So, for example, you can set a method in an object, use it as a prototype, and every object will see that method, unless it has its own set. You can then use one of these objects as a prototype an
Re: (Score:3)
Javascript easily could. The browser doesn't. That's the limiting factor. People mistake the limitations that the browser enforces as limitations of Javascript.
Re: (Score:3)
I agree, death to Flash. The last thing we need is more and better security vulnerabilities.
Re: (Score:2)
I'm just wondering whether to invest my time in Actionscript or Javascript.
If you're asking that question in 2011, the answer is Javascript. 10 years ago the answer would have been different. I'm not sure which "experimental" frameworks you've looked at, but I would suggest using a mature framework like ExtJS version 4 [sencha.com]. You won't find better documentation in a Javascript framework, and it even has a version specifically for mobile devices (Sencha Touch [sencha.com]).
Re: (Score:2)
I'm not talking about 'web apps', I'm talking about mobile phone apps that do not require server access to function.
Granted, I haven't read all the documentation, but I don't see anything in ExtJs that would help you to write a native mobile application for iPhone/iPad, Android, and Blackberry with a single code base that:
* lets you access hardware (microphone, camera, gps, accelerometer)
* lets you manipulate a client-side database
* lets you establish a socket connection to a server
I'm still looking into it
Re: (Score:2)
These are not goodies. These are nightmares. We hates it.
Re: (Score:2)
Re: (Score:2)
Why? This is not 1999. We don't "hate" javascript anymore, like we did years ago.
Now we hate flash. Get on the wave, man.
We hate everything you young wiper snapper. Get off my lawn!!!!
Re: (Score:2)
Why? This is not 1999. We don't "hate" javascript anymore, like we did years ago.
Now we hate flash. Get on the wave, man.
This is not 2009, either. We've since hated Wave into oblivion. Gotta jump out in front of the Dart...ouch!!!
Re: (Score:2)
In my opinion... kill it! Kill it with fire!
I'm sure reasonable people can reach a compromise that would satisfy everyone. Improve it, and then kill it.
Re: (Score:2)
Ummmm what?
Re: (Score:3)
You know, Java, JavaScript, it's all the same crap. For some.
Re: (Score:2)
... seriously? It's been 15 goddamn years.
Re: (Score:2)
Maybe you never learned the language properly? If you compare programming with JavaScript vs Assembler, it looks like you've never actually used the language. Now quit talking about it.
How about neither? (Score:5, Insightful)
Leave the web for documents. Run applications natively. Why is this so hard?
Re:How about neither? (Score:5, Informative)
Because Google needs you to run everything in their cloud so the NSA,FBI,CIA, and even the DMV can get easy access to all your documents.
Re: (Score:2)
Seems silly at this point. They will have access to your Medical Records [washingtonexaminer.com] under ObamaCare.
Comment removed (Score:5, Insightful)
Re: (Score:3)
No. The two aren't as separable as some geeks would like them to be. Politics/law shape technology; technology shapes politics/law. And in both directions, the influence is significant. Of course there are segments of technology (and politics) where this is less important than for others.
Re: (Score:3)
Re: (Score:3, Insightful)
The web is not for documents, it is for storing and displaying data. Flexible and powerful interfaces to that data are a part of the web. A client-side scripting language is required for any interface that doesn't require a page refresh on every click.
Leave the web for documents. Run applications natively. Why is this so hard?
Yeah, and phones should only be used for making and receiving calls. And GPUs should only be used for rendering graphics.
I'm sorry you're getting old, but things change whether you want them to or not.
Re: (Score:2)
Re: (Score:3)
Because HTML / CSS are the hugest kludge ever. Get it, EVER!!!!!
The controls suck ditch water, the implementation is without a doubt completely sophomoric and having to contain divs with divs within spans within divs and having to have just the right CSS reset file to make fucking CSS work right, having to jump through insane hoops with CSS which has the most ASS syntax imaginable just to make a pull down menu work correctly completely exposes the utter stupidity of its designers.
The DOM is the worst bit o
Re: (Score:2)
Leave the web for documents. Run applications natively. Why is this so hard?
Because native applications "are hard to make", and is run on an equipment not owned by the software maker.
Web Applications, on the other hand, "are easy to make and deploy", and, most important, are run on software maker's owned (or rented) hardware.
Had you ever tried to deleted your FaceBook account? ;-)
Re:How about neither? (Score:4, Insightful)
> Why is this so hard?
Two reasons, from my experience:
1. we have large corporate clients (think multinational). They use our services exactly once every year. Over 1,000,000 people in total. Imagine the logistics involved to get a desktop/native application deployed - for that one time use? What if we need to tweak something halfway. How do we re-deploy?
2. That application is "distributed". Everyone does a little bit that is then accumulated. Sure, we could write a client-server app. Then we'd need to figure out threading issues on the server side, work out the communication protocols, work out locking issues. Or we could let, say, Apache handle the threading (we're good but i'd rather trust software that has undergone years and years of usage - there are other web servers that do this better, i know.) Let HTTP be the communication protocol. Let the backend database handle data locking issues (at least using standard SQL concepts allows everyone to be able to wrap their heads around the issues involved). You could argue that we could use a native app that then uses HTTP. For that, see #1.
Native apps were great. Far richer experience in terms of UI. But far, far, poorer in terms of distributed-ness and ease of deployment. Or, looking at it another way, the current state of things are due to the evolution of one native app - the browser. It's just that it comes with an established integrated communication protocol and a UI that's flexible/extendable and the guarantee that the shell/runtime is multi-vendor - but largely compatible and available on most computers shielding you from deployment hassles. So it IS a native app that comes with the pieces you need (comm protocol, extension language, widespread availability).
Re: (Score:2)
Re: (Score:2)
A large part of the problem with "running applications natively" is that the native programming interfaces aren't really build to handle the kind of applications that run on the web. How would Wikipedia look as a native Gtk+ app? How would Facebook? It's kind of hard to imagine that type of applications stuffed into a classic GUI toolkit. Of course it could be done, but you would probably end up doing it by embedding a HTML widget and then you are basically back at square one.
That of course doesn't mean tha
Re: (Score:3)
That's actually a large part of the benefit of native applications. Consistent look and feel, remember that? If Facebook were a local application, it would look a lot like our email and usenet clients. That's all facebook is anyway. A poor reimplementation of email, usenet, IRC and finger.
Re: (Score:2, Funny)
I hereby sentence you to two years of corporate desktop support.
Re: (Score:3, Interesting)
Today, users aren't expected to know what any of that stuff is. The modern user isn't expected to understand what application they're using, o
Re: (Score:3)
very, very basic behaviors cannot be done on the web without javascript (eg changing the style of an element, showing/hiding content). it (or something like it) is a necessary evil - for now.
Those are not necessary for consuming documents (or more generally, data).
Re: (Score:2)
Re: (Score:3)
A SSH session uses about the same amount of bandwidth as it did in the 90's. Now you need a 3mbit pipe just to load an ordinary web page in a decent amount of time. If they just fucking killed off JavaShit the web would be fast once again, and its not just bandwidth thats being wasted; 10 years ago new releases of MS Office bloatware was driving the PC upgrade cycle, now its Web Apps and ordinary websites that have been unnecessarily 'a
Re:How about neither? (Score:5, Insightful)
A SSH session uses about the same amount of bandwidth as it did in the 90's. Now you need a 3mbit pipe just to load an ordinary web page in a decent amount of time.
You know what else uses the same bandwidth of the 90s? 90s webpages. The websites of today are doing more than ever (streaming video, multimedia rich) and file sizes and screen resolutions have increased. Compare the file size of the average game released today to that of 1999. Why don't you fire up Lynx and save yourself the aggravation?
You imply that the delays are due to JavaScript yet majority of the data on the wire isn't JavaScript. The delays you're referring to are mostly due to DNS lookups (and subsequent downloads) of byte heavy multimedia like images, video, and other goodies like Flash and data. As sites have grown in complexity a bottleneck occurs with the number of HTTP requests which a browser may make. The CSS file is parsed and the assets are downloaded the user must wait. The wait may be reduced employing a thoughtful design and clever use of domains (and subdomains). CDN (Content Delivery Networks) are popular for this very reason. At the server level on-the-fly compression may be enabled for various mime types (JS, html pages, smaller images etc.) to increase speed even further without requiring application level changes.
JavaScript may be used in many ways to improve performance on sites, for example: instead of downloading all the map data one only needs what's in the view port. Additionally images which a user never views may not be requested, saving bandwidth. Like any tool it can be misused. Sites which use several ad scripts, analytics, 3rd party widgets etc. are the exception. What about interactive sites (powered by cobbled together server side scripts, made with multiple frameworks) which operate in an underpowered, over provisioned VM, on a shitty pipe with oodles of other sites located on the other side of the world? JavaScript indeed. To see stuff done right look at Amazon.
So with JavaScript gone you have Flash, video, and data. I'm sure these will all be faster now... (since we're using less of these now than in the 90s, right?)
10 years ago new releases of MS Office bloatware was driving the PC upgrade cycle, now its Web Apps and ordinary websites that have been unnecessarily 'appified'
You're leaving out a big one: entertainment, specifically games. In addition new technology such as DVD, Bluray, data interfaces (USB 3.0) factors in too. I however agree with you, plenty of sites are one trick ponies that in the days past would've been a small program are now a web 2.0 site... which will generate insults seemingly using as many technologies and 3rd party service mashups as possible.
Re: (Score:3)
Re: (Score:2)
But the pinch of sarcasm in there changes the recipe from one of failure to one of WOOOSH!
KILL (Score:2)
Comment removed (Score:5, Insightful)
Too well, probably. (Score:3)
People keep figuring out how to do even more with JavaScript, forgetting that just because you can, doesn't mean you should.
Re: (Score:2)
Die Javascript Die (Score:2)
The design flaws are terminal. It deserves to be replaced with something that is statically typed.
If you want to keep it around for a few years as a legacy thing, fine. But it really is the VB5 of the 21st century.
We want something else.*
*Ripped off from a great MASH episode.
Yay, Flash is Dead! (Score:2, Insightful)
Now we can all switch to using Javascri... oh. Crap.
Re: (Score:3)
mod parent up. If all these cavemen want to go back to the days before reliable client-side scripting, let them all adopt IE 6!
If there's a greener pasture (Score:2)
If there's a greener pasture, someone with resources similar to those possessed by the original javascript developers would be seeding it.
Now, knowing what we know about how fugly Javascript is, the question is: why hasn't anyone replaced it yet?
Why kill it? (Score:2)
Re: (Score:2)
I like Javascript, it allowed me to code without having to install big fancy development platform.
So would a number of other and largely better programming languages.
Why stop at Javascript? (Score:2)
Lets just throw out HTML altogether and come up with a new language to make the client side section of web apps with. HTML was never envisioned to do this.
Re: (Score:2, Funny)
Great idea! Maybe some sort of an eXtendible Mark up Language....
Re: (Score:2)
The unpopular vote (Score:4, Interesting)
Re:The unpopular vote (Score:5, Insightful)
Soon as Microsoft surrenders language and library development to a 3rd party that operates in an open manner and allows any and all uses without royalty requirements.
As it stands? No way. That's just handing Microsoft what they've always wanted.
Re: (Score:2)
How on earth is a standard supposed to spread when everyone and their mother distrusts the people producing it? No one trusts them to contribute to the field without some kind of nasty lock-in, and their is a reason for that distrust.
Re: (Score:2)
which have an irrational hatred of anything MS
Funny you say that, I've always felt it was rather MS who hated me tremendously (hence I stopped nurturing MS's hate toward me by keeping a healthy distance between me and its stuff, through which it was expressing its hate toward me)
IMHO (Score:2)
If you want to replace JS for the sake of its limitations, then use java or C#. Both are fully grown languages with all mechanisms and tools you would ask for, a huge programmer base, good JIT implementations and an awesome amount of code already written.
If you have another agenda, i cant help you.
Re: (Score:2)
This! Except forget C#, too much political and patent frenzy to get a majority to come on board that disaster. But why can't a Java app be given access to the DOM of a page? Everyone already knows Java, plenty of tools exist, most browsers already support it and it just about HAS to run faster than compiled JS even with all the (rightful in my humble opinion) abuse we have heaped on Java over the years for performance issues. In this case though we are comparing Java to JS, not native C++ code. The sec
Mission creep. (Score:5, Funny)
I decided it would be a neat hack to flood my living room and turn it into an indoor pool. Boy, did that reveal some serious shortcomings in my home's electrical system. Can any recommend an electrician who doesn't suck as bad as the guy who installed the one I have now?
Re: (Score:2)
Maybe the real problem is the kind of water you use, not your electrical system.
Re: (Score:3)
It might even be possible to breath underfuorinert!
Dr Strangelove (Score:2)
I used to hate javascript. I'd disable it in my browsers up until a few years ago and avoid it like the plague in all of my web development tasks. A year and a half ago I became a full time web developer.
I had to shut up and learn to love javascript, and I really do. There's nothing wrong with it.
A language like PHP3 lacks enough features to make many common patterns possible. Progressing to PHP4, and PHP5, more and more patterns became possible. PHP can now house proper code, though it frequently doesn't b
I wouldn't mind Lua (Score:4, Interesting)
I wouldn't mind if they added Lua to web browsers.
Static Strong (Score:5, Interesting)
Give us a static strongly typed alternative/extension without the literally hundreds of known design flaws.
How about a Javascript that's more Java-like?
Re: (Score:3)
How about a Javascript that's more Java-like?
Real private and public modifiers would be nice, but I wish people would take the time to understand why the LISP-like qualities of JavaScript make it awesome. I often find myself wishing that .NET and Java were more like JavaScript. To be an exceptional .NET or Java programmer, you need to know tons and tons of specifics about the language. To be a good JavaScript programmer, all you really have to understand are the concepts related to objects and scope.
I think Java and .NET are great enterprise langu
Already obsolete (Score:2)
Who needs javascript now that every website ends up being rewritten in Objective-C?
Actionscript 3.0 (Score:2)
The biggest problem, though, isn't Javascript; it's the horrible API and document model it has to struggle with when doing anything in a web browser. That would make programming in any scripting language a nightmare.
Native Client (NaCl) (Score:2)
I am hoping for another Google project: Native Client (NaCl).
What we need is not yet another language with a new set of limitations. Instead we need a system that allows any language, even ones not invented yet. And without waiting for every single browser out there to update to the most recent language specification. Without having to program for every bug in every browser.
Native Client solves this by allowing binary executables and a standardized byte code (LLVM) as alternative. You can code in assmbly, C
Missing the point (Score:3)
I think many people are missing the point of Javascript.
The new spec includes the ability for Javascript to open sockets. Once that takes hold, you'll have the ability to completely control the browser window from the home server.
When that happens, it will be big. The browser is essentially a rendering machine which makes it trivially easy to show things and is largely machine independent. Instead of selling a huge monolithic program, companies can simply sell time on their servers to run their programs.
Imagine that you want to use a big engineering program - Orcad or Altium Designer, for example.
Instead of paying $10,000 for a copy of the program and taking a chance that it's as good as it's marketing claims, you can buy a month of usage for $100, and the executable will run on the company's servers while using your browser to paint the screens. Sort of like how World of Warcraft runs on servers, but paints the screens locally.
This has many advantages for the user:
1) You don't have to risk an enormous sum of money to try something out
2) You don't pay for the product more than you need it
3) You have NO installation issues
4) You are always using the most up-to-date version
5) The vendor can keep backups of your files for you
6) You can access your files and the application from anywhere on the net
And for the vendor:
1) The code is never given out (only runs on the server): no piracy!
2) You don't need multiple versions for different architectures (reduced engineering)
3) You don't have to push updates to the users all the time
4) You can tune the compilation/installation to make the best use of the server
5) Rendering is much easier - the bulk of the code is written for you by others (reduced engineering)
There are some disadvantages - the vendor has access to the document, which means that they can also sell the document to spammers (designs to China, for example). This can be dealt with by using a trust model; ie - the company will have an online reputation which will get quickly tarnished once this happens.
That's the promise of Javascript, and the real potential of the cloud. Companies supplying online services to compete for customers.
Framework, anyone? (Score:2)
(Responding to my own comment)
I'm waiting for someone to come up with a simple transport layer in JavaScript that does nothing but make the DOM visible to the other end. All you would need is
1) Interrogate the DOM, send back value
2) Set DOM variable to passed value
2) Pass back messages based on the user actions ("button X was clicked").
I'd *love* to see a python or perl interface for this. Making a GUI for something would be almost trivial.
Re: (Score:2)
I think many people are missing the point of Javascript.
The new spec includes the ability for Javascript to open sockets. Once that takes hold, you'll have the ability to completely control the browser window from the home server.
When that happens, it will be big. The browser is essentially a rendering machine which makes it trivially easy to show things and is largely machine independent
Did you just invent X-Windows?
Can't Be Everything To Everyone (Score:3)
I doubt very much a language syntactically and stylistically optimized for light-duty GUI event scripting can be a good language for implementing OS-like features and vice-verse. Leave JS alone and create a new language that's a better fit for "deep guts" programming.
What's next, ADA-Script?
The specs are just fine for the moment (Score:2)
Remember when we thought SQL was so much slower and not fit for the big work? Well it was'n SQL, it were the early implementations that were slow.
Now the Javascript specs are very powerfull. And the engines (implementations) are getting faster all the time. I see SproutCore and Objective-J pushing the envelope, amongst others. Javascript has only just arrived.
Anyways, that's only my impression.
How many times will we have this argument? (Score:5, Insightful)
The history of the Internet and examples like IPv6, HTTP, SMTP, etc have shown us over and over that "good enough" + evolution trumps replace almost every time.
The path forward is clear: improve JavaScript, extend it, improve HTML, and keep on trucking. Neither will ever be replaced on a wide scale, only evolved.
The reason we don't already have worldwide IPv6 deployment is they redesigned IP instead of just extending the addresses.
Show us the language! (Score:2)
If Google would actually get around to releasing some details on Dart, rather than just trying to shoot down an established language, then maybe this could be a rational discussion.
OK, But... (Score:2)
Hay Intel! How about a Metaphysical Interface?
Hay Google, How about a Protocol Definition?
If Google, and Intel could combine a Metaphysical Interface with a Protocol Definition, maybe there would be something new to march around the breakfast table about?
Re: (Score:2)
Re: (Score:2, Funny)
Re: (Score:2)
What we need, then, is interpreted C++.
Re: (Score:2, Funny)
You shut your mouth! You shut your GODDAMNED MOUTH!
Re: (Score:2, Informative)
Re: (Score:2)
No block-level scope. No threads. No support for strong typing. No inheritance.
Threads are evil. Function scope is better than block scope. Strong typing sucks. Class hierarchies suck.
anything else?
Re: (Score:3)
Wrong on three counts (should I say two and a half?). Not bad.
Support for threads is coming (already there in some browsers).
There is block level scope since JavaScript 1.7
There is inheritance, since day one.
No strong typing, granted.
Re: (Score:2)
JavaScript emerged out of a process focusing on appeasing the masses of web developers with features without much regard for how the end result would turn out. It has some major problems regarding performance, scalability across multiple cores, ease of maintenance and debug-ability that can't really be overcome with better implementations and tools.
People like to talk a lot about moving everything to the browser, replacing traditional applications development, but that's just not going to happen with JavaSc
Re: (Score:2)
Scalability I'll grant you, though that's what Intel is working on.
What are the major performance and debug-ability problems that cannot be overcome with better implementations and tools?
What are the major ease of maintenance issues that are not being addressed by ongoing language evolution (e.g. addition of namespacing, modules, etc)?
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
I can't support this idea enough. Lua would be just about the best possible thing that could happen to the web.