Rules of Modern Web development
1. You should be able to understand what your application does just by reading the code.
- Do not overuse JavaScript callbacks
- Don't call other callback functions from within a callback (Spaghetti)
- Begin with UX in mind, proceed with CSS3 and JavaScript
- De-couple formatting and display from content using CSS3
- Server-side per component content generation doesn't scale, and is limited by the server boundary
- Consider Closure Templates[4] or Mustache[5] for templates - they work on both JavaScript and server-side
- No complex class hierarchies. JavaScript was not meant for this
- Write functional code
- Consider adopting Google Closure[6] -- Google Clojure Library is to JavaScript what the JDK is to Java
- Use local storage
- Use caching
- Optimistic Locking
- While versioning data just store the actions as delta, not the snapshots. Gain? Real-time Analytics!
- Event-loop on the client side and a fast, async server-side REST API
- Use a persistence model that matches the app data model
- E-R is not it
- Wrappers that do this transparently
- Should gather enough context though
You can catch more of related stuff at their blog[7].
Links:
1. http://the-deadline.appspot.com/
2. http://www.slideshare.net/smartrevolution/using-clojure-nosql-databases-and-functionalstyle-javascript-to-write-gextgeneration-html5-apps
3. http://www.slideshare.net/smartrevolution/writing-html5-apps-with-google-app-engine-google-closure-library-and-clojure
4. http://code.google.com/closure/templates/
5. http://mustache.github.com/
6. http://code.google.com/closure/
7. http://www.hackers-with-attitude.com/
If you have feedback on this post, or any opinion on these topics, please let me know.