The Power of "View Source"

It’s easy eough to obfuscate code without obfuscating it, anyway:

  1. No comments or design
  2. If you’re in a niche enough area (e.g. simulations of complex systems - I’m talking from experience), without the domain knowledge (or, at times, even with domain knowledge), you can see what the code does…but still not understand what it does!

I think Javascript is a great language. It’s often been misused due to the “view source” thing Jeff’s talking about, but it’s pretty amazing how much people have been able to build with it.

The problem with AJAX Javascript isn’t the language, it’s:
(1) Using AJAX where it doesn’t belong
(2) Poorly written custom javascript code instead of code which runs on well-tested, cross-browser libraries
(3) Most importantly - slow standards implementation by a certain very popular browser. Javascript wasn’t built with AJAX in mind, but the E4X Javascript extension was, and it was published in 2004. Guess which of the major browsers hasn’t implemented it, and has no plans to?

More about E4X here: http://weblogs.asp.net/jgalloway/archive/2005/11/06/429666.aspx

@Jon: It’s funny how several years in, this post still draws attention. Great subjects for discussion never really die !

I have to agree with Points #2 and #3 emphatically, but have to go beyond #1, and say that this the area where the most trouble and source of debris on the net is found. The concept of “the long road to rewriting every client application in the world in JavaScript.” is absolutely preposterous. Perhaps it’s some web wingnut’s wet dream ( no offense implied onto that popular typeface, really. ), but put some common sense into it. Sure we’ve got ChromeOS knocking on our door, but the concept that even IT won’t have natively installed applications on the target netbooks is also ludicrious. There always will be native “hard” clients. There will always be the need for “hard” clients.

For anyone who thinks that every desktop or desktop oriented application needs to be web-ified, ask yourself a question. Why, if anything and everything MUST ( or to not be so harsh, should ) be web-based, did everyone bash the darling of mobility that is the iPhone when Apple put off having a native applications sdk for over a year ? Why did they almost immediately start to take out the nails for Palm’s final coffin, when they said they wouldn’t have a native development kit.

Even Google is ushering out an NDK with ( Oooooooo…evil C++, Eewwwww ). Whenever someone speaks in absolutes in this way, about ANY subject, it opens up scrutiny of the rest of the logic behind their argument. “Javascript” ( I know, total misnomer, what can you do ? ) isn’t the savior of programming. No language is.