SlideShare a Scribd company logo
1 of 80
Download to read offline
Debugging your
                                JavaScript
                         (Recuso-me a mudar este titulo para português)


                                         Sapo Sessions
                                          2010-10-06




Wednesday, October 6, 2010
JavaScript



Wednesday, October 6, 2010
Wednesday, October 6, 2010
JavaScript


                    • O porquê desta talk



Wednesday, October 6, 2010
JavaScript




Wednesday, October 6, 2010
JavaScript
                    • minimizar a frustação




Wednesday, October 6, 2010
JavaScript
                    • minimizar a frustação
                    • perceber o problema




Wednesday, October 6, 2010
JavaScript
                    • minimizar a frustação
                    • perceber o problema
                    • aumentar a autonomia na clarificação de
                             erros




Wednesday, October 6, 2010
JavaScript
                    • minimizar a frustação
                    • perceber o problema
                    • aumentar a autonomia na clarificação de
                             erros
                    • ... dado nem sempre termos as ferramentas
                             para dar a ajuda certa



Wednesday, October 6, 2010
No SAPO




Wednesday, October 6, 2010
No SAPO
                    • existe um documento de Guidelines de
                             Usabilidade e Qualidade




Wednesday, October 6, 2010
No SAPO
                    • existe um documento de Guidelines de
                             Usabilidade e Qualidade
                    • define, entre muitas outras, as
                             compatibilidades com os browsers que os
                             sites do SAPO devem ter




Wednesday, October 6, 2010
No SAPO




Wednesday, October 6, 2010
Onde testar?




Wednesday, October 6, 2010
Onde testar?
                    • no próprio browser




Wednesday, October 6, 2010
Onde testar?
                    • no próprio browser
                    • no correspondente sistema operativo




Wednesday, October 6, 2010
Onde testar?
                    • no próprio browser
                    • no correspondente sistema operativo
                    • num ambiente o mais aproximado possível
                             do utilizador final




Wednesday, October 6, 2010
Usar VM’s




Wednesday, October 6, 2010
Usar VM’s
                    • VirtualBox,VMWare, Windows Virtual PC,
                             Parallels, you name it.




Wednesday, October 6, 2010
Usar VM’s
                    • VirtualBox,VMWare, Windows Virtual PC,
                             Parallels, you name it.
                    • uma VM por “browser age”




Wednesday, October 6, 2010
Usar VM’s
                    • VirtualBox,VMWare, Windows Virtual PC,
                             Parallels, you name it.
                    • uma VM por “browser age”
                    • ex:VM IE6 + FF3 + Safari 4 + etc



Wednesday, October 6, 2010
Usar VM’s
                    • VirtualBox,VMWare, Windows Virtual PC,
                             Parallels, you name it.
                    • uma VM por “browser age”
                    • ex:VM IE6 + FF3 + Safari 4 + etc
                    • ex2:VM IE7 + FF3.5 + Safari 5 + etc


Wednesday, October 6, 2010
JavaScript Code




Wednesday, October 6, 2010
JavaScript Code
                    • não usar código minificado para
                             desenvolvimento




Wednesday, October 6, 2010
JavaScript Code
                    • não usar código minificado para
                             desenvolvimento
                    • uma instrução por linha




Wednesday, October 6, 2010
JavaScript Code
                    • não usar código minificado para
                             desenvolvimento
                    • uma instrução por linha
                    • seguir um coding standard



Wednesday, October 6, 2010
JavaScript Code
                    • não usar inline attributes, ex: onclick




Wednesday, October 6, 2010
JavaScript Code
                    • não usar inline attributes, ex: onclick
                    • se possível, manter o window limpo




Wednesday, October 6, 2010
JavaScript Code
                    • não usar inline attributes, ex: onclick
                    • se possível, manter o window limpo
                    • debug flags no código




Wednesday, October 6, 2010
JavaScript Code
                    • usar minifiers/compressors




Wednesday, October 6, 2010
JavaScript Code
                    • usar minifiers/compressors
                    • nomes de variáveis que façam sentido




Wednesday, October 6, 2010
JavaScript Code
                    • usar minifiers/compressors
                    • nomes de variáveis que façam sentido
                    • não compliquem




Wednesday, October 6, 2010
JavaScript Code
                    • Usar minifiers/compressors
                    • nomes de variáveis que façam sentido
                    • não compliquem
                    • não abusem do DOM que ele não gosta



Wednesday, October 6, 2010
Minifiers




Wednesday, October 6, 2010
Minifiers
                    • YUIC - http://refresh-sf.com/yui/




Wednesday, October 6, 2010
Minifiers
                    • YUIC
                    • Google Compiler - http://5ujb.sl.pt




Wednesday, October 6, 2010
Minifiers
                    • YUIC
                    • Google Compiler
                    • JSMin - http://5ujf.sl.pt




Wednesday, October 6, 2010
Minifiers
                    • YUIC
                    • Google Compiler
                    • JSMin
                    • Packer - http://jscompress.com/



Wednesday, October 6, 2010
Minifiers
                    • YUIC
                    • Google Compiler
                    • JSMin
                    • Packer
                    • e muito mais...


Wednesday, October 6, 2010
JSLint


                             http://www.jslint.com/




Wednesday, October 6, 2010
JSLint
                    • aviso: “JSLint will hurt your feelings”




Wednesday, October 6, 2010
JSLint
                    • aviso: “JSLint will hurt your feelings”
                    • é um bom desafio criar código que seja
                             warning free no JSLint




Wednesday, October 6, 2010
JSLint
                    • aviso: “JSLint will hurt your feelings”
                    • é um bom desafio criar código que seja
                             warning free no JSLint
                    • a boa notícia é que há warnings que podem
                             “ignorar”




Wednesday, October 6, 2010
Hardcore Debugging




Wednesday, October 6, 2010
Hardcore Debugging
                    • window.alert to the rescue!




Wednesday, October 6, 2010
Hardcore Debugging
                    • window.alert to the rescue!
                    • comentar blocos de código para descobrir
                             erros de sintaxe




Wednesday, October 6, 2010
Demo Time!



Wednesday, October 6, 2010
Firefox
                    • Firebug




Wednesday, October 6, 2010
Firefox
                    • Firebug
                     • JavaScript console




Wednesday, October 6, 2010
Firefox
                    • Firebug
                     • JavaScript Console
                     • HTML / CSS Inspector




Wednesday, October 6, 2010
Firefox
                    • Firebug
                     • JavaScript Console
                     • HTML / CSS Inspector
                     • recursos carregados pela página



Wednesday, October 6, 2010
Firefox
                    • Firebug
                     • JavaScript Console
                     • HTML / CSS Inspector
                     • recursos carregados pela página
                     • DOM & Script Tab


Wednesday, October 6, 2010
Demo Time!



Wednesday, October 6, 2010
Chrome / Safari
                    • Webkit Inspector




Wednesday, October 6, 2010
Chrome / Safari
                    • Webkit Inspector
                     • Elements Tab




Wednesday, October 6, 2010
Chrome / Safari
                    • Webkit Inspector
                     • Elements Tab
                     • Resources




Wednesday, October 6, 2010
Chrome / Safari
                    • Webkit Inspector
                     • Elements Tab
                     • Resources
                     • Console



Wednesday, October 6, 2010
Chrome / Safari
                    • Webkit Inspector
                     • Elements Tab
                     • Resources
                     • Console
                     • e mais!


Wednesday, October 6, 2010
Demo Time!



Wednesday, October 6, 2010
IE 6 / 7
                    • Developer Toolbar




Wednesday, October 6, 2010
IE 6 / 7
                    • Developer Toolbar
                     • HTML Inspector




Wednesday, October 6, 2010
IE 6 / 7
                    • Developer Toolbar
                     • HTML Inspector
                     • CSS Inspector




Wednesday, October 6, 2010
IE 6 / 7
                    • Developer Toolbar
                     • HTML Inspector
                     • CSS Inspector
                     • e uns extras que dão jeito... no
                             contexto :)




Wednesday, October 6, 2010
Demo Time!



Wednesday, October 6, 2010
IE 8 / 9*
                    • Developer Tools




Wednesday, October 6, 2010
IE 8 / 9*
                    • Developer Tools
                     • HTML Inspector




Wednesday, October 6, 2010
IE 8 / 9*
                    • Developer Tools
                     • HTML Inspector
                     • CSS Inspector




Wednesday, October 6, 2010
IE 8 / 9*
                    • Developer Tools
                     • HTML Inspector
                     • CSS Inspector
                     • Script Inspector



Wednesday, October 6, 2010
IE 8 / 9*
                    • Developer Tools
                     • HTML Inspector
                     • CSS Inspector
                     • Script Inspector
                     • Profiler


Wednesday, October 6, 2010
Demo Time!



Wednesday, October 6, 2010
Opera
                    • Opera Dragonfly




Wednesday, October 6, 2010
Opera
                    • Opera Dragonfly
                     • DOM




Wednesday, October 6, 2010
Opera
                    • Opera Dragonfly
                     • DOM
                     • Scripts




Wednesday, October 6, 2010
Opera
                    • Opera Dragonfly
                     • DOM
                     • Scripts
                     • Network



Wednesday, October 6, 2010
Opera
                    • Opera Dragonfly
                     • DOM
                     • Scripts
                     • Network
                     • e mais extras...


Wednesday, October 6, 2010
Demo Time!



Wednesday, October 6, 2010
Wrap Up

                             Perguntas?


Wednesday, October 6, 2010
Diogo Antunes
                               LibSAPO.js - http://js.sapo.pt
                                      twitter: @dicode
                                im: diogoantunes@sapo.pt
                             mail: diogo.j.antunes@co.sapo.pt
                              zombie blog: http://dicode.org




Wednesday, October 6, 2010
Wednesday, October 6, 2010
Credits                                                                                                   This work is licensed under a Creative
                                                                                                               Commons Attribution-NonCommercial-
                                                                                                                  ShareAlike 3.0 Unported License.




                        slide 3: @pedro_correia
                        slide 5: http://commons.wikimedia.org/wiki/File:Bug.png
                        slide 10: @sapo
                        slide 14: http://willscullypower.files.wordpress.com/2009/11/testing.jpg
                        slide 18: http://dl.maximumpc.com/galleries/osretro/OSes.png
                        slide 23: http://hazel8500.files.wordpress.com/2010/02/ninja.jpg
                        slide 44: http://llvm.org/releases/2.4/docs/img/Debugging.gif
                        slide 79: http://icanhascheezburger.wordpress.com/files/2009/08/funny-pictures-cat-loves-coffee.jpg




Wednesday, October 6, 2010

More Related Content

Viewers also liked

Cq5 for enterprises: content delivery strategies
Cq5 for enterprises: content delivery strategiesCq5 for enterprises: content delivery strategies
Cq5 for enterprises: content delivery strategiesStefanFranck
 
Making burgers with JavaScript
Making burgers with JavaScriptMaking burgers with JavaScript
Making burgers with JavaScriptDiogo Antunes
 
It works on your computer... but does it render fast enough?
It works on your computer... but does it render fast enough?It works on your computer... but does it render fast enough?
It works on your computer... but does it render fast enough?Diogo Antunes
 

Viewers also liked (6)

Know your errors
Know your errorsKnow your errors
Know your errors
 
Cq5 for enterprises: content delivery strategies
Cq5 for enterprises: content delivery strategiesCq5 for enterprises: content delivery strategies
Cq5 for enterprises: content delivery strategies
 
Pocket Knife JS
Pocket Knife JSPocket Knife JS
Pocket Knife JS
 
Nodejs
NodejsNodejs
Nodejs
 
Making burgers with JavaScript
Making burgers with JavaScriptMaking burgers with JavaScript
Making burgers with JavaScript
 
It works on your computer... but does it render fast enough?
It works on your computer... but does it render fast enough?It works on your computer... but does it render fast enough?
It works on your computer... but does it render fast enough?
 

Similar to Debugging your JavaScript

BDD and Cucumber at barcampGZ
BDD and Cucumber at barcampGZBDD and Cucumber at barcampGZ
BDD and Cucumber at barcampGZleondu
 
Html5 apps nikolaionken-08-06
Html5 apps nikolaionken-08-06Html5 apps nikolaionken-08-06
Html5 apps nikolaionken-08-06Skills Matter
 
Building Brilliant APIs
Building Brilliant APIsBuilding Brilliant APIs
Building Brilliant APIsbencollier
 
In depth with html5 java2days 2010
In depth with html5 java2days 2010In depth with html5 java2days 2010
In depth with html5 java2days 2010Mystic Coders, LLC
 
Introduction To Google App Engine
Introduction To Google App EngineIntroduction To Google App Engine
Introduction To Google App EngineKosei Moriyama
 
Phone gap nikolaionken-08-06
Phone gap nikolaionken-08-06Phone gap nikolaionken-08-06
Phone gap nikolaionken-08-06Skills Matter
 
HTML5 impact on application programming
HTML5 impact on application programmingHTML5 impact on application programming
HTML5 impact on application programmingEricsson Labs
 
T-DOSE 2010 - Agile Enterprise, CLouds and Devops
T-DOSE 2010 - Agile Enterprise, CLouds and DevopsT-DOSE 2010 - Agile Enterprise, CLouds and Devops
T-DOSE 2010 - Agile Enterprise, CLouds and DevopsChef Software, Inc.
 
BRAINREPUBLIC - Powered by no-SQL
BRAINREPUBLIC - Powered by no-SQLBRAINREPUBLIC - Powered by no-SQL
BRAINREPUBLIC - Powered by no-SQLAndreas Jung
 
Gerenciamento Servidores com o Spacewalk
Gerenciamento Servidores com o SpacewalkGerenciamento Servidores com o Spacewalk
Gerenciamento Servidores com o Spacewalkhdoria
 
Building Distributed JavaScript Widgets with jQuery
Building Distributed JavaScript Widgets with jQueryBuilding Distributed JavaScript Widgets with jQuery
Building Distributed JavaScript Widgets with jQuerybenvinegar
 
Presentation to wdim_students
Presentation to wdim_studentsPresentation to wdim_students
Presentation to wdim_studentsScott Motte
 
Caelum dicas web 2010
Caelum dicas web 2010Caelum dicas web 2010
Caelum dicas web 2010Fabio Akita
 

Similar to Debugging your JavaScript (20)

Html5 Apps
Html5 AppsHtml5 Apps
Html5 Apps
 
BDD and Cucumber at barcampGZ
BDD and Cucumber at barcampGZBDD and Cucumber at barcampGZ
BDD and Cucumber at barcampGZ
 
Html5 apps nikolaionken-08-06
Html5 apps nikolaionken-08-06Html5 apps nikolaionken-08-06
Html5 apps nikolaionken-08-06
 
Building Brilliant APIs
Building Brilliant APIsBuilding Brilliant APIs
Building Brilliant APIs
 
In depth with html5 java2days 2010
In depth with html5 java2days 2010In depth with html5 java2days 2010
In depth with html5 java2days 2010
 
Introduction To Google App Engine
Introduction To Google App EngineIntroduction To Google App Engine
Introduction To Google App Engine
 
Is these a bug
Is these a bugIs these a bug
Is these a bug
 
Phone gap nikolaionken-08-06
Phone gap nikolaionken-08-06Phone gap nikolaionken-08-06
Phone gap nikolaionken-08-06
 
HTML5 impact on application programming
HTML5 impact on application programmingHTML5 impact on application programming
HTML5 impact on application programming
 
Eclipse community management - fossa2010
Eclipse community management - fossa2010Eclipse community management - fossa2010
Eclipse community management - fossa2010
 
Enterprise Drupal
Enterprise DrupalEnterprise Drupal
Enterprise Drupal
 
Java to scala
Java to scalaJava to scala
Java to scala
 
Interns bootcamp 2010
Interns bootcamp 2010Interns bootcamp 2010
Interns bootcamp 2010
 
T-DOSE 2010 - Agile Enterprise, CLouds and Devops
T-DOSE 2010 - Agile Enterprise, CLouds and DevopsT-DOSE 2010 - Agile Enterprise, CLouds and Devops
T-DOSE 2010 - Agile Enterprise, CLouds and Devops
 
Vagrant at LA Ruby
Vagrant at LA RubyVagrant at LA Ruby
Vagrant at LA Ruby
 
BRAINREPUBLIC - Powered by no-SQL
BRAINREPUBLIC - Powered by no-SQLBRAINREPUBLIC - Powered by no-SQL
BRAINREPUBLIC - Powered by no-SQL
 
Gerenciamento Servidores com o Spacewalk
Gerenciamento Servidores com o SpacewalkGerenciamento Servidores com o Spacewalk
Gerenciamento Servidores com o Spacewalk
 
Building Distributed JavaScript Widgets with jQuery
Building Distributed JavaScript Widgets with jQueryBuilding Distributed JavaScript Widgets with jQuery
Building Distributed JavaScript Widgets with jQuery
 
Presentation to wdim_students
Presentation to wdim_studentsPresentation to wdim_students
Presentation to wdim_students
 
Caelum dicas web 2010
Caelum dicas web 2010Caelum dicas web 2010
Caelum dicas web 2010
 

Recently uploaded

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 

Recently uploaded (20)

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 

Debugging your JavaScript

  • 1. Debugging your JavaScript (Recuso-me a mudar este titulo para português) Sapo Sessions 2010-10-06 Wednesday, October 6, 2010
  • 4. JavaScript • O porquê desta talk Wednesday, October 6, 2010
  • 6. JavaScript • minimizar a frustação Wednesday, October 6, 2010
  • 7. JavaScript • minimizar a frustação • perceber o problema Wednesday, October 6, 2010
  • 8. JavaScript • minimizar a frustação • perceber o problema • aumentar a autonomia na clarificação de erros Wednesday, October 6, 2010
  • 9. JavaScript • minimizar a frustação • perceber o problema • aumentar a autonomia na clarificação de erros • ... dado nem sempre termos as ferramentas para dar a ajuda certa Wednesday, October 6, 2010
  • 11. No SAPO • existe um documento de Guidelines de Usabilidade e Qualidade Wednesday, October 6, 2010
  • 12. No SAPO • existe um documento de Guidelines de Usabilidade e Qualidade • define, entre muitas outras, as compatibilidades com os browsers que os sites do SAPO devem ter Wednesday, October 6, 2010
  • 15. Onde testar? • no próprio browser Wednesday, October 6, 2010
  • 16. Onde testar? • no próprio browser • no correspondente sistema operativo Wednesday, October 6, 2010
  • 17. Onde testar? • no próprio browser • no correspondente sistema operativo • num ambiente o mais aproximado possível do utilizador final Wednesday, October 6, 2010
  • 19. Usar VM’s • VirtualBox,VMWare, Windows Virtual PC, Parallels, you name it. Wednesday, October 6, 2010
  • 20. Usar VM’s • VirtualBox,VMWare, Windows Virtual PC, Parallels, you name it. • uma VM por “browser age” Wednesday, October 6, 2010
  • 21. Usar VM’s • VirtualBox,VMWare, Windows Virtual PC, Parallels, you name it. • uma VM por “browser age” • ex:VM IE6 + FF3 + Safari 4 + etc Wednesday, October 6, 2010
  • 22. Usar VM’s • VirtualBox,VMWare, Windows Virtual PC, Parallels, you name it. • uma VM por “browser age” • ex:VM IE6 + FF3 + Safari 4 + etc • ex2:VM IE7 + FF3.5 + Safari 5 + etc Wednesday, October 6, 2010
  • 24. JavaScript Code • não usar código minificado para desenvolvimento Wednesday, October 6, 2010
  • 25. JavaScript Code • não usar código minificado para desenvolvimento • uma instrução por linha Wednesday, October 6, 2010
  • 26. JavaScript Code • não usar código minificado para desenvolvimento • uma instrução por linha • seguir um coding standard Wednesday, October 6, 2010
  • 27. JavaScript Code • não usar inline attributes, ex: onclick Wednesday, October 6, 2010
  • 28. JavaScript Code • não usar inline attributes, ex: onclick • se possível, manter o window limpo Wednesday, October 6, 2010
  • 29. JavaScript Code • não usar inline attributes, ex: onclick • se possível, manter o window limpo • debug flags no código Wednesday, October 6, 2010
  • 30. JavaScript Code • usar minifiers/compressors Wednesday, October 6, 2010
  • 31. JavaScript Code • usar minifiers/compressors • nomes de variáveis que façam sentido Wednesday, October 6, 2010
  • 32. JavaScript Code • usar minifiers/compressors • nomes de variáveis que façam sentido • não compliquem Wednesday, October 6, 2010
  • 33. JavaScript Code • Usar minifiers/compressors • nomes de variáveis que façam sentido • não compliquem • não abusem do DOM que ele não gosta Wednesday, October 6, 2010
  • 35. Minifiers • YUIC - http://refresh-sf.com/yui/ Wednesday, October 6, 2010
  • 36. Minifiers • YUIC • Google Compiler - http://5ujb.sl.pt Wednesday, October 6, 2010
  • 37. Minifiers • YUIC • Google Compiler • JSMin - http://5ujf.sl.pt Wednesday, October 6, 2010
  • 38. Minifiers • YUIC • Google Compiler • JSMin • Packer - http://jscompress.com/ Wednesday, October 6, 2010
  • 39. Minifiers • YUIC • Google Compiler • JSMin • Packer • e muito mais... Wednesday, October 6, 2010
  • 40. JSLint http://www.jslint.com/ Wednesday, October 6, 2010
  • 41. JSLint • aviso: “JSLint will hurt your feelings” Wednesday, October 6, 2010
  • 42. JSLint • aviso: “JSLint will hurt your feelings” • é um bom desafio criar código que seja warning free no JSLint Wednesday, October 6, 2010
  • 43. JSLint • aviso: “JSLint will hurt your feelings” • é um bom desafio criar código que seja warning free no JSLint • a boa notícia é que há warnings que podem “ignorar” Wednesday, October 6, 2010
  • 45. Hardcore Debugging • window.alert to the rescue! Wednesday, October 6, 2010
  • 46. Hardcore Debugging • window.alert to the rescue! • comentar blocos de código para descobrir erros de sintaxe Wednesday, October 6, 2010
  • 48. Firefox • Firebug Wednesday, October 6, 2010
  • 49. Firefox • Firebug • JavaScript console Wednesday, October 6, 2010
  • 50. Firefox • Firebug • JavaScript Console • HTML / CSS Inspector Wednesday, October 6, 2010
  • 51. Firefox • Firebug • JavaScript Console • HTML / CSS Inspector • recursos carregados pela página Wednesday, October 6, 2010
  • 52. Firefox • Firebug • JavaScript Console • HTML / CSS Inspector • recursos carregados pela página • DOM & Script Tab Wednesday, October 6, 2010
  • 54. Chrome / Safari • Webkit Inspector Wednesday, October 6, 2010
  • 55. Chrome / Safari • Webkit Inspector • Elements Tab Wednesday, October 6, 2010
  • 56. Chrome / Safari • Webkit Inspector • Elements Tab • Resources Wednesday, October 6, 2010
  • 57. Chrome / Safari • Webkit Inspector • Elements Tab • Resources • Console Wednesday, October 6, 2010
  • 58. Chrome / Safari • Webkit Inspector • Elements Tab • Resources • Console • e mais! Wednesday, October 6, 2010
  • 60. IE 6 / 7 • Developer Toolbar Wednesday, October 6, 2010
  • 61. IE 6 / 7 • Developer Toolbar • HTML Inspector Wednesday, October 6, 2010
  • 62. IE 6 / 7 • Developer Toolbar • HTML Inspector • CSS Inspector Wednesday, October 6, 2010
  • 63. IE 6 / 7 • Developer Toolbar • HTML Inspector • CSS Inspector • e uns extras que dão jeito... no contexto :) Wednesday, October 6, 2010
  • 65. IE 8 / 9* • Developer Tools Wednesday, October 6, 2010
  • 66. IE 8 / 9* • Developer Tools • HTML Inspector Wednesday, October 6, 2010
  • 67. IE 8 / 9* • Developer Tools • HTML Inspector • CSS Inspector Wednesday, October 6, 2010
  • 68. IE 8 / 9* • Developer Tools • HTML Inspector • CSS Inspector • Script Inspector Wednesday, October 6, 2010
  • 69. IE 8 / 9* • Developer Tools • HTML Inspector • CSS Inspector • Script Inspector • Profiler Wednesday, October 6, 2010
  • 71. Opera • Opera Dragonfly Wednesday, October 6, 2010
  • 72. Opera • Opera Dragonfly • DOM Wednesday, October 6, 2010
  • 73. Opera • Opera Dragonfly • DOM • Scripts Wednesday, October 6, 2010
  • 74. Opera • Opera Dragonfly • DOM • Scripts • Network Wednesday, October 6, 2010
  • 75. Opera • Opera Dragonfly • DOM • Scripts • Network • e mais extras... Wednesday, October 6, 2010
  • 77. Wrap Up Perguntas? Wednesday, October 6, 2010
  • 78. Diogo Antunes LibSAPO.js - http://js.sapo.pt twitter: @dicode im: diogoantunes@sapo.pt mail: diogo.j.antunes@co.sapo.pt zombie blog: http://dicode.org Wednesday, October 6, 2010
  • 80. Credits This work is licensed under a Creative Commons Attribution-NonCommercial- ShareAlike 3.0 Unported License. slide 3: @pedro_correia slide 5: http://commons.wikimedia.org/wiki/File:Bug.png slide 10: @sapo slide 14: http://willscullypower.files.wordpress.com/2009/11/testing.jpg slide 18: http://dl.maximumpc.com/galleries/osretro/OSes.png slide 23: http://hazel8500.files.wordpress.com/2010/02/ninja.jpg slide 44: http://llvm.org/releases/2.4/docs/img/Debugging.gif slide 79: http://icanhascheezburger.wordpress.com/files/2009/08/funny-pictures-cat-loves-coffee.jpg Wednesday, October 6, 2010