SlideShare ist ein Scribd-Unternehmen logo
1 von 42
JavaScript Wash
Story of a UI Development
M A Hossain Tonu
http://mahtonu.wordpress.com
Tweets @mahtonu
Improsys, Inc
Objective
PhpXperts Seminar 2010
Contents
• JS in Mobile Application Development
• Interactive UI samples
• Open Source JS Libraries
• The High-Performance JS Mantra
• Tools
PhpXperts Seminar 2010
Some Common Issues
• JavaScript != Java
• Client/Server Side JS = YES
• Non-Web-related apps = YES
• OOP Support = YES
• Multi-threading 
PhpXperts Seminar 2010
Only for web browsers? No
Rhino - Open source JS engine for Java.
Aptana Jaxer - Server side JS
Node.js – Client- Server JS
PhpXperts Seminar 2010
Runs within a host environment
Web browser
Adobe Acrobat
Photoshop
Windows Scripting Host
Yahoo! Widget Engine
and more...
PhpXperts Seminar 2010
JS in Mobile Application Development
Titanium RhoMobile
PhoneGap
PhpXperts Seminar 2010
Devices =
Dev. Platform =
Interactive UI using JavaScript
PhpXperts Seminar 2010
Interactive UI using JavaScript
PhpXperts Seminar 2010
Interactive UI using JavaScript
PhpXperts Seminar 2010
Interactive UI using JavaScript
PhpXperts Seminar 2010
Interactive UI using JavaScript
PhpXperts Seminar 2010
PhpXperts Seminar 2010
= Yes
All you need
• JavaScript Libraries
• High Performance JavaScript
Mantra
PhpXperts Seminar 2010
Open Source JS Libraries
• General Purpose:
– Prototype
– jQuery
– Yahoo! UI
– Dojo
– Ext JS
• Task Specific:
– Script.aculo.us (Effects)
– moo.fx (Effects)
– $fx() (Animation)
– Rapheal (Vector Graphics)
– Glimmer (Interaction)PhpXperts Seminar 2010
Why JS Libraries?
• High Performance
• Development -> faster
• cross-browser
PhpXperts Seminar 2010
High-Performance JavaScript Matters
• Fast apps = 
• Slow apps = 
• AJAX = responsiveness!!
• User experience = WOW!
PhpXperts Seminar 2010
The High-Performance JS
Mantra
• Be Lazy
• Be Responsive
• Be Vigilant
PhpXperts Seminar 2010
The High-Performance JS Mantra
• Be Lazy : Nothing is faster than doing nothing
• Be Responsive
• Be Vigilant
PhpXperts Seminar 2010
Be Lazy: Nothing is faster than doing nothing
• Write less code
• Frequent code releases 
Frequently re-download
• More code = more to
download, execute, maintain,
etc
PhpXperts Seminar 2010
Be Lazy: Nothing is faster than doing nothing
• Before:
• After:
PhpXperts Seminar 2010
/**
* The dom module provides helper methods for
* manipulating Dom elements.
* @module dom
*
*/
(function() {
var Y = YAHOO.util, // internal shorthand
getStyle, // for load time browser branching
setStyle, // ditto
propertyCache = {}, // for faster hyphen converts
reClassNameCache = {}, // cache regexes for className
document = window.document; // cache for faster lookups
YAHOO.env._id_counter = YAHOO.env._id_counter || 0;
(function(){var
B=YAHOO.util,K,I,J={},F={},M=window.document;YAHOO.env._id_counter=YAHOO.en
v._id_counter||0;
MINIFY = Good
Be Lazy: Nothing is faster than doing nothing
• Load JS on-demand
• Less HTTP Requests
Before:
After:
PhpXperts Seminar 2010
<script src="all.js“ type="text/javascript“></script>
<script src="jquery.js"></script>
<script src="jquery.twitter.js"></script>
<script src="jquery.cookie.js"></script>
<script src="myapp.js"></script>
Be Lazy: Nothing is faster than doing nothing
• Draw UI as late as possible
Draw less DOM = faster
Pre-draw hidden UI = No
Cache = Yes
Hidden UI updating = No
PhpXperts Seminar 2010
PhpXperts Seminar 2010
Never pre-draw hidden UI
PhpXperts Seminar 2010
Never pre-draw hidden UI
PhpXperts Seminar 2010
Never pre-draw hidden UI
PhpXperts Seminar 2010
Never pre-draw hidden UI
PhpXperts Seminar 2010
Never pre-draw hidden UI
The High-Performance JS Mantra
• Be Lazy
• Be Responsive: Jump when the user says
jump
• Be Vigilant
PhpXperts Seminar 2010
Be Responsive: Jump when the user says jump
• Minimize initial load time
CSS at top
JS at bottom
UI placeholder > “loading”
Load in stages
• Yield early and often
do min. work, use setTimeout() to yield
PhpXperts Seminar 2010
Be Responsive: Jump when the user says jump
PhpXperts Seminar 2010
Load your app in stages
Be Responsive: Jump when the user says jump
PhpXperts Seminar 2010
Load your app in stages
Be Responsive: Jump when the user says jump
PhpXperts Seminar 2010
Load your app in stages
Be Responsive: Jump when the user says jump
PhpXperts Seminar 2010
Load your app in stages
Be Responsive: Jump when the user says jump
PhpXperts Seminar 2010
Load your app in stages
Be Responsive: Jump when the user says jump
PhpXperts Seminar 2010
Load your app in stages
Be Responsive: Jump when the user says jump
PhpXperts Seminar 2010
Load your app in stages
The High-Performance JS Mantra
• Be Lazy
• Be Responsive
• Be Vigilant: Only you can prevent slow web apps
PhpXperts Seminar 2010
Be Vigilant: Only you can prevent slow web apps
• Profile like crazy
Use firebug’s profiler (Joe Hewitt, you rule! )
Use timestamp diffs and alerts
PhpXperts Seminar 2010
Tools
PhpXperts Seminar 2010
Questions
PhpXperts Seminar 2010
References
JavaScript: The World's Most Misunderstood Programming Language
Private Members in JavaScript
Books:
JavaScript: The Good Part by Douglus Crockford
JavaScript: The Definitive Guide (5th Edition) by David Flanagan
jQuery Cheat sheet
Server side JS
PhpXperts Seminar 2010

Weitere ähnliche Inhalte

Was ist angesagt?

JS Meetup Webapp/Software communication
JS Meetup Webapp/Software communicationJS Meetup Webapp/Software communication
JS Meetup Webapp/Software communication
narcvs
 

Was ist angesagt? (12)

Introduction to PowerShell and getting started
Introduction to PowerShell and getting startedIntroduction to PowerShell and getting started
Introduction to PowerShell and getting started
 
Making a living
Making a livingMaking a living
Making a living
 
AD105 - OneUI.. really? Is that because you don't know about Twitter Bootstrap?
AD105 - OneUI.. really? Is that because you don't know about Twitter Bootstrap?AD105 - OneUI.. really? Is that because you don't know about Twitter Bootstrap?
AD105 - OneUI.. really? Is that because you don't know about Twitter Bootstrap?
 
TPR4
TPR4TPR4
TPR4
 
wp cli- don’t fear the command line
wp cli- don’t fear the command linewp cli- don’t fear the command line
wp cli- don’t fear the command line
 
Yeoman
YeomanYeoman
Yeoman
 
JS Meetup Webapp/Software communication
JS Meetup Webapp/Software communicationJS Meetup Webapp/Software communication
JS Meetup Webapp/Software communication
 
WordPress Security
WordPress SecurityWordPress Security
WordPress Security
 
Web technologies practical guide
Web technologies practical guideWeb technologies practical guide
Web technologies practical guide
 
AS
ASAS
AS
 
Learning to code
Learning to codeLearning to code
Learning to code
 
Developing High Performance Web Apps - CodeMash 2011
Developing High Performance Web Apps - CodeMash 2011Developing High Performance Web Apps - CodeMash 2011
Developing High Performance Web Apps - CodeMash 2011
 

Andere mochten auch

Andere mochten auch (12)

Google Maps API
Google Maps APIGoogle Maps API
Google Maps API
 
Google Map API
Google Map APIGoogle Map API
Google Map API
 
Google Maps API
Google Maps APIGoogle Maps API
Google Maps API
 
Software Engineering in PHP
Software Engineering in PHPSoftware Engineering in PHP
Software Engineering in PHP
 
Understanding Microservices
Understanding Microservices Understanding Microservices
Understanding Microservices
 
Developing WordPress Plugins : For Begineers
Developing WordPress Plugins :  For BegineersDeveloping WordPress Plugins :  For Begineers
Developing WordPress Plugins : For Begineers
 
Before you jump into Angular
Before you jump into AngularBefore you jump into Angular
Before you jump into Angular
 
Build social apps for Facebook
Build social apps for FacebookBuild social apps for Facebook
Build social apps for Facebook
 
Introduction to Meteor - Worldwide Meteor Day
Introduction to Meteor - Worldwide Meteor DayIntroduction to Meteor - Worldwide Meteor Day
Introduction to Meteor - Worldwide Meteor Day
 
Secure my ng-app
Secure my ng-appSecure my ng-app
Secure my ng-app
 
Succeeding with FOSS!
Succeeding with FOSS!Succeeding with FOSS!
Succeeding with FOSS!
 
Understanding meteor
Understanding meteorUnderstanding meteor
Understanding meteor
 

Ähnlich wie JavaScript Wash - Story of UI Development

Federico Feroldi: PHP in Yahoo!
Federico Feroldi: PHP in Yahoo!Federico Feroldi: PHP in Yahoo!
Federico Feroldi: PHP in Yahoo!
Francesco Fullone
 
Behavior & Specification Driven Development in PHP - #OpenWest
Behavior & Specification Driven Development in PHP - #OpenWestBehavior & Specification Driven Development in PHP - #OpenWest
Behavior & Specification Driven Development in PHP - #OpenWest
Joshua Warren
 
Phpworks enterprise-php-1227605806710884-9
Phpworks enterprise-php-1227605806710884-9Phpworks enterprise-php-1227605806710884-9
Phpworks enterprise-php-1227605806710884-9
PrinceGuru MS
 

Ähnlich wie JavaScript Wash - Story of UI Development (20)

Federico Feroldi: PHP in Yahoo!
Federico Feroldi: PHP in Yahoo!Federico Feroldi: PHP in Yahoo!
Federico Feroldi: PHP in Yahoo!
 
Federico Feroldi Php In Yahoo
Federico Feroldi Php In YahooFederico Feroldi Php In Yahoo
Federico Feroldi Php In Yahoo
 
Building and deploying PHP applications with Phing
Building and deploying PHP applications with PhingBuilding and deploying PHP applications with Phing
Building and deploying PHP applications with Phing
 
Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.
Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.
Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.
 
Behavior & Specification Driven Development in PHP - #OpenWest
Behavior & Specification Driven Development in PHP - #OpenWestBehavior & Specification Driven Development in PHP - #OpenWest
Behavior & Specification Driven Development in PHP - #OpenWest
 
Introduction to PHP - SDPHP
Introduction to PHP - SDPHPIntroduction to PHP - SDPHP
Introduction to PHP - SDPHP
 
Enterprise PHP (PHP London Conference 2008)
Enterprise PHP (PHP London Conference 2008)Enterprise PHP (PHP London Conference 2008)
Enterprise PHP (PHP London Conference 2008)
 
Chp 08 php (shared)
Chp 08   php  (shared) Chp 08   php  (shared)
Chp 08 php (shared)
 
CONTENT MANAGEMENT SYSTEM
CONTENT MANAGEMENT SYSTEMCONTENT MANAGEMENT SYSTEM
CONTENT MANAGEMENT SYSTEM
 
Php mysql-training online-by_php2ranjan
Php mysql-training online-by_php2ranjanPhp mysql-training online-by_php2ranjan
Php mysql-training online-by_php2ranjan
 
php training in hyderabad
php training in hyderabadphp training in hyderabad
php training in hyderabad
 
JavaScript Toolkit
JavaScript ToolkitJavaScript Toolkit
JavaScript Toolkit
 
Phpworks enterprise-php-1227605806710884-9
Phpworks enterprise-php-1227605806710884-9Phpworks enterprise-php-1227605806710884-9
Phpworks enterprise-php-1227605806710884-9
 
TPR4
TPR4TPR4
TPR4
 
High Performance JavaScript - Fronteers 2010
High Performance JavaScript - Fronteers 2010High Performance JavaScript - Fronteers 2010
High Performance JavaScript - Fronteers 2010
 
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
 
Simplify your professional web development with symfony
Simplify your professional web development with symfonySimplify your professional web development with symfony
Simplify your professional web development with symfony
 
CodeIgniter - PHP MVC Framework by silicongulf.com
CodeIgniter - PHP MVC Framework by silicongulf.comCodeIgniter - PHP MVC Framework by silicongulf.com
CodeIgniter - PHP MVC Framework by silicongulf.com
 
Max Voloshin - "Organization of frontend development for products with micros...
Max Voloshin - "Organization of frontend development for products with micros...Max Voloshin - "Organization of frontend development for products with micros...
Max Voloshin - "Organization of frontend development for products with micros...
 
Apache Flex and the imperfect Web
Apache Flex and the imperfect WebApache Flex and the imperfect Web
Apache Flex and the imperfect Web
 

Kürzlich hochgeladen

Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
panagenda
 
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
FIDO Alliance
 

Kürzlich hochgeladen (20)

Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
 
Generative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdfGenerative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdf
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdf
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptx
 
WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024
 
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
 
Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 Warsaw
 
AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentation
 
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The InsideCollecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
 
Top 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTop 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development Companies
 
State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!
 
Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptx
 
Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM Performance
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
 

JavaScript Wash - Story of UI Development

  • 1. JavaScript Wash Story of a UI Development M A Hossain Tonu http://mahtonu.wordpress.com Tweets @mahtonu Improsys, Inc
  • 3. Contents • JS in Mobile Application Development • Interactive UI samples • Open Source JS Libraries • The High-Performance JS Mantra • Tools PhpXperts Seminar 2010
  • 4. Some Common Issues • JavaScript != Java • Client/Server Side JS = YES • Non-Web-related apps = YES • OOP Support = YES • Multi-threading  PhpXperts Seminar 2010
  • 5. Only for web browsers? No Rhino - Open source JS engine for Java. Aptana Jaxer - Server side JS Node.js – Client- Server JS PhpXperts Seminar 2010
  • 6. Runs within a host environment Web browser Adobe Acrobat Photoshop Windows Scripting Host Yahoo! Widget Engine and more... PhpXperts Seminar 2010
  • 7. JS in Mobile Application Development Titanium RhoMobile PhoneGap PhpXperts Seminar 2010 Devices = Dev. Platform =
  • 8. Interactive UI using JavaScript PhpXperts Seminar 2010
  • 9. Interactive UI using JavaScript PhpXperts Seminar 2010
  • 10. Interactive UI using JavaScript PhpXperts Seminar 2010
  • 11. Interactive UI using JavaScript PhpXperts Seminar 2010
  • 12. Interactive UI using JavaScript PhpXperts Seminar 2010
  • 14. All you need • JavaScript Libraries • High Performance JavaScript Mantra PhpXperts Seminar 2010
  • 15. Open Source JS Libraries • General Purpose: – Prototype – jQuery – Yahoo! UI – Dojo – Ext JS • Task Specific: – Script.aculo.us (Effects) – moo.fx (Effects) – $fx() (Animation) – Rapheal (Vector Graphics) – Glimmer (Interaction)PhpXperts Seminar 2010
  • 16. Why JS Libraries? • High Performance • Development -> faster • cross-browser PhpXperts Seminar 2010
  • 17. High-Performance JavaScript Matters • Fast apps =  • Slow apps =  • AJAX = responsiveness!! • User experience = WOW! PhpXperts Seminar 2010
  • 18. The High-Performance JS Mantra • Be Lazy • Be Responsive • Be Vigilant PhpXperts Seminar 2010
  • 19. The High-Performance JS Mantra • Be Lazy : Nothing is faster than doing nothing • Be Responsive • Be Vigilant PhpXperts Seminar 2010
  • 20. Be Lazy: Nothing is faster than doing nothing • Write less code • Frequent code releases  Frequently re-download • More code = more to download, execute, maintain, etc PhpXperts Seminar 2010
  • 21. Be Lazy: Nothing is faster than doing nothing • Before: • After: PhpXperts Seminar 2010 /** * The dom module provides helper methods for * manipulating Dom elements. * @module dom * */ (function() { var Y = YAHOO.util, // internal shorthand getStyle, // for load time browser branching setStyle, // ditto propertyCache = {}, // for faster hyphen converts reClassNameCache = {}, // cache regexes for className document = window.document; // cache for faster lookups YAHOO.env._id_counter = YAHOO.env._id_counter || 0; (function(){var B=YAHOO.util,K,I,J={},F={},M=window.document;YAHOO.env._id_counter=YAHOO.en v._id_counter||0; MINIFY = Good
  • 22. Be Lazy: Nothing is faster than doing nothing • Load JS on-demand • Less HTTP Requests Before: After: PhpXperts Seminar 2010 <script src="all.js“ type="text/javascript“></script> <script src="jquery.js"></script> <script src="jquery.twitter.js"></script> <script src="jquery.cookie.js"></script> <script src="myapp.js"></script>
  • 23. Be Lazy: Nothing is faster than doing nothing • Draw UI as late as possible Draw less DOM = faster Pre-draw hidden UI = No Cache = Yes Hidden UI updating = No PhpXperts Seminar 2010
  • 24. PhpXperts Seminar 2010 Never pre-draw hidden UI
  • 25. PhpXperts Seminar 2010 Never pre-draw hidden UI
  • 26. PhpXperts Seminar 2010 Never pre-draw hidden UI
  • 27. PhpXperts Seminar 2010 Never pre-draw hidden UI
  • 28. PhpXperts Seminar 2010 Never pre-draw hidden UI
  • 29. The High-Performance JS Mantra • Be Lazy • Be Responsive: Jump when the user says jump • Be Vigilant PhpXperts Seminar 2010
  • 30. Be Responsive: Jump when the user says jump • Minimize initial load time CSS at top JS at bottom UI placeholder > “loading” Load in stages • Yield early and often do min. work, use setTimeout() to yield PhpXperts Seminar 2010
  • 31. Be Responsive: Jump when the user says jump PhpXperts Seminar 2010 Load your app in stages
  • 32. Be Responsive: Jump when the user says jump PhpXperts Seminar 2010 Load your app in stages
  • 33. Be Responsive: Jump when the user says jump PhpXperts Seminar 2010 Load your app in stages
  • 34. Be Responsive: Jump when the user says jump PhpXperts Seminar 2010 Load your app in stages
  • 35. Be Responsive: Jump when the user says jump PhpXperts Seminar 2010 Load your app in stages
  • 36. Be Responsive: Jump when the user says jump PhpXperts Seminar 2010 Load your app in stages
  • 37. Be Responsive: Jump when the user says jump PhpXperts Seminar 2010 Load your app in stages
  • 38. The High-Performance JS Mantra • Be Lazy • Be Responsive • Be Vigilant: Only you can prevent slow web apps PhpXperts Seminar 2010
  • 39. Be Vigilant: Only you can prevent slow web apps • Profile like crazy Use firebug’s profiler (Joe Hewitt, you rule! ) Use timestamp diffs and alerts PhpXperts Seminar 2010
  • 42. References JavaScript: The World's Most Misunderstood Programming Language Private Members in JavaScript Books: JavaScript: The Good Part by Douglus Crockford JavaScript: The Definitive Guide (5th Edition) by David Flanagan jQuery Cheat sheet Server side JS PhpXperts Seminar 2010

Hinweis der Redaktion

  1. When it comes to Object Oriented issue: it does have constructors which do what classes do, including acting as containers for class variables and methods. It does not have class-oriented inheritance, but it does have prototype-oriented inheritance. The two main ways of building up object systems are by inheritance (is-a) and by aggregation (has-a). JavaScript does both Capable of information hiding JavaScript objects can have private variables and private methods JavaScript supports not only classical inheritance, but other code reuse patterns as well.
  2. While JavaScript is most widely used for client side scripting in a browser, it is a fully fledged language and can be used anywhere.
  3. Cross platform mobile apps development for JavaScript developers
  4. A JavaScript library is like a toolbox You can build any number of things using the tools
  5. Write less code Each line costs parsing time Can’t rely on browser caching to excuse large code size Yahoo study: surprising number of hits with empty cache Frequent code releases  frequently need to re-download
  6. You just saved 3 HTTP requests 
  7. Draw UI as late as possible Draw less DOM = faster to draw, browser less saturated Never pre-draw hidden UI if you can avoid it Cache previously drawn HTML when appropriate But have to know when to invalidate the cache Don’t keep hidden UI up-to-date behind the scenes Just re-draw next time you show it (simpler, one-time cost)
  8. Put CSS at the top of your page and JS at the bottom Draw major placeholder UI with “loading…” first Load / draw your app in stages (lazy, on-demand)