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

Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkPixlogix Infotech
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxfnnc6jmgwh
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 

Kürzlich hochgeladen (20)

Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App Framework
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 

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