YOUR FEEDBACK
Immo Huneke wrote: A well written article, an ingenious solution to a real problem often encountere...
Cloud Computing Conference
March 30 - April 1, New York
Register Today and SAVE !..

SYS-CON.TV

2008 East
DIAMOND SPONSOR:
Data Direct
Frontiers in Data Access: The Coming Wave in Data Services
PLATINUM SPONSORS:
Red Hat
The Opening of Virtualization
Intel
Virtualization – Path to Predictive Enterprise
Green Hills
IT Security in a Hostile World
JBoss / freedom oss
Practical SOA Approach
GOLD SPONSORS:
Software AG
The Art & Science of SOA: How Governance Enables Adoption
PlateSpin
Effective Planning for Virtual Infrastructure Growth
Fujitsu
Automated Business Process Discovery & Virtualization Service
Ceedo
Workspace Virtualization
Click For 2007 West
Event Webcasts

2008 East
PLATINUM SPONSORS:
Appcelerator
Think Fast: Accelerate AJAX Development with Appcelerator
GOLD SPONSORS:
DreamFace Interactive
The Ultimate Framework for Creating Personalized Web 2.0 Mashups
ICEsoft
AJAX and Social Computing for the Enterprise
Kaazing
Enterprise Comet: Real–Time, Real–Time, or Real–Time Web 2.0?
Nexaweb
Now Playing: Desktop Apps in the Browser!
Sun
jMaki as an AJAX Mashup Framework
POWER PANELS:
The Business Value
of RIAs
What Lies Beyond AJAX?
KEYNOTES:
Douglas Crockford
Can We Fix the Web?
Anthony Franco
2008: The Year of the RIA
Click For 2007 Event Webcasts
TOP THREE LINKS YOU MUST CLICK ON


Let's talk JavaScript
An interview with the author of the JavaScript book

Writing a book is not an easy job, and writing a tutorial on programming language is even harder. "The Book of JavaScript" (No Starch Press) is a well written tutorial, with clear and well explained code samples.   Below is a transcript of my dialog with Dave Thau, the author of this book.

Q. For many years JavaScript was considered as a sort of a second-tier programming language with a limited use of prettifying Web pages. The first and second editions of your book  were published six years apart.  How would you compare the now-and-then positions of JavaScript  ?

A. When the first edition of the Book of JavaScript came out, JavaScript was already a mature language.  In the six years between then and the new edition, the language has changed in three directions.  First, the language itself has added a number of new features, including new
useful methods to extant objects, regular expressions, try/catch blocks, and array generics.  These features help people write better and more powerful JavaScripts.  Second, when the first edition came out, browser support for the W3C Document Object Model specification was spotty.  The W3C DOM standard for dealing with style sheets didn't come out until after I was done with the book.  Now the ECMAScript and DOM standards are quite mature and the browsers do a good job of implementing them.  Third, the browsers have added support for XML and
asynchronous calls, which make  Ajax possible. These changes have led to the current resurgence of interest in JavaScript.

Q.As per Tiobe Programming Community Index, during the last year the use of Java, C, C++ has declined while the use of scripting languages such as Python and JavaScript has increased.  How would you explain this?

A. I think the growing popularity of scripting languages comes from their generally lower barrier to entry, and their applicability to a growing need for "smallish" coding projects.  Scripting languages don't have the compilation stage, which slows developers down, and scripting language syntax is often simpler than in languages like Java, C++ and C.  The latter three languages are great for complex projects.  They're also still the top three languages on the Index.  However, for Web programming, the power provided by these languages is generally
unnecessary.  Many of the scripting languages that are gaining in popularity are popular specifically because they are aimed at programming for the Web.  JavaScript, PHP, and Ruby on Rails are great examples of this.  As more people learn the joys of Web programming,
the popularity of these scripting languages will continue to grow.

Q. Two years ago, a catchy acronym AJAX gave JavaScript a second life. You've included three AJAX chapters in your book. Did you do it just to increase book sales or you believe that that this set of techniques has a bright future?

A. In the past, JavaScript code was always trapped in the browser.  You could do many great things with it, but the interaction between the Web browser and the Web server was very limiting.  Ajax simply put a name on a programming style that was made possible when the browsers allowed JavaScript to communicate with Web servers in more complex ways.  I think the popularity of services like Google Maps, Flickr, and Zillow comes partly from the Ajax-enabled interfaces they provide. Ajax boils down to letting a browser request information from a Web server in the background and displaying the information dynamically when the server responds.  This type of communication is very natural, and will always be an important technique in any Web programmer's toolkit.

Q. One of the major JavaScript drawbacks is that it has to deliver tons of code to the client's machine. Recently, I've seen an  application that would download  5MB of JavaScript code to the client's machine. Do you have any practical recommendations for proper design of applications that use JavaScript?

A. Five MB?  That's incredible!  Unless the application is meant to run without a working Internet connection, I can't see a reason to download that much JavaScript.  One of the most useful architectures in Web programming is the model-view-controller paradigm, which separates code meant for displaying information from code which creates and manipulates that information.  JavaScript should be used primarily for interacting with and displaying information and
interfaces.  Code for the non-visual manipulation of data should remain on the server-side.

Q. That particular application has duplicated the business logic on the client in JavaScript in desperate attempt to improve responsiveness of the system...One of the most popular questions that real-world programmers have to answer is where to put business logic, and I do not mean
just validation rules like in your book sample of Dictionary.com. Imagine an enterprise application with lots of business rules - is JavaScript the right place for it?

A. This is more of a question about the best way to split client and server code.  A clean separation of concerns, like that recommended in the model-view-controller architecture, is the only way to write applications with any hope of scaling, or surviving over time. Currently, there is no broadly used server-side version of JavaScript; it is almost entirely used on the client side.   As JavaScript has tended to be browser-bound, it is not the place to code an enterprise
application.  It is best suited to managing interfaces and information display.  This isn't a comment on JavaScript as a language.  As mentioned early, JavaScript is quite mature and could be used as a server-side language.  However, there has been very little movement in
that direction.

Q. In my opinion, using JavaScript on the server size is a stretch...In your book, you often put comments like this code will only work in IE or in FireFox. Incompatibilities of Web browsers is a known  issue. Do you think that say five years from now all major vendors of Web browser will reach an agreement that will allow you to remove these comments from the third edition of your book?

A. In the early days of JavaScript, standards did not exist, or were being created. That has changed, and I think the vendors are doing a good job of following the standards.  The places where browsers diverge are in the "extra" features they offer.  I don't think the browser vendors will ever cease adding these extras.

Q. What's in the future? ECMA-262 specification, fourth edition is in the works, which to the best of my knowledge will become JavaScript 2.0 – a serious re-write of the language.  Do you think JavaScript 2.0 will be supported by Web browsers in the near future or it's more like a concept car?

A. ECMA-262 version 4 has been in the works for years now, and I hear that it's supposed to come out some time in 2007. Some of the features have already been added into JavaScript 1.6 and 1.7, and are supported in Firefox 2.  Most of the features I know about help people write
better programs.  The major browser vendors will certainly implement whatever parts of the specification relate to the Java runtime.

Q. Is there a question that I forgot to ask but you'd like to answer?

Nope!  Thanks for taking the time to review my book. I greatly appreciate it.

It was a pleasure. Your book will be of great help for anyone who's planning to learn or  teach JavaScript.

About Yakov Fain
Yakov Fain is a managing principal of Farata Systems, consulting, training and product company. He has authored several Java books, dozens of technical articles. SYS-CON Books released his latest co-authored book , "Rich Internet Applications with Adobe Flex and Java: Secrets of the Masters" in Spring 2007. Sun Microsystems has nominated and awarded Yakov with the title Java Champion. He leads the Princeton Java Users Group. He is an Adobe Certified Flex Instructor. Currently Yakov works on the book for O'Reilly "Enterprise Application Development with Flex".

LATEST AJAXWORLD RIA STORIES
Curl announced the release of Curl Data Kit Data Services (CDK-DS) for enterprise developers building new applications using Adobe Flex or Flash, as well as developers upgrading existing Curl applications. This addition to the Curl Rich Internet Application (RIA) Platform is an i...
rPath and WANdisco today announced that WANdisco has selected the rPath rBuilder and rPath Lifecycle Management Platform to build and maintain its Subversion MultiSite solution as a manageable set of application images for delivery in virtualized and cloud-based environments. rPa...
MuleSource has announced a partnership with FastConnect that will provide Mule architecture and implementation services throughout the French market. FastConnect spans the domains of data and service integration, through to the user interface, using technologies such as SOA, dist...
Adobe and Intel plan to collaborate on porting Adobe’s Flash widgetry to Intel’s Media Processor CE 3100, a way to put Flash-enhanced web content and rich Flash applications on television. The chip is bound for cable set-top boxes, Blu-ray Disc players, digital TVs and retail...
Here, SYS-CON's Web 2.0 Journal has asked a selection of the industry's brightest minds what their own advice would be in these troubled times, and assembled it into a ten-point guide for software vendors, entrepreneurs, and startups to riding out a recession.
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS
SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021

Click Here

SYS-CON FEATURED WHITEPAPERS

ADS BY GOOGLE