Image for post
Image for post
The Next Generation Enterprise

JavaScript: The Next Generation

How to Fix JavaScript and Learn to Love Web Development

Python did it, moving from version 2.7 to 3. PHP did it, moving from version 5.6 to 7. Perl did it, moving from version 5.22 to 6. What did they all do?

They fixed their language’s most egregious faults by making breaking changes. Why doesn’t ECMA do the same with JavaScript?

After all, JavaScript is essentially a broken language. Using it is like having the Sword of Damocles hanging over your head. It is most disconcerting that this inferior software engineering tool is metastasizing into nearly every corner of IT, from web to server, desktop, mobile, IoT, cloud, games, etc. We should at least give everyone a more solid foundational language.

Just like Python, ECMA should repair the basic, fundamental flaws in JavaScript, instead of piling on new features. It should eliminate all the WATs and WTFs that have so plagued the language and made it a laughing stock.

Fear of short-term turmoil in the web community should not deter ECMA, just as fear of disruption in the Python community did not deter Guido van Rossum.

ECMA can start by instituting something similar to “use strict;”, say, “use nextgen;”. Jettison all the baggage from JavaScript, things like loose typing and freewheeling coercions, the confusing “==” vs “===”, the lack of an integer type, the lack of a proper array type, the dysfunctional “typeof” and “instanceof”, the confusing “this”, and so on. Make JavaScript clean and consistent.

Over time, ECMA can encourage browser makers to adopt the new JavaScript and encourage JS library authors to make their libraries polyglot. It should have a solid migration plan, along with a good marketing plan, to accelerate the transition–it’s better to quickly yank off the Band-Aid than to slowly pull it off. The JS community needs to stand behind the new JavaScript (and I’ll be most happy to join the marketing team). There will inevitably be a period of disruption, but in the long run, it’ll be worth it. This is absolutely doable.

It requires courage. It’s a simple decision: “short-term pain for long-term gain.” Just bite the bullet and do it. Give us the Next Generation JavaScript.

Otherwise, JavaScript risks irrelevancy once WebAssembly finally arrives.

Please, no more putting lipstick on a pig.

Some people may ask: Why go to all this trouble just to eliminate things from the language that can be avoided through the use of ESLint*, and self-discipline, and proper education? Here’s the problem…

The majority of JavaScript developers today have not received the proper education and do not exercise enough self-discipline to use JavaScript well. One only needs to look at the numerous JavaScript libraries that are available. Some are well-written; most are atrocious. These were all written by the current generation of JavaScript programmers, most of whom clearly do not know how to use best practices. Eric Elliott has lamented about this, saying that as few as one in a hundred know what the hell they’re doing!

Every day, more and more novice programmers are joining the ranks of JavaScript developers. Many are self-taught, or have taken online courses that don’t really go very far beyond the basics. And don’t forget David Flanagan’s standard bearer, “JavaScript: The Definitive Guide,” which continues to teach people all of JavaScript’s ugly features. How are they learning the best practices?

Even Douglas Crockford’s “JavaScript: The Good Parts” doesn’t help. I’ve heard complaints about some of Crockford’s recommendations. Not everyone reads his book, and not everyone follows his prescription. It’s just too easy to fall back to The Definitive Guide and use the rest of JavaScript.

The point is that the JavaScript community is growing by leaps and bounds, and the general level of skillfulness is very low. While this complaint can be levelled against other languages such as Java and Python, the situation is greatly exacerbated by the language’s own dysfunctional nature. Can we at least take this impediment out of the equation? Is that really asking too much?

Let’s make the Next Generation JavaScript the very best language we can envision. Let’s finally make web development a proper engineering discipline and love it! Make your voice heard at ECMA. Shout it out to your colleagues. Be vociferous in the blogosphere. Make it so!

* Linters can also produce false positives which cause you to look for phantom problems. This can be a real time-waster.

JavaScript Non Grata

Just say no to this abomination

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store