Friday, January 28, 2011

JavaScript and mental stack

I've been playing with heavy JavaScript - for Diagramo - for about an year by now.

There are things you can not realize instantly but you need time for your brain and body to realize.

What do I realized?
In JavaScript - for large programs - you have a heavy mental stack.
Let me explain a little bit.

By mental stack I mean all the things you have to load in your brain (code, exception, configs, etc) so that you can be productive.

JavaScript is a "script" language
Wow, that is fine...except for the case you have a large program. In Java you have strict types and it's medium difficul when you start a program but it keeps to be that way no matter how big the application grows.
In JavaScript it's super fast to make a prototype but it starts to be harder and harder to develop and maintain as the code grows.

JavaScript runs in a browser
Wow, that cool....but what if you need to write some test units? Or if you need to make other automated tasks?
You need tests and testing. You can not have a big application with a decent quality without some tests.
I have to use the Rhino implementation of JavaScript to run them in console.

But wait! How can you simulate a real browser enviroment in console? can not :(

Conclusion ?
I know you can organize your code better but that is what I felt while coding in JavaScript.

Here is what Cliff said about mental stack.

No comments:

Post a Comment