SlideShare ist ein Scribd-Unternehmen logo
1 von 17
Everything you need to know
    about programming
    Without any programming




      Danny Mulligan
 danny@dannymulligan.com
Overview
•   Editors/IDEs       •   Libraries
•   Revision Control   •   Documentation
•   Testing            •   Getting help
•   Debugging          •   Practicing
•   Common errors      •   Q&A
•   Performance
Editors/IDEs
•   Use what you already know
•   Use something simple
•   Use something that everybody else is using
•   Learn to walk before you learn to run
•   The right choice for an expert is probably not
    the right choice for you (at least right now)

• Learn to type
• Learn keyboard short cuts
Editors/IDEs
• Common editor choices
   –   Textedit (standard on Macs)
   –   Notepad (standard on Window)
   –   EMACS http://emacsformacosx.com/
   –   vim https://code.google.com/p/macvim/
   –   Notepad++ http://notepad-plus-plus.org/
   –   BBEdit http://www.barebones.com/products/bbedit/index.html
   –   TextMate http://macromates.com/

• IDEs and other stuff you might try
   –   Eclipse http://www.eclipse.org/
   –   Pycharm https://www.jetbrains.com/pycharm/
   –   Spyder IDE https://code.google.com/p/spyderlib/
   –   iPython http://ipython.org/ (iPython notebooks are great!)
   –   iTerm 2 http://www.iterm2.com/ (Replacement for Mac’s terminal)
   –   10 Fast Fingers http://10fastfingers.com/
Revision Control
• Absolutely essential for teams
• A good idea for you
• Unfortunately, not the simplest stuff to master

• Popular tools: GIT, Hg, SVN, CVS,
      Perforce, Visual SourceSafe

• GitHib https://github.com/
    – Allows you to share code easily
    – Windows app http://windows.github.com/
    – Mac app http://mac.github.com/

• Related #1: when was your last backup?
• Related #2: bug tracking is important too (especially for teams)
Testing
• How do you know if you code has any bugs?
    – Easy = it has bugs, you haven’t found them yet

• Writing tests is every bit as important as writing code
    – Pro move = write the tests FIRST!
• Keep the test code after you’ve written it
• Unit tests & regression tests
• Write defensive code (use assert statements)
• Testing your code is a HARD problem, don’t
  underestimate it
• Dividing coding and testing between multiple people
  can help
Example of unit tests
Debugging
•   Print statements – show you what’s going on
•   Assert statements – verify your assumptions
•   Fancy debuggers – less useful than you’d think
•   Write documentation on your code
•   Code reviews - explain the code to someone else
•   Avoid putting the bugs in in the first place
    – Shorter code has fewer bugs
    – Simpler code has fewer bugs
    – Code that’s not there has 0 bugs = use the libraries
Common Errors
•   Off by 1 errors (AKA fencepost errors)
•   = vs. ==
•   Logical (and, or) vs. bitwise (&, |) operators, (use logical almost always)
•   integers vs. floats
     a = 5/(1/3)   # a should be equal to 15, or is it?
• Integer or float?
     a = 1/3; b = 3/9; c = a/b; print c     # c is equal to 1, right?
• Floats are imprecise
     a = 2.15*3; b = 6.45; print (a == b)     # True or False?
• Division by zero
• Logic errors – easy to make mistakes with nested if statements
• Are you working with a copy, or the original object?
     colors = [‘red’, ‘green’, ‘blue’]
     b = colors; b[0] = ‘black’
     print colors # Did colors change?
• Inadequate or no error handling
• Complexity is the enemy of correctness
Performance
• Your performance matters a LOT more than
  the computer’s performance
• So don’t worry about performance
Performance optimization
• Simple is usually faster
• Use library functions whenever you can
• Use the pareto principle, AKA the 80/20 rule
  – Profile first, optimize later
  – “premature optimization is the root of all evil”
• If you MUST optimize for performance
  – Do easy optimizations first
  – Your brain is the best optimization tool
  – Make sure you don’t break your program in the
    process
Libraries
• Learn what is in the standard library
• Get the documentation
• Some important libraries:
   –   Python Standard Library: by far the most important
   –   Python Image Library: image manipulation
   –   Matplotlib: charts & graphs
   –   Numpy: high performance data processing
   –   Django: web framework
   –   Scikit-learn: machine learning
   –   Pandas: data analysis
   –   NLTK: natural language
Python Standard Library
•   string – Common string operations
•   re – Regular expression operators
•   math – Mathematical functions
•   csv – CSV File Reading and Writing
•   datetime – Basic data and time types
•   random – Generate pseudo-random numbers
•   itertools – Functions creating iterators for efficient looping
•   collections – High-performance container datatypes
•   os – Miscellaneous operating system interfaces
•   threading – Higher-level threading interface
•   pdb – The Python Debugger
•   profile & cProfile – Profiling tools
•   test – Regression tests package for Python
Documentation
• Python docs online at
  http://docs.python.org/2/library/
• I keep PDFs of the Python docs on my laptop
  http://docs.python.org/2/download.html
• The standard docs include a nice Tutorial
• “The Python Library Reference” is by far the
  most useful doc
  – 1,457 pages, but do not read (except the ToC)
  – Look up what you need when you need it
Getting help
• Read the docs, read other people’s code
• Google your question, look for similar code
• When you google, you will often end up on StackOverflow
   – Best site for programming questions http://stackoverflow.com
• Watch tutorials on YouTube - examples
   – 3 hour iPython tutorial
     https://www.youtube.com/watch?v=2G5YTlheCbw
   – 83 video playlist from PyCon 2012
     https://www.youtube.com/playlist?list=PL2814D3290BAA8837
   – 30 minute overview of Pandas
     https://www.youtube.com/watch?v=qbYYamU42Sw
   – 3 hour tutorial on Pandas
     https://www.youtube.com/watch?v=w26x-z-BdWQ
Practicing
• How do you get better at golf?
  – Read a book or play golf?
• How do you get better at programming?
  – Use it in your job
  – Solve some real world problems
  – Read other people’s code
• Some real world programming exercises
  – Coding Bat http://codingbat.com/python
  – Project Euler https://projecteuler.net/
Q&A

Weitere ähnliche Inhalte

Was ist angesagt?

How to improve your skills as a programmer
How to improve your skills as a programmerHow to improve your skills as a programmer
How to improve your skills as a programmerYun Yuan
 
Python - The Good, The Bad and The ugly
Python - The Good, The Bad and The ugly Python - The Good, The Bad and The ugly
Python - The Good, The Bad and The ugly Eran Shlomo
 
Reactive GUI Implemented in Clojure
Reactive GUI Implemented in ClojureReactive GUI Implemented in Clojure
Reactive GUI Implemented in Clojuredenyslebediev
 
The Good, the Bad and the Ugly things to do with android
The Good, the Bad and the Ugly things to do with androidThe Good, the Bad and the Ugly things to do with android
The Good, the Bad and the Ugly things to do with androidStanojko Markovik
 
Joe Damato
Joe DamatoJoe Damato
Joe DamatoOntico
 
Azphp phpunit-jenkins
Azphp phpunit-jenkinsAzphp phpunit-jenkins
Azphp phpunit-jenkinsEric Cope
 
Micro Talk - Test Your S#!? !
Micro Talk - Test Your S#!? !Micro Talk - Test Your S#!? !
Micro Talk - Test Your S#!? !Adam Hill
 
Node.js Patterns and Opinions
Node.js Patterns and OpinionsNode.js Patterns and Opinions
Node.js Patterns and OpinionsIsaacSchlueter
 
ATXPUG Meetup 11/11/14 - Managing complexity in Puppet Code
ATXPUG Meetup 11/11/14 - Managing complexity in Puppet CodeATXPUG Meetup 11/11/14 - Managing complexity in Puppet Code
ATXPUG Meetup 11/11/14 - Managing complexity in Puppet CodeByron Miller
 

Was ist angesagt? (11)

How to improve your skills as a programmer
How to improve your skills as a programmerHow to improve your skills as a programmer
How to improve your skills as a programmer
 
Python - The Good, The Bad and The ugly
Python - The Good, The Bad and The ugly Python - The Good, The Bad and The ugly
Python - The Good, The Bad and The ugly
 
Reactive GUI Implemented in Clojure
Reactive GUI Implemented in ClojureReactive GUI Implemented in Clojure
Reactive GUI Implemented in Clojure
 
The Good, the Bad and the Ugly things to do with android
The Good, the Bad and the Ugly things to do with androidThe Good, the Bad and the Ugly things to do with android
The Good, the Bad and the Ugly things to do with android
 
Joe Damato
Joe DamatoJoe Damato
Joe Damato
 
Azphp phpunit-jenkins
Azphp phpunit-jenkinsAzphp phpunit-jenkins
Azphp phpunit-jenkins
 
Micro Talk - Test Your S#!? !
Micro Talk - Test Your S#!? !Micro Talk - Test Your S#!? !
Micro Talk - Test Your S#!? !
 
Node.js Patterns and Opinions
Node.js Patterns and OpinionsNode.js Patterns and Opinions
Node.js Patterns and Opinions
 
Port Scanning with Node.js
Port Scanning with Node.jsPort Scanning with Node.js
Port Scanning with Node.js
 
ATXPUG Meetup 11/11/14 - Managing complexity in Puppet Code
ATXPUG Meetup 11/11/14 - Managing complexity in Puppet CodeATXPUG Meetup 11/11/14 - Managing complexity in Puppet Code
ATXPUG Meetup 11/11/14 - Managing complexity in Puppet Code
 
Coffeescript
CoffeescriptCoffeescript
Coffeescript
 

Ähnlich wie Everything you need to know about programming without code

You and your code.pdf
You and your code.pdfYou and your code.pdf
You and your code.pdfTony Khánh
 
Chelberg ptcuser 2010
Chelberg ptcuser 2010Chelberg ptcuser 2010
Chelberg ptcuser 2010Clay Helberg
 
Introduction to the intermediate Python - v1.1
Introduction to the intermediate Python - v1.1Introduction to the intermediate Python - v1.1
Introduction to the intermediate Python - v1.1Andrei KUCHARAVY
 
How to write a well-behaved Python command line application
How to write a well-behaved Python command line applicationHow to write a well-behaved Python command line application
How to write a well-behaved Python command line applicationgjcross
 
Learn to Code with MIT App Inventor ( PDFDrive ).pdf
Learn to Code with MIT App Inventor ( PDFDrive ).pdfLearn to Code with MIT App Inventor ( PDFDrive ).pdf
Learn to Code with MIT App Inventor ( PDFDrive ).pdfNemoPalleschi
 
Reproducible research concepts and tools
Reproducible research concepts and toolsReproducible research concepts and tools
Reproducible research concepts and toolsC. Tobin Magle
 
01 introduction to cpp
01   introduction to cpp01   introduction to cpp
01 introduction to cppManzoor ALam
 
If you want to automate, you learn to code
If you want to automate, you learn to codeIf you want to automate, you learn to code
If you want to automate, you learn to codeAlan Richardson
 
Putting Compilers to Work
Putting Compilers to WorkPutting Compilers to Work
Putting Compilers to WorkSingleStore
 
The Final Frontier
The Final FrontierThe Final Frontier
The Final FrontierjClarity
 
Apresentação - Minicurso de Introdução a Python, Data Science e Machine Learning
Apresentação - Minicurso de Introdução a Python, Data Science e Machine LearningApresentação - Minicurso de Introdução a Python, Data Science e Machine Learning
Apresentação - Minicurso de Introdução a Python, Data Science e Machine LearningArthur Emanuel
 
2015 msu-code-review
2015 msu-code-review2015 msu-code-review
2015 msu-code-reviewc.titus.brown
 
Lean-Agile Development with SharePoint - Bill Ayers
Lean-Agile Development with SharePoint - Bill AyersLean-Agile Development with SharePoint - Bill Ayers
Lean-Agile Development with SharePoint - Bill AyersSPC Adriatics
 
TDD - Seriously, try it! (updated '22)
TDD - Seriously, try it! (updated '22)TDD - Seriously, try it! (updated '22)
TDD - Seriously, try it! (updated '22)Nacho Cougil
 
TDD - Christchurch APN May 2012
TDD - Christchurch APN May 2012TDD - Christchurch APN May 2012
TDD - Christchurch APN May 2012Alan Christensen
 
Reading Notes : the practice of programming
Reading Notes : the practice of programmingReading Notes : the practice of programming
Reading Notes : the practice of programmingJuggernaut Liu
 

Ähnlich wie Everything you need to know about programming without code (20)

You and your code.pdf
You and your code.pdfYou and your code.pdf
You and your code.pdf
 
Chelberg ptcuser 2010
Chelberg ptcuser 2010Chelberg ptcuser 2010
Chelberg ptcuser 2010
 
Introduction to the intermediate Python - v1.1
Introduction to the intermediate Python - v1.1Introduction to the intermediate Python - v1.1
Introduction to the intermediate Python - v1.1
 
PHP - Introduction to PHP Bugs - Debugging
PHP -  Introduction to  PHP Bugs - DebuggingPHP -  Introduction to  PHP Bugs - Debugging
PHP - Introduction to PHP Bugs - Debugging
 
How to write a well-behaved Python command line application
How to write a well-behaved Python command line applicationHow to write a well-behaved Python command line application
How to write a well-behaved Python command line application
 
Learn to Code with MIT App Inventor ( PDFDrive ).pdf
Learn to Code with MIT App Inventor ( PDFDrive ).pdfLearn to Code with MIT App Inventor ( PDFDrive ).pdf
Learn to Code with MIT App Inventor ( PDFDrive ).pdf
 
Learning to code
Learning to codeLearning to code
Learning to code
 
Reproducible research concepts and tools
Reproducible research concepts and toolsReproducible research concepts and tools
Reproducible research concepts and tools
 
01 introduction to cpp
01   introduction to cpp01   introduction to cpp
01 introduction to cpp
 
If you want to automate, you learn to code
If you want to automate, you learn to codeIf you want to automate, you learn to code
If you want to automate, you learn to code
 
Putting Compilers to Work
Putting Compilers to WorkPutting Compilers to Work
Putting Compilers to Work
 
The Final Frontier
The Final FrontierThe Final Frontier
The Final Frontier
 
Apresentação - Minicurso de Introdução a Python, Data Science e Machine Learning
Apresentação - Minicurso de Introdução a Python, Data Science e Machine LearningApresentação - Minicurso de Introdução a Python, Data Science e Machine Learning
Apresentação - Minicurso de Introdução a Python, Data Science e Machine Learning
 
2015 msu-code-review
2015 msu-code-review2015 msu-code-review
2015 msu-code-review
 
Lean-Agile Development with SharePoint - Bill Ayers
Lean-Agile Development with SharePoint - Bill AyersLean-Agile Development with SharePoint - Bill Ayers
Lean-Agile Development with SharePoint - Bill Ayers
 
Gpgpu intro
Gpgpu introGpgpu intro
Gpgpu intro
 
Introduction to Coding
Introduction to CodingIntroduction to Coding
Introduction to Coding
 
TDD - Seriously, try it! (updated '22)
TDD - Seriously, try it! (updated '22)TDD - Seriously, try it! (updated '22)
TDD - Seriously, try it! (updated '22)
 
TDD - Christchurch APN May 2012
TDD - Christchurch APN May 2012TDD - Christchurch APN May 2012
TDD - Christchurch APN May 2012
 
Reading Notes : the practice of programming
Reading Notes : the practice of programmingReading Notes : the practice of programming
Reading Notes : the practice of programming
 

Kürzlich hochgeladen

CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
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
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
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
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 

Kürzlich hochgeladen (20)

CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
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
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
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
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 

Everything you need to know about programming without code

  • 1. Everything you need to know about programming Without any programming Danny Mulligan danny@dannymulligan.com
  • 2. Overview • Editors/IDEs • Libraries • Revision Control • Documentation • Testing • Getting help • Debugging • Practicing • Common errors • Q&A • Performance
  • 3. Editors/IDEs • Use what you already know • Use something simple • Use something that everybody else is using • Learn to walk before you learn to run • The right choice for an expert is probably not the right choice for you (at least right now) • Learn to type • Learn keyboard short cuts
  • 4. Editors/IDEs • Common editor choices – Textedit (standard on Macs) – Notepad (standard on Window) – EMACS http://emacsformacosx.com/ – vim https://code.google.com/p/macvim/ – Notepad++ http://notepad-plus-plus.org/ – BBEdit http://www.barebones.com/products/bbedit/index.html – TextMate http://macromates.com/ • IDEs and other stuff you might try – Eclipse http://www.eclipse.org/ – Pycharm https://www.jetbrains.com/pycharm/ – Spyder IDE https://code.google.com/p/spyderlib/ – iPython http://ipython.org/ (iPython notebooks are great!) – iTerm 2 http://www.iterm2.com/ (Replacement for Mac’s terminal) – 10 Fast Fingers http://10fastfingers.com/
  • 5. Revision Control • Absolutely essential for teams • A good idea for you • Unfortunately, not the simplest stuff to master • Popular tools: GIT, Hg, SVN, CVS, Perforce, Visual SourceSafe • GitHib https://github.com/ – Allows you to share code easily – Windows app http://windows.github.com/ – Mac app http://mac.github.com/ • Related #1: when was your last backup? • Related #2: bug tracking is important too (especially for teams)
  • 6. Testing • How do you know if you code has any bugs? – Easy = it has bugs, you haven’t found them yet • Writing tests is every bit as important as writing code – Pro move = write the tests FIRST! • Keep the test code after you’ve written it • Unit tests & regression tests • Write defensive code (use assert statements) • Testing your code is a HARD problem, don’t underestimate it • Dividing coding and testing between multiple people can help
  • 8. Debugging • Print statements – show you what’s going on • Assert statements – verify your assumptions • Fancy debuggers – less useful than you’d think • Write documentation on your code • Code reviews - explain the code to someone else • Avoid putting the bugs in in the first place – Shorter code has fewer bugs – Simpler code has fewer bugs – Code that’s not there has 0 bugs = use the libraries
  • 9. Common Errors • Off by 1 errors (AKA fencepost errors) • = vs. == • Logical (and, or) vs. bitwise (&, |) operators, (use logical almost always) • integers vs. floats a = 5/(1/3) # a should be equal to 15, or is it? • Integer or float? a = 1/3; b = 3/9; c = a/b; print c # c is equal to 1, right? • Floats are imprecise a = 2.15*3; b = 6.45; print (a == b) # True or False? • Division by zero • Logic errors – easy to make mistakes with nested if statements • Are you working with a copy, or the original object? colors = [‘red’, ‘green’, ‘blue’] b = colors; b[0] = ‘black’ print colors # Did colors change? • Inadequate or no error handling • Complexity is the enemy of correctness
  • 10. Performance • Your performance matters a LOT more than the computer’s performance • So don’t worry about performance
  • 11. Performance optimization • Simple is usually faster • Use library functions whenever you can • Use the pareto principle, AKA the 80/20 rule – Profile first, optimize later – “premature optimization is the root of all evil” • If you MUST optimize for performance – Do easy optimizations first – Your brain is the best optimization tool – Make sure you don’t break your program in the process
  • 12. Libraries • Learn what is in the standard library • Get the documentation • Some important libraries: – Python Standard Library: by far the most important – Python Image Library: image manipulation – Matplotlib: charts & graphs – Numpy: high performance data processing – Django: web framework – Scikit-learn: machine learning – Pandas: data analysis – NLTK: natural language
  • 13. Python Standard Library • string – Common string operations • re – Regular expression operators • math – Mathematical functions • csv – CSV File Reading and Writing • datetime – Basic data and time types • random – Generate pseudo-random numbers • itertools – Functions creating iterators for efficient looping • collections – High-performance container datatypes • os – Miscellaneous operating system interfaces • threading – Higher-level threading interface • pdb – The Python Debugger • profile & cProfile – Profiling tools • test – Regression tests package for Python
  • 14. Documentation • Python docs online at http://docs.python.org/2/library/ • I keep PDFs of the Python docs on my laptop http://docs.python.org/2/download.html • The standard docs include a nice Tutorial • “The Python Library Reference” is by far the most useful doc – 1,457 pages, but do not read (except the ToC) – Look up what you need when you need it
  • 15. Getting help • Read the docs, read other people’s code • Google your question, look for similar code • When you google, you will often end up on StackOverflow – Best site for programming questions http://stackoverflow.com • Watch tutorials on YouTube - examples – 3 hour iPython tutorial https://www.youtube.com/watch?v=2G5YTlheCbw – 83 video playlist from PyCon 2012 https://www.youtube.com/playlist?list=PL2814D3290BAA8837 – 30 minute overview of Pandas https://www.youtube.com/watch?v=qbYYamU42Sw – 3 hour tutorial on Pandas https://www.youtube.com/watch?v=w26x-z-BdWQ
  • 16. Practicing • How do you get better at golf? – Read a book or play golf? • How do you get better at programming? – Use it in your job – Solve some real world problems – Read other people’s code • Some real world programming exercises – Coding Bat http://codingbat.com/python – Project Euler https://projecteuler.net/
  • 17. Q&A