Sunday, February 26, 2006

Javascript Applications, pt 1

Updated: Continued in Part 2.

Languages (and language studies) are an interesting phenomenon. As we know from anthropology (and middle school social studies), Eskimoes have 20 different words for various kinds of "snow", whereas we have just the one: "snow".

Now, it turns out this is just one more in a long line of urban myths that we've repeated into "truthiness" - and that's also interesting (but a whole 'nother discussion).

We look at language as deeply revealing reflections of underlying culture and structure. And while I don't deny the power that language has and the values that it can imply, I don't believe that it fundamentally enables new capabilities for a society. Is there a language that lacks poetry? Or laws? Or stories? Or religion? And I'm not sure a particular language, in and of itself, has any particular evolutionary advantage - though clearly a particular language's economy of communication is likely a reflection of a culture's evolutionary challenges.

For computer languages, this seems even more apparent. I mean, its pretty much the same CPU underneath, so the language is just a question of vanity and preference, no? It really doesn't matter what language you use, so long as you use it well?

Turns out, not so much
.

Although I think there is a fundamental provability to the notion that good programming is language invariant, the grammar and semantics of a particular language can be measured along a number of axes:


My point here is that language features are not about CAPABILITY: you can (literally) do MORE in Assembly than any other language (although, you know what they say: you can't spell "Assembly" without "Ass"). But languages developed - some evolved, some were designed (intelligently and otherwise) - because there was a need to enable significantly greater complexity and abstraction on top of vastly increasing linear computing power.

Bottom Line? The abstractions various languages provide ultimately matter because they enable significant flexibility, at the cost of some performance. Its all just a question of the value of the tradeoffs.

Pretty long way to go to say that I think while Javascript is great, it also sucks.

I'll explore what features have been valuable and where we've suffered using it to build
desktop applications in my next posts on this topic - along with some specific recommendations (for developers USING Javascript, as well as suggestions for the language itself).

As I've
mentioned before, I think we're among the bold few attempting to use Javascript for Programming in the Large for desktop applications, at scale. Though AJAX is all the rage (*cough* DHTML), the discussions tend to center around "Bitless applications" - stuff in the browser.

A lot of the problems are essentially of the same type (but exaggerated for desktop apps), so I think most of the discussion applies to both, but, obviously, there are some interesting differences as well.

13 Comments:

Anonymous Trekker said...

Your post brought back memories of an Automata class where we had to use a bare bones programming language (with only assignment, increment, decrement operators and a control loop structure) to compute Turing-compatible functions (shudder)

I think portability is more important than you give it credit for. How easy is it to turn around AOL Explorer for the Mac using Boxley-JScript. Maybe it is easy - I'm not sure but seems like we have some OS layer dependencies...but that will almost always be the case except for the virtual machine pattern a la Java and Swing. But then again, as you say, its a tradeoff -- even though Java UI toolkits have come a long way since the dreaded AWT, they're still painfully slow!

February 27, 2006 1:40 AM  
Anonymous Trekker said...

p.s. Of course there is no more IE for Mac but you get my drift...

February 27, 2006 10:30 AM  
Anonymous Anonymous said...

You mean, language is actually just a tool? Man how come I never thought of that...

February 27, 2006 11:17 AM  
Blogger Sree Kotay said...

trekker: I think that's a fair point about portability, and as you say, FAR more essential for web apps and the like.

anonymous: Bite me :)

February 27, 2006 2:17 PM  
Anonymous Nicolas said...

I feel your pain with JavaScript.
We're using it extensively here to build one of our app, which involves a lot of different features and in particular a whole photo sharing application. As we were developing it and facing more and more challenges with JavaScript I started to question if it was a good idea in the end. The problem I saw using JavaScript is that it is too flexible. And programmers tend to abuse this flexibility... As the application grows, it becomes very hard to maintain and debug. One of the solutions to this problem was to enforce the same rules than we have in C++. Meaning, every object should have an interface, no global variable, minimize attaching new members on the fly, etc. Also we added the notion of namespace in JavaScript to prevent code collisions (since every file is being merged into a big one).

It helped us a lot but I am still scared for the future. We have a very modular application (modules being written in JavaScript and communication together with JavaScript) and I am not entirely sure yet how easy it will be to update some modules and not others.

February 27, 2006 11:05 PM  
Anonymous Nicolas said...

A bit more food about JavaScript:
An important thing I forgot to mention is compilation. The strength of JavaScript is its flexibility. But because of its flexibility there are very few things the compiler can assume and detect... Sometimes it is a programmer error, sometimes it is a pure typo. (which you may say, is also a programmer error)
For example, calling a function that does not exist or passing wrong parameters is not detected at compilation time. It will be detected when the program is running and potentially bring the whole application to a halt :( A lot of these mistakes would have been detected in a less flexible language like C++ during compilation.
I've noted that because of this, we're probably spending 30% more time debugging a JavaScript application than a C++ one of same size.
so yes, for computing, language matters.

February 28, 2006 8:32 AM  
Anonymous Nicolas said...

BTW,
I thought you would love to look at:
esoteric languages.
look at the one called "Weird".

February 28, 2006 9:59 AM  
Blogger Sree Kotay said...

Hey nicolas! How hoes it? :)

"Wierd" is pretty frikkin' funny, but my favorite is still "Whitespace" (on that page, too) - That's how I feel when I program in Python :P

Any you're exactly right about flexibility: give people a hammer, and the first they do is put out their eyes :)

February 28, 2006 2:08 PM  
Blogger Sree Kotay said...

Incidentally, nicolas, I do think that all of the dynamic language folks are now recognizing the value of strong types - it reminds me of how the trend moved (dramatically) from permissive HTML parsing being all the rage (and ALLLL the problem we now live with) to strict XHTML/standards compliance.

Turns out *strictness* is a positive in language grammars and syntax - and I think that extends to design patterns as well. My favorite designed language, in this context, is postscript - very clean and consistent. Though I *hate* that its a stack machine - the attributes I like about it don't necessarily require that.

February 28, 2006 2:12 PM  
Anonymous Anonymous said...

runescape money runescape gold runescape money runescape gold wow power leveling wow powerleveling Warcraft Power Leveling Warcraft PowerLeveling buy runescape gold buy runescape money runescape items runescape gold runescape accounts runescape gp dofus kamas buy dofus kamas Guild Wars Gold buy Guild Wars Gold runescape accounts buy runescape accounts runescape lotro gold buy lotro gold lotro gold buy lotro gold lotro gold buy lotro gold lotro gold buy lotro gold runescape money runescape power leveling runescape money runescape gold dofus kamas cheap runescape money cheap runescape gold Hellgate Palladium Hellgate London Palladium Hellgate money Tabula Rasa gold tabula rasa money 陈楚生 压力开关 压力传感器 流量开关 流量计 液位计 液位开关 温湿度记录仪 风速仪 差压开关 可燃气体检测仪 过滤器 强磁水处理器 自清洗过滤器 自动反冲洗过滤器 保鲜棕榈树 棕榈树

November 16, 2007 12:07 AM  
Anonymous Anonymous said...

runescape money runescape gold runescape money runescape gold wow power leveling wow powerleveling Warcraft Power Leveling Warcraft PowerLeveling buy runescape gold buy runescape money runescape items runescape gold runescape accounts runescape gp dofus kamas buy dofus kamas Guild Wars Gold buy Guild Wars Gold runescape accounts buy runescape accounts runescape lotro gold buy lotro gold lotro gold buy lotro gold lotro gold buy lotro gold lotro gold buy lotro gold runescape money runescape power leveling runescape money runescape gold dofus kamas cheap runescape money cheap runescape gold Hellgate Palladium Hellgate London Palladium Hellgate money Tabula Rasa gold tabula rasa money 陈楚生 压力开关 压力传感器 流量开关 流量计 液位计 液位开关 温湿度记录仪 风速仪 差压开关 可燃气体检测仪 过滤器 强磁水处理器 自清洗过滤器 自动反冲洗过滤器 保鲜棕榈树 棕榈树

November 16, 2007 12:08 AM  
Blogger runescape gold said...

runescape money runescape gold runescape gold runescape money buy runescape gold buy runescape money runescape money runescape gold wow power leveling wow powerleveling Warcraft Power Leveling Warcraft PowerLeveling buy runescape gold buy runescape money runescape itemsrunescape accounts runescape gp dofus kamas buy dofus kamas Guild Wars Gold buy Guild Wars Gold lotro gold buy lotro gold lotro gold buy lotro gold lotro gold buy lotro gold runescape money runescape power leveling runescape money runescape gold dofus kamas cheap runescape money cheap runescape gold Hellgate Palladium Hellgate London Palladium Hellgate money Tabula Rasa gold tabula rasa money Tabula Rasa Credit Tabula Rasa Credits Hellgate gold Hellgate London gold wow power leveling wow powerleveling Warcraft PowerLeveling Warcraft Power Leveling World of Warcraft PowerLeveling World of Warcraft Power Leveling runescape power leveling runescape powerleveling eve isk eve online isk eve isk eve online isk tibia gold Fiesta Silver Fiesta Gold




runescape money runescape gold wow power leveling


棕榈树
VI设计
画册设计
血管瘤
肝血管瘤
音乐剧
福卡
防静电地板
美国留学
留学美国
电阻器
不锈钢电阻器
频敏电阻器

睡眠呼吸机
伟康呼吸机
呼吸机
无创呼吸机
家用呼吸机
呼吸机的使用

北京消化系统疾病
北京心脑血管疾病
北京肾病
北京中医儿科
北京针灸减肥
针灸减肥
北京糖尿病
北京疼痛病
北京类风湿

April 03, 2008 8:18 PM  
Anonymous Anonymous said...

The fourth wow power leveling latest game in wow power leveling Warcraft series is ‘wow power leveling’. Also known as wow power leveling, it represents a wow power leveling multiplayer online wow power leveling game, the best of wow power leveling kind. Initially, it was wow gold it be released in 2001, but wow powerleveling was delayed wow powerleveling 2004, thus wow powerleveling the 10 years ofwow powerleveling franchise of thiswow gold series. The world of warcraft power leveling was not world of warcraft power levelingfulfilling, because wow power levelproblems with wow power level server’s stability power leveling wow performance occurred, but power leveling wow game still power leveling wow a financial success powerleveling wow the most powerleveling wow game of its kind. The number cheap wow power leveling users that play Maple Story mesos, exceeds 8.5 MapleStory mesos, worldwide.As a form ms mesos,recognition for mesos,outstanding popularity, the game SilkRoad Gold, received aSRO Gold, of awards. Now the question eq2 plat, why is eq2 gold, game eq2 Platinum, popular? For anyoneEverQuest 2 Platinum, played the previous EverQuest 2 gold, and EverQuest 2 plat, already initiated lotro gold, the mysterious world lotr gold, the breathtaking Lord of the Rings online Gold, this Rolex Replica nothing but an Replica Rolex adventure that continues the story of ‘Warcraft III: Frozen Throne’, four years after conclusion, in the world of Azeroth. The game is online role-playing, the previous versions being online and offline strategy games. The major thrills and unique features are present as in every Blizzard game.

June 10, 2008 4:06 AM  

Post a Comment

Links to this post:

Create a Link

<< Home