YOUR FEEDBACK
DataCore and Egenera Combination Delivers Next Generation Server and Storage Virtualization
Virtualization news for the channel community and you ! wrote: Trackback A...


2007 West
GOLD SPONSORS:
Active Endpoints
Your SOA Needs BPEL for Orchestration
BEA
Virtualized SOA: Adaptive Infrastructure for Demanding Applications
Nexaweb
Overcoming Bandwidth Challenges with Nexaweb
TIBCO
What is Service Virtualization?
SILVER SPONSORS:
WSO2
Using Web Services Technologies and FOSS Solutions
Click For 2007 East
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
SYS-CON.TV
TOP THREE LINKS YOU MUST CLICK ON


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

Digg This!

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. Yakov teaches Java and Flex 2 part time at New York University. He is an Adobe Certified Flex Instructor and an Editor-in-Chief of Flex Developers Journal.

LATEST JAVA STORIES & POSTS
Software Development with SQL Anywhere and Java Webcast
This webcast will examine how Java developers can create powerful database applications using SQL Anywhere. Whether you use Eclipse, NetBeans, or any other development tool, SQL Anywhere allows you to implement rich data-driven applications that can run in a wide range of scenari
Free Download - Simplify Java Persistence with InterSystems
InterSystems simplifies persistence for Java developers by providing product that allow simultaneous SQL and object data access without mapping. InterSystems Caché is the high-performance object database that runs SQL faster than relational databases. It includes InterSystems Jal
Xenocode Introduces New Application Virtualization Technology
Xenocode launched its flagship offering, Xenocode Virtual Application Studio. Xenocode Virtual Application Studio is a next-generation application virtualization environment that allows Windows, .NET and Java-based desktop applications to be deployed in standalone executables tha
Red Hat Named "Platinum Sponsor" of Virtualization Conference & Expo
Red Hat is a trusted open source provider. Red Hat offers enterprise customers a long-term plan for building infrastructures on the quality and innovation of open source. Combining open source operating system platform, Red Hat Enterprise Linux, together with applications, mana
3rd International Virtualization Conference & Expo: Themes & Topics
From Application Virtualization to Xen, a round-up of the virtualization themes & topics being discussed in NYC June 23-24, 2008 by the world-class speaker faculty at the 3rd International Virtualization Conference & Expo being held by SYS-CON Events in The Roosevelt Hotel, in mi
Embarcadero Buys CodeGear from Borland
Embarcadero Technologies announced that they signed a definitive asset purchase agreement with Borland Software Corporation to purchase its CodeGear division. The transaction is expected to close in 30 to 60 days. By combining these comapnies in development tools and database too
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

SYS-CON FEATURED WHITEPAPERS

ADS BY GOOGLE
BREAKING JAVA NEWS
CollaborateMD Surpasses 500,000 Monthly Healthcare Transactions
CollaborateMD, a leading provider of Internet medical billing software for physician of