Remember the days when some people, concerned about security, would disable JavaScript in their browsers? Today that seems like a ridiculous notion. JavaScript rules the Web.
In a computing era marked by a wild diversity of platforms, we need apps that can run on any device with a browser. Native apps may run faster and exploit platform-specific features JavaScript can't touch, but we're already living in a cloud world. Are you going to write a desktop or mobile app that runs on just one platform, or write one in JavaScript that anyone can use?
[ Also on InfoWorld: Check out these 7 cutting-edge programming experiments worth trying. | For quick, smart takes on the news you'll be talking about, check out InfoWorld TechBrief -- subscribe today. ]
Of course, the answer to that question depends on the nature of the app. JavaScript has obvious limitations -- for security reasons JavaScript can't read or write files on the client, for example, and "real" programmers like to hammer on a slew of shortcomings. But JQuery and a host of other frameworks have made JavaScript much more practical for building complex applications, while JSON (JavaScript Object Notation) has all but supplanted XML for data transmission. Not to mention that Node.js, which just won another InfoWorld Bossie award, has provided a powerful way for JavaScript to address the server side.
How far can JavaScript be pushed?
By coincidence, the two most recent posts in InfoWorld's New Tech Forum both talk up the potential of JavaScript: One by Dan Bricklin, a guy known to graybeards as the co-creator of VisiCalc, and one by Divya Manian and Thibault Imbert of Adobe.
In "JavaScript beats native code for mobile," Bricklin calls into question the assumption that JavaScript executes slower than native code:
While it's true that for general computation of mathematical operations native code should be able to run circles around JavaScript (and compute those circles while doing it), that viewpoint ignores the fact that far different operations are performed in many apps and JavaScript-based apps often equal or beat native code for those operations.
Why? Because, Bricklin says, very smart programmers have been tweaking browsers for years to optimize the speed of those operations. Plus, progress is being made as we speak in more advanced in-browser operations such as 3D rendering. (Plug: Don't miss a comparison of JavaScript data visualization frameworks that InfoWorld will post next Wednesday.)
Writing on behalf of Adobe, Manian and Imbert peer into the future of JavaScript and call out the Mozilla research project asm.js, which "defines a subset of JavaScript that can be generated by compilers and highly optimized by JavaScript VMs." More exciting is their exploration of RiverTrail, a parallel programming model and API for JavaScript developed by Intel. The authors also talk about new HTML5 features Adobe is proposing to standardize, including Regions, Blend Modes, and Shapes.
It scarcely needs to be said that, by implication, Manian and Imbert's post throws another shovel of dirt on the grave of Flash and ActionScript.