HTML5 Zone is brought to you in partnership with:

John Sonmez is a Pluralsight author of over 25 courses spanning a wide range of topics from mobile development to IoC containers. He is a frequent guest on podcasts such as DotNetRocks and Hanselminutes. John has created applications for iOS, Android and Windows Phone 7 using native tools, HTML5, and just about every cross platform solution available today. He has a passion for Agile development and is engaged in a personal crusade to make the complex simple. John is a DZone MVB and is not an employee of DZone and has posted 86 posts at DZone. You can read more from them at their website. View Full User Profile

Why JavaScript Is Doomed

05.07.2013
| 17596 views |
  • submit to reddit

JavaScript is a bubble.

Just like the housing bubble.

Just like the .COM bubble.

Girl with big bubble

And just like any bubble, the JavaScript bubble is bound to pop.

Sure, JavaScript is everywhere.  It appears to be growing at a rapid pace.  But I’m willing to bet that we are getting close to a complete reversal that will throw JavaScript down from its throne, shattering its JQuery scepter with it.

JavaScript never really made a comeback

Part of the problem with JavaScript is that it’s propped up on the back of another technology. See, JavaScript itself was rejected long ago. If JavaScript was a wonderful language to develop in, its wonders would have been praised years ago when it was first introduced. But I remember cursing JavaScript 15 years or so ago.  And I wasn’t alone.

Yes, I know it was a dark time, but recall, if you will, your pure hatred for JavaScript.  You know, before it was so cool.

Then how did this ugly wart of a language become so popular?

Well, you see, it was this little library called JQuery. JQuery solved a very real and annoying set of problems that wasn’t around when JavaScript was first invented: manipulating the DOM and making Ajax calls.

JQuery was basically designed to make JavaScript possible to work with. Before JQuery, DOM manipulation and Ajax calls were difficult. After JQuery, they were easy.Cactus treated with a bandaid

So JQuery ended up being this big band-aid that covered up all the ugly JavaScript code you didn’t want to write and made doing what you wanted to do much easier.

You may disagree with me on this point, and you are welcome to do so, but even if JQuery isn’t the reason JavaScript is so hot right now, do you honestly think JavaScript would have become so popular if JQuery never existed?

The problem with JavaScript

I want to love JavaScript. I really do.

I know it doesn’t sound like I do, but just like I can’t make myself like sweet potatoes—even though I know how good they are for me—I can’t like JavaScript.2091023-051

I’ve tried many things. I’ve put some butter and brown sugar on a freshly baked sweet potato. I’ve doused it with hot sauce. I’ve even pretended it was a regular potato and dressed it up like one. But, the fact remains, I just don’t like sweet potatoes. It’s something in their very nature that I despise.

I’ve tried the same thing with JavaScript. I’ve added libraries that make it much sweeter, like JQuery and Backbone.js. I’ve used tools like CoffeeScript and TypeScript to try and pretend it was a more palatable language. But the fact remains, JavaScript has some things that are fundamentally wrong with it that no amount of covering up or pretending will fix.

If JavaScript wasn’t so ugly at heart, then a book called “JavaScript, The Good Parts,” probably wouldn’t be the #1 best-selling book on Amazon for JavaScript, the #3 best-selling book on web development, and the #4 best-selling book on software development, would it? (Go ahead and check it out for yourself if you don’t believe me.)

I don’t really need to tell you again what is wrong with JavaScript. If you use JavaScript, you know. If you don’t use JavaScript, just search for “why JavaScript sucks” on Google and you’ll get plenty of answers.

The point is, unless we are going to be completely disillusioned about it, we can probably all agree that JavaScript is not the greatest programming language that was ever created, and that it has some glaring weaknesses.

My point is not to bash JavaScript

Before you pitchfork me, I want to clear a few things up.

I don’t hate JavaScript.

I don’t suggest you shun JavaScript and go off with me to a floating island in international waters where we will build a new internet, one that isn’t infected by JavaScript.

I actually use JavaScript.
Not only do I use JavaScript, but I have to use JavaScript and so do you.

And if you are smart and want to have a good career in software development, you’ll take everything I am saying with a grain of salt, knowing that I could be completely wrong.

If you are smart, you won’t just dump JavaScript out the window, betting that it will fail, because it might not. It might grow to become the one universal language that replaces all other programming languages. JSON sempiternus!

But, on the other hand, if you are smart, you won’t put all your eggs in the JavaScript basket either. Even though the world seems bright and cheery for JavaScript developers today, it also seemed equally bright and cheery for Blackberry devs not too long ago. And look how that turned out.

And if you are solely a JavaScript developer or you really like JavaScript, I sincerely don’t mean to offend you, but I offer this piece of advice: You are not the technology you happen to be using.

Trust me, if you’re a good developer, you’ll still be a good developer even if JavaScript goes away.

What is actually awesome about JavaScript has nothing to do with JavaScript

No one gets up in the morning and says, I want to have bamboo shoots shoved under my fingernails. (Ok, well maybe some people do, but those guys are still writing object-oriented Perl.)

Yet, at the same time so many developers get up in the morning, fire up their IDE—or excuse me, lightweight text editor which has 50 plugins installed to give the capabilities of an IDE, but is not an IDE—and write JavaScript code. Why do they do it, unless they think JavaScript really is awesome?

It’s because all the stuff around JavaScript and built with JavaScript and on top of JavaScript is actually pretty awesome.

As much as I loathe JavaScript itself, frameworks like JQuery, Durandel, Backbone, Angular, Knockout and more are pretty darn cool.

Not only that, but JavaScript is everywhere!

Every browser is a JavaScript interpreter. Every notebook, PC, tablet, and smartphone can run JavaScript.

There are even cool server technologies, like Node.js that are built with JavaScript.

JavaScript runs in the browser, it has plenty of hooks in it for manipulating the DOM, and it has tons of cool libraries that give you the power to do awesome things, what’s not to love?

This is the part where I tell you what is not to love

holding hands

What’s not to love, is that all of that stuff has nothing to do with JavaScript itself.

Take JavaScript away and replace it with another programming language and you don’t really miss anything.

Ever seen a movie star without her makeup? Makes you realize that any halfway decent looking woman could be a movie star, with the proper styling.

The same goes for JavaScript. It is a language that has been dressed up to look like something it is not. What we all love about JavaScript is not the language itself, but all that makeup that has been caked on, a little bit of mysterious seduction it infers, and the stylish clothes it wears.

But, what is starting to happen already, and what I believe will continue to happen, is that people will start to get sick of that caked-on makeup look and high maintenance personality of JavaScript.

All those frameworks were really useful at first, but they are becoming such a huge mental burden. Are you worried about what JavaScript framework you need to master and keeping up with what is the hot one to use on any given day? I am.

You can only build so much on top of something else, before you have to wipe the slate clean and start over.

I don’t know when this will happen with JavaScript, but I am pretty sure it will happen.

It is very likely that a language like Dart, that can do everything JavaScript can do and more, will likely someday dethrone our web development king.

JSON sempiternus!

By the way, check out my new experiment on YouTube, going to release a short video each week.  Let me know what you think.




Published at DZone with permission of John Sonmez, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Comments

Robert Saulnier replied on Tue, 2013/05/07 - 12:41pm

I disagree that it's jQuery that made JavaScript so popular. It's something that happened before that: Ajax, which gave us Web 2.0. That's when developers went JS crazy, and we needed something like jQuery to let us keep some of our sanity.

JavaScript usage may be a bubble, but it's a tough bubble that will only pop when browsers support another language.

Paul Topping replied on Tue, 2013/05/07 - 1:08pm

I predict TypeScript and future versions of JavaScript will beat it into a real programming language while retaining all its "good parts" and that this will happen before any other language like Dart gets very far. I don't know how hard Google is pushing adoption of Dart by other browser makers but, AFAIK, there is no evidence of any adoption outside Google.

David Gonzalez replied on Tue, 2013/05/07 - 3:00pm in response to: Paul Topping

I agree with this sentiment. I've been using TypeScript extensively and I really like how it remains simple and still generate a readable javascript (at least for me). 


As for Dart, Microsoft already made a decision (http://blogs.msdn.com/b/ie/archive/2011/11/22/evolving-ecmascript.aspx)  for those interested in reading about it.

Anyway to whole article, I enjoyed it and agree with most of it. 

Erwin Mueller replied on Tue, 2013/05/07 - 7:27pm

 I'm just asking myself, what is this "pretty awesome" stuff that almost every JavaScript or Web developer is so excited about?

You mean stuff like Drag&Drop of files to be picked up by the web browser and upload to a server? You mean the Doom 2 remakes that runs with 15 FTP and consumes half of my CPU cycles? You mean rounded corners for div sections? You mean this horrible piece of text input panel?

I really beg you, please show me that "pretty awesome" stuff. And no, Nodej is not "cool server technologies" (maybe for a web developer it is).

But I enjoyed your article.

Paul Topping replied on Tue, 2013/05/07 - 7:45pm in response to: Erwin Mueller

If I may risk speaking for the author, the "pretty awesome" stuff are the JavaScript libraries, controls, frameworks, etc. that have been built on top of what started out as a simple scripting language used to program what happens when the user clicks on a button. JavaScript is a very powerful language that allows virtually any abstraction one can conceive to be implemented. Within the world of web pages and apps, these libraries represent an explosion in experimentation in a domain that previously only OS and GUI designers could play. Sure, a lot of it is going to disappear over time but it still impresses me.

Erwin Mueller replied on Wed, 2013/05/08 - 7:47am in response to: Paul Topping

 The problem where I see the current development with the Web and subsequently with JavaScript is away from what was making the Web great: at delivering content, and towards what the Web was not designed at all: to apps.

IMHO almost all Web designers try to shoehorn to each Web site what the Web is horrible at: GUI elements like menus, windows, dialogs, etc.

Takes this text panel at D-Zone for example. Instead to give me just a simple text panel you Web developers try and make it in a mini-word processor.

So I ask you: why not just use the simple [input] tag and let the web browser decide if this input tag should be a mini word-processor? The web browser can use native buttons, or in could use libraries like Qt5 or GTK+ to put the mini-word processor here. But no, instead it must be done with JavaScript; with works only poorly and only half the time.

Firefox and Chrome now have more lines of code then the Linux Kernel (or almost close to it). But the developers done nothing at all to make content delivery more easily or more pleasant.

The web is still light years away to present text in a pleasant way, for example. For an example of pleasant to read text please open a (paper) journal of your choice or look at any Pdf article on arXiv.org

Also nothing was done to make Web sites more searchable. The best method of search is still a full index search of the web site, because no meta-information is available, besides maybe the h1 or h2 tag. I think HTML5 is finally have added some meta-support with the summary and time tags, and some possibility to make text more readable with the wbr tag.

The Wordpress plugin Typography for example goes at great lengths to make text more pleasant to read: http://wordpress.org/extend/plugins/wp-typography/
Sadly, I couldn't see anyone to use it yet.

Why is the text now blue with underscore? Because still with all your libraries and frameworks and 10 years of development the Web and JavaScript still are bad to shoehorn app like GUI in the web.

Stephan Rauh replied on Wed, 2013/05/08 - 4:11pm

Basically JavaScript is popular because users want to use everything they know from their desktop applications - and you can't do that without JavaScript if you insist on using an application both on desktop PCs and mobile devices. So the industry has build a huge amount of software based on JavaScript. The massive investment in JavaScript applications is why JavaScript is here to stay.

Even if JavaScript were doomed by languages like Dart, it would be a slow process. I guess the bubble will need the better part of a decade to pop :).

Pravin Singh replied on Wed, 2013/05/08 - 10:37pm

'Bubble' is a strong word to use. Bubble has hysteria element with it, where people start to believe in something just because everyone else is doing it. I don't think that has happened yet, ppl. still see some value in using JavaScript.

Andrew Carlson replied on Thu, 2013/05/09 - 1:25pm

I would like to replace javascript. Please direct me to a dynamic, functional language, that can be both a scripting language and benefit from look ahead compiling techniques. If it is not too much to ask, I would like a reasonable guarantee that it can be executable almost anywhere. I don't need a Turing complete language. I just need a crowd of contributors to extend this language with helpful libraries so I don't have to keep doing it myself.

Maybe with the new DARPA backing, Python will evolve into something like this. 

For it's warts, I think the biggest pain points of developing with javascript are nicely handled right now. I like functional programming. I like object-oriented programming. I prefer to right (pun) with Groovy and Grails instead of Java. I prefer Scala if I can't do Grails. 

I prefer javascript to PHP currently. As long as the js is well documented I prefer to use REST and callbacks within HTML over generating HTML with PHP. Javascript outside of the browser has been a good experience as I have been able to use the nice eventing model for machine learning algorithms in Node.js. I even led two separate development groups in design of an engineering iPad app that allowed the ME's and PE's to use a subset of javascript (our first DSL) to apply Excel like expressions over form field values. That was a big win because, well, we used javascript inside Titanium and made an app. Then we simply let them build the formulas in a web page and it was pushed to the app and executed locally. The usual route is by pushing "updates" through the App Store if we stuck with Obj-C. Using Titanium we also avoided pushing things to a web view. Zero performance complaints internationally. Tremendous performance praise. Also, I might mention we released the first version of the first app in 90 days. The second was pushed from design to field testing in two weeks. A lot of that was due to not having to learn a language since we did everything in javascript.  

Still, I love finding better ways. Since javascript might be limiting my R&D group, I look forward to some suggestions.

Gjorgji Dimitrov replied on Sat, 2013/05/11 - 1:36pm

I've thinking to read something specific and interesting toward JavaScript related topics, but I was disappointed. 

Son, please take your pills, your analysis is lack of knowledge, your impressions sounds like a junior developer who just face with JavaScript,  you sounds like a baby that just started drinking milk and and complains why should I drink hot milk. 

Will never gonna read your articles in the future!

Jon Davis replied on Sat, 2013/05/11 - 5:57pm

Javascript is popular because it is an interpreted language that processes commands at runtime, it is structured enough to offer some basic order, it is flexible enough to be called both "functional" and "dynamic", it is simple enough to be mostly human-readable, it is lightweight enough to be declared inline as a markup attribute value as easily as it is to be referenced as an external component (js file), tailorable enough to be clothed with tooling and syntactical enhancements (jQuery, CoffeeScript, TypeScript, even Dart compiles to Javascript) and at its most basic flavoring it's familiar enough syntactically to be readable and maintainable by anyone with experience in C, C++, Java, C#, and a mess of other similar syntaxes. Your rant said nothing about WHY you hate Javascript, only that it is distasteful to you. Do you have any clue as to what kind of foothold Javascript-enabled web and app executing devices have around the world? JavaScript is not going anywhere, it's here to stay, till the destruction of mankind as we know it. You might as well learn to appreciate it.

Ryan Martin replied on Tue, 2013/05/14 - 12:03pm in response to: Jon Davis

I disagree. While those are nice features (functional,dynamic etc) it's not what makes JS popular. 

It's popular because it's the only language available that runs across all browsers. That's it. 

There's no other choice. 

Ryan Martin replied on Tue, 2013/05/14 - 12:33pm in response to: Stephan Rauh

I have a different perspective. JS is popular because the web grew extremely fast. That caused massive amounts of legacy baggage and creates a barrier to change. If you couple that with the fact that massive reach was only available to the lowest common denominator type of development you find yourself nearly 20 years stuck in the same predicament. For all the web's openness there is little choice in technology.  This is why there has never been an even marginally successful language to compete with js for client side web development. 

I think this is starting to change.

  •  JS is starting to get pushed down into the realm of "assembly" language. 
  • Proliferation of compilers or "transpilers" allowing different languages or at least modernized syntax. 
  • Better optimizations that get close or surpass hand coded JS. 

Once those concepts really take hold (and they are) : 

  • add the existing JS syntax that would get compiled to optimized JS "assembly" or run unmodified in earlier browsers. 
  • Now JS starts to fade as the only choice for clientside web dev.
Those things in my opinion is how you deal with massive amounts of legacy while advancing web development with the least amount of friction. Typescript , Dart , coffee script and others are pretty compelling examples of this shift. 


Stephan Rauh replied on Tue, 2013/05/14 - 5:03pm in response to: Ryan Martin

I didn't look at it this way before, but you're right: When people start to write cross-compilers for a higher-level languages (e.g. Dart) generating Javascript, Javascript becomes sort of an assembler language. That's bad news for John's idea: You'll always need of assembler code. Javascript's never going to be doomed :).

On the other hand, Javascript is still under development. It's an interesting language today, and both ECMAScript 5 (see  http://blog.oio.de/2013/04/16/ecmascript-5-the-current-javascript-standard/ ) and ECMAScript 6 (see http://blog.oio.de/2013/05/09/ecmascript-6-the-future-of-javascript/ ) offer a lot of interesting new features. So maybe developers will find future versions of Javascript interesting enough to keep it alive.

We're living in interesting times!

Jon Davis replied on Tue, 2013/05/14 - 6:22pm in response to: Ryan Martin

That's BS. There was VBScript, which failed. There were others that failed.

David Vree replied on Wed, 2013/05/15 - 9:03am in response to: Ryan Martin

This is 100% correct.  

It's as if there was one woman left on earth and we're reading articles to describe her popularity in terms of her physical attributes.  You want a cross-browser, cross-platform, web application...no other way to do it (yet).

Russell Bateman replied on Wed, 2013/05/15 - 10:57am

 That's not a sweet potato, it's a yam.

Sean Phillips replied on Wed, 2013/05/15 - 11:30am in response to: David Vree

"You want a cross-browser, cross-platform, web application...no other way to do it (yet)."

Soon.  Very Soon.

 http://wiki.apidesign.org/wiki/Bck2Brwsr


Ryan Martin replied on Wed, 2013/05/15 - 12:08pm in response to: Jon Davis

And why did they fail? 

Because javascript was the best? Not likely. 

Because javascript was the only "dynamic","functional-like", "interpreted" language? Nope.

 



 

Ryan Martin replied on Wed, 2013/05/15 - 12:20pm in response to: Stephan Rauh

Interesting times indeed!  I don't think JS is going anywhere either and ES6 looks great if it ever arrives lol. I just don't want to be forced to use it!  

Hubert Rabago replied on Wed, 2013/05/15 - 12:30pm

Jon Davis is correct.  You never really identified any one thing about JS that you didn't like.  The closest you came to is this:

"This is the part where I tell you what is not to love - What’s not to love, is that all of that stuff has nothing to do with JavaScript itself."

This explains, then, that you don't really hate Javascript itself.  It's the non-JS "stuff" that you actually hate, "stuff" that you didn't identify but you clarified has nothing to do with Javascript.

Joerg Eschmann replied on Wed, 2013/05/15 - 2:41pm

This post is totally useless. Do yourself a favor and rethink your articles before submitting them.

The magical question is: Do the readers profit from my post?

If the honest answer is no - not even think about clicking on submit!

Zsolt Kiss replied on Thu, 2013/05/16 - 10:17am

I totally agree with the last comment. This post is not only useless, but also very offensive, lacking the smallest amount of objectivity. I was shocked when I first read it. I could not imagine to see a "hate speech" in the domain of IT. I thought this is not common here, because IT people are rational. Well, not quite.

In your hate speech you do not give ONE objective reason for your hatred. You are just trying to blackmail the language for sg which are most probable personal problems. As regarding Javascript, I don't think it needs any defendance: it is one of the key languages of the Web. While, like any other language, it has it's problems it is one of the most powerful programming languages. Many people have seen it, but few understand fully it's constructs. It is a dynamic language, event-oriented (perfect for the web), with a very easy and elegant (yet powerful) syntax. It's greatest problem is it's lazy, "all-allowing" style (and lack of a standard module system), which makes it harder to collaborate. But hey, we are humans (and can solve anything.)

Because it's basically the only language of the browsers it will live - at least as long as the web. Yeah, I like Dart and it might "dethrone" Javascript some day: but we'll have to wait first.

Do me a favour: do not publish any more.

regards,

Joshua Keroes replied on Thu, 2013/05/16 - 5:12pm

No one gets up in the morning and says, I want to have bamboo shoots shoved under my fingernails. (Ok, well maybe some people do, but those guys are still writing object-oriented Perl.)

Yeah, yeah you got us. 

It may not be the point of the article but just to keep the record fair, that 2001 book describes the  an object system released with Perl 5.00 way back in 1994. https://metacpan.org/release/Moose or a derivative is what Perl developers use today to write OO code.

The bamboo shoots only go in my stir-fry these days.

Ryan Martin replied on Thu, 2013/05/16 - 5:58pm in response to: Zsolt Kiss

"Hate speech"? Really? A bit heavy handed methinks. lol. 

Stefan Burwitz replied on Mon, 2013/06/17 - 5:07am in response to: Ryan Martin

Agreed - quite simply JS is the only language supported across all browsers - that's why its popular. Not the most pleasant language to use but it's powerful and it's not going away anytime soon.

Jon Davis replied on Mon, 2013/06/17 - 5:36am in response to: Jon Davis

Ugh, this reply was posted in a pinch on a mobile device and was poorly thought out. Not changing my disagreement, just annoyed I can't edit or delete a comment .. thanks dzone

Peter Stavrinides replied on Mon, 2014/01/13 - 4:38am

 WOW, ignorant!

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.