JavaScript The Evil Parts - You Can't Maintain It
Written by Ian Elliot   
Wednesday, 06 June 2012

In a recent panel discussion at Lang.NEXT, Anders Hejlsberg claimed that JavaScript programs aren't maintainable.

It is almost a shame to have to focus in on a few lines of what is an interesting discussion. If you know just a little of more than one programming language, you will find this video fascinating and instructive.

In case you don't know the panel, Anders Hejlsberg, Gilad Bracha, Martin Odersky, and Peter Alvaro are some of the most influential language experts. Anders Hejlsberg brought us Turbo Pascal, Delphi and C#, not to mention the whole idea of .NET.  Gilad Bracha invented Newspeak and is currently the main behind Google's Dart. Martin Odersky is the man who invented the Scala programming language. Peter Alvaro is perhaps lesser known, but as a PhD student working on the intersection of database and distributed systems, he has a lot of interesting things to say and brings a different perspective to the chat.

eviljavascript

As the moderator, Erik Meijer, points out the panel has a wide range of views on language design and on role of data typing in particular.

Watch the video and I promise you will be entertained and informed by the diversity of viewpoints - if only the sound quality were better there would be nothing to complain about. If you haven't the time to watch the entire video and really want to know what was said about JavaScript, jump to around 11 minutes or read the account below:

 

Anders Hejlsberg:

 "...a new cross platform language called JavaScript and the typesystem went out with the bath water. Now we can all wonder how we do medium to large scale development.

Erik Meijer:

"...Are you saying you cannot write large programs in JavaScript?"

Anders Hejlsberg:

"No, I think you can, but I don't think you can maintain them."

The laughter at this point is telling of the opinion and attitude of the audience and the panel.

Anders Hejlsberg:

"... I tried a refactor in a big JavaScript program. Is this x the same as this x over there? I'm afraid I couldn't tell you."

From here the discussion goes on to explain that this is the reason Google is creating Dart:

Gilad Bracha:

"...you can write them (large JavaScript programs) but after that you will be suitably punished."

Erik Meijer:

".. but if you look at JavaScript it was defined independently of HTML"

Gilad Bracha:

 "That's true but combining two bad things does not make them better. "

From here the talk goes on to other interesting topics, mostly with an undercurrent of strong typing v weak typing.

So what can we conclude - is JavaScript evil?

Up to a point yes, but the solution ins't necessarily a new language. Good tools that help you discover whether "this x the same as this x over there" are essentially as good as introducing new language constructs. If you can write a big program, you can maintain it if the tools to do so are good enough - in the case of JavaScript they are virtually non-existent.

If you have a hammer then every screw looks like a nail.

If you have a panel of language geeks then every problem needs a new language to solve it.

For Anders Hejlsberg the ideas he expressed in the discussion must be very difficult to maintain in a Microsoft world where JavaScript is now a first-class language alongside the elegant C#.

Microsoft once had the role of a leader in language design and implementation. Even if you don't like strong typing and prefer another language paradigm you have to admire C# and the .NET system as being an intelligent approach to programming. Given Microsoft's current disdain for languages and language development, it would come as no surprise if Anders Hejlsberg was looking for a new home - the only question is where is there a suitable powerbase capable of supporting something as large and ambitious as .NET.

 

eviljavascript

 

JavaScript isn't evil - it's just different and it's here to stay. We need to learn to live with it.

Related Articles

Why JavaScript is a Jem

JavaScript - is the new Basic!

JavaScript inherits the earth

 

To be informed about new articles on I Programmer, install the I Programmer Toolbar, subscribe to the RSS feed, follow us on, Twitter, Facebook, Google+ or Linkedin,  or sign up for our weekly newsletter.

 

espbook

 

Comments




or email your comment to: comments@i-programmer.info

 

Banner


Learn Python With Dan The Machine Learning Engineer
23/12/2024

aka Dan Kornas who runs a very successful X account about everything related to engineering ML applications. And what is he using in his tutorials? Python, of course.



A Tee Is Not Just For Xmas - Top Tees
20/12/2024

Programmer gifts - easy idea, difficult implementation.  Here's our pick of tee-shirts for giving, buying or just wearing at any time of the year.


More News

 

Last Updated ( Friday, 11 December 2020 )