I would not abstract away my javascript

Yesterday I saw this post by Roy Osherove where he talks about Script# and writing c# code to generate javascript code. I dont realy like this idé, as javascript and c# are two very different languages. While c# is a static programing language, javascript is a dynamic scripting language and it would be impossible to write everything with c# that you can in javascript.

Roy has some good points in that javascript has a way of getting out of hand and quickly become very unreadable. This is a problem that is hard to avoid when writing javascript heavy pages. Libraries like jQuery does fix this a bit and makes it a little bit more readable as you dont have to take different browsers into consideration as much. Of course c# will be a lot more readable still, but I think that the ability to use javascript as it was ment to be used, and use all of its features outweights the readability issue here.

Another thing you have to consider when writing a lot of javascript is exactly how its rendered. As it is sent to the browser it will effect the bandweight and you can save some time here by minifying the output.

The big problem with javascript development today is that we dont have many good tools to work with it. Visual studio is getting better with javasctip, but its still a long way to go. If we had some better tools, it would be a lot easier to develop javascript heavy websites and maintain them. Usually I'm a lot for abstractions of any kind, but abstracting away javascript, ni my opinion, is wrong. It is way to different from c# or any other static language to realy justify a abstraction.

kick it on DotNetKicks.com
Shout it

Comments

Add comment

Name:

Mail:

Website:

Comment:


<< [1] >>
<< [1] >>