Quantcast
Channel: Code:Q
Viewing all articles
Browse latest Browse all 50

The Ajax Experience, Day Two

$
0
0


Slept like a baby all night, thanks to a really good bed and that I managed to turn down the temperature to a healthy 61F/17C. Over breakfast I talked to one of the Atlas guys. It turns out Atlas is very similar to DWR in that it mostly is a remoting/proxy framework for exposing server functionality to browser JavaScript. Atlas uses JSON as data protocol, instead of XML, which is kind of surprising.

First session of the day was Combining advanced JavaScript/DOM techniques and Ajax to build better User Interfaces by Thomas Fuchs, the main author of Script.aculo.us. His first point was to use a framework when you develop Ajax applications, since it will let you concentrate on features instead of JavaScript browser bugs.

He also talked about what is new in Prototype in 2006; Ajax behaviours. Seems to be generation of JavaScript on the server that is executed in the browser. DWR will have the same functionality in version 2.0.

He then talked about Script.aculo.us 1.6, which has these parts:
  • Effects, basic and combined
  • Drag and drop
  • Real-time search
  • Autocompleting
  • Inplace editor
  • Slider
  • JavaScript unit testing
  • DOM Builder
Integrated with Rails, Wicket, Symfony, Tapestry, Monorail, etc.

A few other points of interest:
  • Never trust an Ajax call, since it may not come from whom you think
  • Always validate user input on the server
  • Always use HTTP caching to improve performance
  • Don't overengineer your application, i.e. make it simple
  • Don't use display:none in external CSS, since it breaks how things works. Use the style attribute instead: <div style="display:none">...</div>
  • IE has some ID bugs, so don't use the id:s "length", "item", "namedItem", "tags" or "urns"
  • The first rule of Ajax debugging: Use Firefox. Web Developer and FireBug are very good extensions. He also talked about Tamperdata of which I've never heard before.
Second session of the day was JavaScript Exposed, Part One by Glenn Vanderburg.

Interesting notes:
  • Always terminate statements with semicolon;
  • Stay away from reserved words! There are "a great many of them";
  • Don't use "with" since it can hide various other things in your scope;
  • Make sure you delete functions that create closures, or you might get memory leaks;
In general this was a very good session I can heartily recommend to anyone having the chance to attend it in the future.

During lunch I bumped into two other Norwegians and introduced them all to eachother. Three Norwegians so far at the conference, only one Swede. Bummer.

I skipped the keynote about Flex that was held after lunch and instead spent time checking my email. At 3 pm I attended JavaScript Exposed, Part Two by Glenn Vanderburg. This time he concentrated on how to do object oriented programming in JavaScript. Again, very good teacher. He talked about how things are different from what one might expect, but also explained why things are as they are. Reminded me a bit of Stroustrups book on the design of C++, which does the same thing for C++.

A few interesting points:
  • There are ways of making things private in JavaScript classes, but Glenn didn't think they were worth it
  • Doing inheritance in JavaScript is possible, but not really worth the effort
  • Recommended book: JavaScript: The Definitive Guide, 4e by David Flanagan.
  • Recommended site run by Douglas Crockford: http://www.crockford.com/javascript/
Fourth session of the day was TIBET - an Ajax-based Client/SOA Framework by Scott Shattuck.

Well, what can I say? Looks pretty amazing. Its infrastructure seems like 3 years ahead of time. As an example, you boot Tibet applications in the browser, which starts the Tibet kernel! It also has its own shell, TSH, with which you can interact with the Tibet application at runtime!

Tibet kind of reminds me of the Taligent libraries from the heydays of C++. It was also way before its time, but didn't take off anyway. Too advanced? If a product can't be grokked by a person like me in 1 hour, then it won't really take off. Not that I'm necessarily smarter than people in general, just that I'm more curious than people in general. I'm willing to try new tools, even if they might hurt my fingers. But tools can also fail by being so difficult to turn on that you lose interest before it gets useful.

He didn't really show anything but a simplistic hello world example, and as such it just a disaster as a teaser.

The evening keynote was Lessons and Tips from the Ajax Frontline, or Lessons learned building a 100+ KLOC Javascript application by Scott Dietzen, CTO at Zimbra.

In all fairness, he did show some tips and lessons learned, but the whole session was basically a demo and sales pich for Zimbra. I was also a bit bothered when he described the Zimbra library design as similar to SWT. At my company, Crisp, we had a half day presentation of SWT, and the design made us repeatedly gnash our teeth.

At the end of the day we had an Expert Panel Discussion where not much of interest turned up. Perhaps with the exception of the answer to the question "What is the current definition of Ajax?" The answer was plainly "Ajax is a marketing term". There is so much happening all across the board right now. The best thing to do is to just step back and see what will happen in the near future, and enjoy the ride.


Viewing all articles
Browse latest Browse all 50

Trending Articles