Geeks With Blogs

@mattwatson81
  • mattwatson81 So Snapchat might be worth a billion dollars but yet has no revenue... That's insane because it is also likely a fad that will die soon. about 537 days ago
  • mattwatson81 If it works, stop coding. Nobody cares how it works. about 539 days ago
  • mattwatson81 @dmobbes I will be driving it to every SKC game. So see you there! about 546 days ago

Matt Watson Software developer, product visionary, and master of #dadops
JavaScript Sucks. Yes, I said it. Microsoft's announcement of TypeScript got me thinking today. Is this a step in the right direction? It sounds like it fixes some of problems with JavaScript development. But is it really just duct tape and super glue for a programming model that needs to be replaced?

I have had a love hate relationship with JavaScript, like most developers who would prefer avoiding client side code. I started doing web development over 10 years ago and I have done some pretty cool stuff with JavaScript. It has came a long ways and is the universal standard these days for client side scripting in the web browser. Over the years the browsers have become much faster at processing JavaScript. Now people are even trying to use it on the server side via node.js. 

As an enterprise web application developer, I don't like any scripting or dynamic languages. I like code that compiles for lots of obvious reasons. JavaScript is messy to code with and lacks some modern programming features. There are compiling tools like Closure, jQuery, minify, coffee script, TypeScript and a bunch of other tools that have improved JavaScript. TypeScript looks like it will help with some of the problems like having variable types, compiling, and a better IDE to work with. We spend a lot of time trying to hack it to do things it was never really designed for. I don't think there is any point in debating in this post what the problems with JavaScript are. That isn't the point of the post and anyone who has used it has their own laundry list. (My favorite? Doing financial calculations in JavaScript is lots of fun.) The question is are we stuck with using JavaScript on the client side forever now? What alternatives do we have?

It is possible to program in Silverlight, Java or Flash and run that in the browser instead of JavaScript, but they all have their own problems and lack universal mobile support. I believe Microsoft's new TypeScript is a step forward for JavaScript, but I think we need to start planning to go a whole different direction. 10 years from now is JavaScript going to be the primary solution on the client side still? We need to start thinking about what replaces JavaScript... and I have no idea what the solution is. 

Posted on Monday, October 1, 2012 9:09 PM | Back to top


Comments on this post: JavaScript Sucks. TypeScript Makes it Suck Less?

# re: JavaScript Sucks.
Requesting Gravatar...
I had the same thing in m mind. I think Google is working on this scenario and they are going for a new programming language called Dart which is naively support web development.
Left by diyoda on Oct 01, 2012 10:15 PM

# re: JavaScript Sucks.
Requesting Gravatar...
Yeah ... anytime someone writes an article about a technology and starts off with something like "I really hate working with [technology], here's my article about it" ... I tune out.

Seriously. If I want to read about javascript (even if it is a criticism of it, nothing wrong with that), I definitely won't be reading some crap written by a guy who "hates scripting languages" in the first place.
Left by VoiceOfReason on Oct 01, 2012 11:06 PM

# re: JavaScript Sucks.
Requesting Gravatar...
First of all you need to understand the JavaScript language and power of dynamic languages before talking about replacing it. Closure is not a new concept and is not a compiling tool. There are no compiling tools in JavaScript.
Left by Satheesh on Oct 02, 2012 7:43 AM

# re: JavaScript Sucks. TypeScript Makes it Suck Less?
Requesting Gravatar...
I would not count on javascript going anywhere anytime soon. C++ makes C suck less. But, even if C/C++ sucks, people will continue to use them since they solve the problem they were designed for. This can be seen in .net application; previously Microsoft seemed to be pushing C# as a replacement for C/C++. With Windows 8, Microsoft has made C++ a first class citizen in the .net platform.
Left by CDoty on Oct 02, 2012 2:09 PM

# re: JavaScript Sucks. TypeScript Makes it Suck Less?
Requesting Gravatar...
I think a browser IL needs to start being considered. All this 'guess' work that Javascript compilers need to do is really holding the platform back from performing at the utmost best it can.

Possibly an IL where you can indicate you won't use certain (dynamic type) instructions, and then be restricted away from them - possibly allowing the compiler to get clever with your code. This would allow coffeescript etc. to compile to IL and possibly reap greater benefits in terms of speed.

Still, my sentiments exactly - nice article.
Left by Jonathan Dickinson on Oct 03, 2012 2:02 AM

# re: JavaScript Sucks. TypeScript Makes it Suck Less?
Requesting Gravatar...
I think your last paragraph sums it up perfectly. As long as there is no viable alternative to javascript (good enough to induce universal support from all browser vendors) javascript is not going away. I'd wager it'll still be around in 10 years in some form at least. After all it is really good at stuff it was never really designed to do. (disclaimer: I am a Crockford fan).
Left by Mark Hagers on Oct 03, 2012 3:19 AM

# re: JavaScript Sucks. TypeScript Makes it Suck Less?
Requesting Gravatar...
The main problem with JavaScript, that cannot be addressed by TypeScript, is the poor, sorry absolutely bl**dy awful, support for numerics.

Until that is fixed, for any real software engineering it is no more than a toy.
Left by Rob G on Oct 03, 2012 3:37 AM

# re: JavaScript Sucks. TypeScript Makes it Suck Less?
Requesting Gravatar...
I think the solution said by Miguel de Icaza at his blog.

http://tirania.org/blog/archive/2010/May-03.html

ECMA Language > ECMA Script...
Left by Hakan SOYSAL on Oct 03, 2012 5:06 AM

# re: JavaScript Sucks. TypeScript Makes it Suck Less?
Requesting Gravatar...
A friend, who's opinion I respect once commented he sometimes thinks of Javascript as assembly and technologies such as GWT the natural evolution.

Client side you see JavaScript compilers to native code. As long as the Javascript language/model is not fundamentaly flawed, I think we can continnue to build on what we have for a while.
Left by Sakamoto on Oct 03, 2012 6:55 AM

# re: JavaScript Sucks. TypeScript Makes it Suck Less?
Requesting Gravatar...
Oh.... Lets just go back to programming in binary.

:)

Left by Jack on Oct 03, 2012 7:07 AM

# re: JavaScript Sucks. TypeScript Makes it Suck Less?
Requesting Gravatar...
yeah, javascript sucks, but the platforms it supports suck 10x as much because of their so-called differences between browsers and their lack of standards!!!!!!
Left by luis on Oct 03, 2012 8:17 AM

# re: JavaScript Sucks. TypeScript Makes it Suck Less?
Requesting Gravatar...
Dart is the way to go, it's already faster than JavaScript. Google is doing great things these days...
Left by Yannbane on Oct 03, 2012 8:50 AM

# Everything makes it suck less
Requesting Gravatar...
I've hated Javascript since the first time I had to use it. It's hard to quantify -- there is simply nothing I like about it, except maybe its vague resemblence to C-based languages.

I was thrilled when I met jQuery. I still had to use Javascript, but DOM manipulation and cross-browser issues were a delight. jQueryUI and jQuery Mobile are icing on the cake.

A few weeks ago I discovered SharpKit, a C# to Javascript cross-compiler that is very well implemented. Client-side programming is now a delight, and as new committer on the project I can contribute to its success.
Left by Yvan Rodrigues on Oct 03, 2012 8:53 AM

# re: JavaScript Sucks. TypeScript Makes it Suck Less?
Requesting Gravatar...
Can we please start distinguishing between browser DOM implementations sucking and Javascript as a language sucking? The two are _not_ related. Most people who say they "hate" Javascript hate it because the DOM implementations that they were coding against were a mess, not directly because of the language.
Left by michael on Oct 03, 2012 10:00 AM

# re: JavaScript Sucks. TypeScript Makes it Suck Less?
Requesting Gravatar...
I don't think it needs replacing just improvement, a lot of the frameworks like jquery solve a lot of the incompatibility issues between the browsers.
Left by Damian Dennis on Oct 03, 2012 3:47 PM

# re: JavaScript Sucks. TypeScript Makes it Suck Less?
Requesting Gravatar...
In JavaScript's defense - it was designed for a particular problem domain: SMALL snippets of event handling code.

And back in the day, the "programming language of the web" was considered to be Flash, or Java, and a bit later Silverlight as a competing technology.

JavaScript ultimately became the "programming language of the web" due to a confluence of some odd and extraordinary factors. And now it is used to make large-scale client-side and server-side (e.g. Node.js) applications. But it is still constrained from its humble roots as small snippet glue code for event handling.

So please, before bashing "JavaScript sucks", it is helpful to put its providence in perspective.

And be thankful for CoffeeScript, TypeScript, and their ilk that are trying to lead the way to a better tomorrow.
Left by Eljay on Dec 10, 2012 9:56 AM

# re: JavaScript Sucks. TypeScript Makes it Suck Less?
Requesting Gravatar...
You never know what's coming next. Think back when everyone started using computers, the 80's. Now we're dealing with JavaScript. It seems to me this is backward progress. It's a mess, and if I sat down and thought it through for a few weeks, I could come up with something way less confusing and easier to work with. Seriously, get on it you smart GEEK NERDS!!
Left by Leenie on Feb 08, 2013 2:31 AM

Your comment:
 (will show your gravatar)


Copyright © Matt Watson | Powered by: GeeksWithBlogs.net | Join free