SlideShare uma empresa Scribd logo
1 de 46
PiTechnologies

  Tudor Prodan
    March 2009
What is Python

- a “very high-level language”
- developed by Guido van Rossum
- main features:

    simple, yet powerful semantics
    object-oriented, but multi-paradigm
    clean syntax and coherent design
    focus on productivity
    rich standard library
    lots of high quality 3rd-party
    several good implementations:
     CPython, Pypy, IronPython (2.0.1), PyS60, Jython
Jython


Jython, lest you do not know of it, is the most
compelling weapon the Java platform has for its
survival into the 21st century :-)

                         —Sean McGrath, CTO, Propylon
                                        July 31, 2003
CPython

Version   history:
    1.0   – Jan 1994
    2.0   – Oct 2000
    3.0   – Dec 2008

Latest stable versions:
    2.6.1 and 3.0.1

Usable versions:
    2.5.x
    2.6.x = 2.5 + improvements + 3.0 features
                                 (__future__)
    | | |__ maintenance version
    | |____ minor version
    |______ major version
Why Python?
Why Python

 programming is fun again
Unfinished game

The problem of the unfinished game:

Let's say, hypothetically speaking,
you met someone who told you they had two children,
and one of them is a girl.

What are the odds that person has a boy and a girl?


                      -Jeff Atwood, December 30, 2008
                     http://www.codinghorror.com/blog
Unfinished game

Java
Unfinished game

C#
Unfinished game

Python
Unfinished game


         LoC   readable?   fun?

Java     53    barely      nope

C#       49    kind of     not really

Python   10    clean,      much more fun
               concise     than the above
Why Python

   programming is fun again
   agility
   elegance
   you don't have to fight the language
Why Python


Java is the COBOL of the 21st century.

                                -Sean Kelly, JPL, NASA
Spirit of C

Python is close to the “Spirit of C” (more than C++/
Java/...), as per ISO C Standard's “rationale”:

 trust the programmer
 don't prevent the programmer from doing what needs
to be done
 keep the language small and simple
 provide only one way to do an operation
 make it fast, even if it's not guaranteed to be
portable (the only bit not @100% in Python)
Python vs. C(++,#)/Java/..

 everything is a first-class object
   - functions, methods, modules, ..

 typing: strong, but dynamic
   - names have no type, objects have types

 no “declarations”, just statements
   - implicit compilation, .pyc files
   - everything is run-time (compile-time too)

 spare syntax,   minimal ornamentation
   - no { } for   blocks
   - no ( ) for   conditions
   - a lot less   punctuation
Python vs. C(++,#)/Java/..

In the 1960's the KGB was very interested in learning everything
possible about the American space program, sending all sorts of
spies to find every possible piece of information.

One afternoon, a breathless spy returned to headquarters with a
piece of paper in his hand, excitedly shouting to his superior,
"Comrade! Comrade! The Americans are using Lisp to write their
rocket launching software!“

The commander was skeptical. "How do you know?"

"I broke into their research lab and stole a page from the
teletype machine! It's not the whole program, but it's the final
page and contains the concluding logic of the program! See for
yourself!"

The commander looked at the page and smiled:
Python vs. C(++,#)/Java/..

))))))))))))))))))))))))))))))))))))))))))))))))))))))
))))))))))))))))))))))))))))))))))))))))))))))))))))))
))))))))))))))))))))))))))))))))))))))))))))))))))))))
)))))))))))))))))))))))))))))))))))))))))
))))))))))))))))))))))))))))))))))))))
))))))))))))))))))))))))))))))))))))
)))))))))))))))))))))))))))
)))))))))))))))))))))))))
))))))))))))))))))))))
))))))))))))))))))))
))))))))))))))))
)))))))))))))))
)))))))))))
))))
)))
))
))
)
Why Python

Example #2:

Create a Coordinate class
which holds a latitude and longitude,
to be used by a TelemetryTracker object.
Why Python


this example will show
    Python vs. Java

but is actually
    Python vs. Java / C# / PHP / (most others)
Why Python

Java:
Philosophy



You know you've reached perfection in design, not
when you have nothing more to add, but when you have
nothing more to take away.

                            -Antoine de Saint Exupery
Why Python

Java:        Python:
Why Python

The Java guys will say:

 my IDE can generate most of that
  - code is read a lot more than written
Why Python

The Java guys will say:

 my IDE can generate most of that
  - code is read a lot more than written

 but, your fields are public
  - Python philosophy
Why Python

The Java guys will say:

 my IDE can generate most of that
  - code is read a lot more than written

 but, your fields are public
  - Python philosophy

 can't we apply this to other languages?
Why Python

Java:        Python:
Why Python

Eventually, the code will end up in production..

Java:                      Python:
Why Python

.. time passes ..
Why Python

.. time passes ..

Eventually,
    decodeLat receives bad data

This is a bug!

What do we do?

 - add a check
Why Python

Add a setter and a getter:
Why Python

Add a setter and a getter:




Let's try it out:
Why Python


and the TelemetryTracker code:

Python:
    - still works


Java:
    - needs modification
Why Python


in the end:

Python:
    - gives you a choice
    - you can even change your mind

Java/C#/PHP/..:
    - no choice
Why Python

   programming is fun again
   agility
   elegance
   you don't have to fight the language
   the language trusts you
   .. it accommodates you
Why Python

   programming is fun again
   agility
   elegance
   you don't have to fight the language
   the language trusts you
   .. it accommodates you
   .. and will not go out of it's way to stop you
Why Python

Python has
lots &
LOTS
of good
books:
Why Python

   programming is fun again
   agility
   elegance
   you don't have to fight the language
   the language trusts you
   .. it accommodates you
   .. and will not go out of it's way to stop you
   good documentation (lots of books)
   good support: lots of forums, mailing lists, IRC
Why Python

Large number of high quality 3rd-party libraries and
frameworks:

- networking: twisted, cogen, concurrence
- scientific: NumPy, ScyPy, PyEvolve (genetic algorithms)
- testing: PyUnit, Google Mox
- fuzzing: Fuzz
- database: SQLAlchemy, Elixir, Django ORM
- web crawling: BeautifulSoup, lxml, Scrappy
- game development: PyGame
- GUI: PyGTK, wxPython, PyQt, GTK#
-templating: Genshi, Mako, Kid, Jinja2
- cryptography: M2Crypto, PyCrypto, Keyczar,

.. many, many others
Why Python

   programming is fun again
   agility
   elegance
   you don't have to fight the language
   the language trusts you
   .. it accommodates you
   .. and will not go out of it's way to stop you
   good documentation (lots of books)
   good support: lots of forums, IRC, mailing lists
   lots of high quality 3rd-party libraries
Why Python

But most interesting to us,
lots of great web frameworks:
Why Python

   programming is fun again
   agility
   elegance
   you don't have to fight the language
   the language trusts you
   .. it accommodates you
   .. and will not go out of it's way to stop you
   good documentation (lots of books)
   good support: lots of forums, IRC, mailing lists
   lots of high quality 3rd-party libraries
   many great web frameworks
Python @ PiTech - March 2009

Mais conteúdo relacionado

Mais procurados

开源沙龙第一期 Python intro
开源沙龙第一期 Python intro开源沙龙第一期 Python intro
开源沙龙第一期 Python intro
fantasy zheng
 
Pythonanditsapplications 161121160425
Pythonanditsapplications 161121160425Pythonanditsapplications 161121160425
Pythonanditsapplications 161121160425
Sapna Tyagi
 

Mais procurados (20)

开源沙龙第一期 Python intro
开源沙龙第一期 Python intro开源沙龙第一期 Python intro
开源沙龙第一期 Python intro
 
Why I Love Python
Why I Love PythonWhy I Love Python
Why I Love Python
 
Profiling and optimizing RAM and CPU use in RMG-Py
Profiling and optimizing RAM and CPU use in RMG-PyProfiling and optimizing RAM and CPU use in RMG-Py
Profiling and optimizing RAM and CPU use in RMG-Py
 
Python: the Project, the Language and the Style
Python: the Project, the Language and the StylePython: the Project, the Language and the Style
Python: the Project, the Language and the Style
 
Introduction to python programming, Why Python?, Applications of Python
Introduction to python programming, Why Python?, Applications of PythonIntroduction to python programming, Why Python?, Applications of Python
Introduction to python programming, Why Python?, Applications of Python
 
Writing Fast Code (JP) - PyCon JP 2015
Writing Fast Code (JP) - PyCon JP 2015Writing Fast Code (JP) - PyCon JP 2015
Writing Fast Code (JP) - PyCon JP 2015
 
First python project
First python projectFirst python project
First python project
 
Top 10 python ide
Top 10 python ideTop 10 python ide
Top 10 python ide
 
Python Introduction
Python IntroductionPython Introduction
Python Introduction
 
Python for the Mobile and Web
Python for the Mobile and WebPython for the Mobile and Web
Python for the Mobile and Web
 
Pythonanditsapplications 161121160425
Pythonanditsapplications 161121160425Pythonanditsapplications 161121160425
Pythonanditsapplications 161121160425
 
Hello World! with Python
Hello World! with PythonHello World! with Python
Hello World! with Python
 
Python basics_ part1
Python basics_ part1Python basics_ part1
Python basics_ part1
 
Python Workshop
Python WorkshopPython Workshop
Python Workshop
 
Introduction to Python
Introduction to PythonIntroduction to Python
Introduction to Python
 
Python in programming competitions
Python in programming competitionsPython in programming competitions
Python in programming competitions
 
Python and Machine Learning
Python and Machine LearningPython and Machine Learning
Python and Machine Learning
 
Ry pyconjp2015 karaoke
Ry pyconjp2015 karaokeRy pyconjp2015 karaoke
Ry pyconjp2015 karaoke
 
Introduction to python 3 2nd round
Introduction to python 3   2nd roundIntroduction to python 3   2nd round
Introduction to python 3 2nd round
 
pyconjp2015_talk_Translation of Python Program__
pyconjp2015_talk_Translation of Python Program__pyconjp2015_talk_Translation of Python Program__
pyconjp2015_talk_Translation of Python Program__
 

Destaque

Activation-of-human-immunodeficiency-virus-type-1-expression-by-Gardnerella-v...
Activation-of-human-immunodeficiency-virus-type-1-expression-by-Gardnerella-v...Activation-of-human-immunodeficiency-virus-type-1-expression-by-Gardnerella-v...
Activation-of-human-immunodeficiency-virus-type-1-expression-by-Gardnerella-v...
Farhad B. Hashemi, PhD
 
Proposal lezara
Proposal   lezaraProposal   lezara
Proposal lezara
Maru Lord
 
Why doing a DEVA now is the best option
Why doing a DEVA now is the best optionWhy doing a DEVA now is the best option
Why doing a DEVA now is the best option
Secova
 
приём в октябрята
приём в октябрятаприём в октябрята
приём в октябрята
Sokol194
 

Destaque (16)

Actividad de aprendizaje 9
Actividad de aprendizaje 9Actividad de aprendizaje 9
Actividad de aprendizaje 9
 
Social network
Social networkSocial network
Social network
 
Lebenslauf
LebenslaufLebenslauf
Lebenslauf
 
Activation-of-human-immunodeficiency-virus-type-1-expression-by-Gardnerella-v...
Activation-of-human-immunodeficiency-virus-type-1-expression-by-Gardnerella-v...Activation-of-human-immunodeficiency-virus-type-1-expression-by-Gardnerella-v...
Activation-of-human-immunodeficiency-virus-type-1-expression-by-Gardnerella-v...
 
Pasos para-hacer-una-buena-presentación
Pasos para-hacer-una-buena-presentaciónPasos para-hacer-una-buena-presentación
Pasos para-hacer-una-buena-presentación
 
MWO 2016
MWO 2016 MWO 2016
MWO 2016
 
Kim CV Mar 2015
Kim CV Mar 2015Kim CV Mar 2015
Kim CV Mar 2015
 
Welcome to the world of graphics design
Welcome to the world of graphics designWelcome to the world of graphics design
Welcome to the world of graphics design
 
ΔΩΡΕΑΝ ιατρικές εξετάσεις
ΔΩΡΕΑΝ ιατρικές εξετάσειςΔΩΡΕΑΝ ιατρικές εξετάσεις
ΔΩΡΕΑΝ ιατρικές εξετάσεις
 
Proposal lezara
Proposal   lezaraProposal   lezara
Proposal lezara
 
Why doing a DEVA now is the best option
Why doing a DEVA now is the best optionWhy doing a DEVA now is the best option
Why doing a DEVA now is the best option
 
Anxiety disorder treatment
Anxiety disorder treatmentAnxiety disorder treatment
Anxiety disorder treatment
 
Grafitalia 2013
Grafitalia 2013Grafitalia 2013
Grafitalia 2013
 
приём в октябрята
приём в октябрятаприём в октябрята
приём в октябрята
 
CliqTags - Säljpresentation
CliqTags - SäljpresentationCliqTags - Säljpresentation
CliqTags - Säljpresentation
 
Uyoc
UyocUyoc
Uyoc
 

Semelhante a Python @ PiTech - March 2009

What is Python? (Silicon Valley CodeCamp 2015)
What is Python? (Silicon Valley CodeCamp 2015)What is Python? (Silicon Valley CodeCamp 2015)
What is Python? (Silicon Valley CodeCamp 2015)
wesley chun
 
Anton Kasyanov, Introduction to Python, Lecture1
Anton Kasyanov, Introduction to Python, Lecture1Anton Kasyanov, Introduction to Python, Lecture1
Anton Kasyanov, Introduction to Python, Lecture1
Anton Kasyanov
 
Python Intro For Managers
Python Intro For ManagersPython Intro For Managers
Python Intro For Managers
Atul Shridhar
 
Python and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthroughPython and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthrough
gabriellekuruvilla
 

Semelhante a Python @ PiTech - March 2009 (20)

What is Python? (Silicon Valley CodeCamp 2015)
What is Python? (Silicon Valley CodeCamp 2015)What is Python? (Silicon Valley CodeCamp 2015)
What is Python? (Silicon Valley CodeCamp 2015)
 
Doing the Impossible
Doing the ImpossibleDoing the Impossible
Doing the Impossible
 
What is Python? (Silicon Valley CodeCamp 2014)
What is Python? (Silicon Valley CodeCamp 2014)What is Python? (Silicon Valley CodeCamp 2014)
What is Python? (Silicon Valley CodeCamp 2014)
 
05 python.pdf
05 python.pdf05 python.pdf
05 python.pdf
 
What is Python?
What is Python?What is Python?
What is Python?
 
Python for Science and Engineering: a presentation to A*STAR and the Singapor...
Python for Science and Engineering: a presentation to A*STAR and the Singapor...Python for Science and Engineering: a presentation to A*STAR and the Singapor...
Python for Science and Engineering: a presentation to A*STAR and the Singapor...
 
Anton Kasyanov, Introduction to Python, Lecture1
Anton Kasyanov, Introduction to Python, Lecture1Anton Kasyanov, Introduction to Python, Lecture1
Anton Kasyanov, Introduction to Python, Lecture1
 
Python and its Applications
Python and its ApplicationsPython and its Applications
Python and its Applications
 
Why learn python in 2017?
Why learn python in 2017?Why learn python in 2017?
Why learn python in 2017?
 
Python 101 For The Net Developer
Python 101 For The Net DeveloperPython 101 For The Net Developer
Python 101 For The Net Developer
 
A Whirlwind Tour Of Python
A Whirlwind Tour Of PythonA Whirlwind Tour Of Python
A Whirlwind Tour Of Python
 
Python: the secret weapon of Fedora - FLISoL 2015
Python: the secret weapon of Fedora - FLISoL 2015Python: the secret weapon of Fedora - FLISoL 2015
Python: the secret weapon of Fedora - FLISoL 2015
 
Python Intro For Managers
Python Intro For ManagersPython Intro For Managers
Python Intro For Managers
 
Codebits Handivi
Codebits HandiviCodebits Handivi
Codebits Handivi
 
SoC Python Discussion Group
SoC Python Discussion GroupSoC Python Discussion Group
SoC Python Discussion Group
 
Py4 inf 01-intro
Py4 inf 01-introPy4 inf 01-intro
Py4 inf 01-intro
 
Exploring the Internet of Things Using Ruby
Exploring the Internet of Things Using RubyExploring the Internet of Things Using Ruby
Exploring the Internet of Things Using Ruby
 
Python and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthroughPython and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthrough
 
py4inf-01-intro.ppt
py4inf-01-intro.pptpy4inf-01-intro.ppt
py4inf-01-intro.ppt
 
Python intro
Python introPython intro
Python intro
 

Último

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 

Python @ PiTech - March 2009

  • 1. PiTechnologies Tudor Prodan March 2009
  • 2.
  • 3. What is Python - a “very high-level language” - developed by Guido van Rossum - main features:  simple, yet powerful semantics  object-oriented, but multi-paradigm  clean syntax and coherent design  focus on productivity  rich standard library  lots of high quality 3rd-party  several good implementations: CPython, Pypy, IronPython (2.0.1), PyS60, Jython
  • 4. Jython Jython, lest you do not know of it, is the most compelling weapon the Java platform has for its survival into the 21st century :-) —Sean McGrath, CTO, Propylon July 31, 2003
  • 5. CPython Version history: 1.0 – Jan 1994 2.0 – Oct 2000 3.0 – Dec 2008 Latest stable versions: 2.6.1 and 3.0.1 Usable versions: 2.5.x 2.6.x = 2.5 + improvements + 3.0 features (__future__) | | |__ maintenance version | |____ minor version |______ major version
  • 7.
  • 8.
  • 10. Unfinished game The problem of the unfinished game: Let's say, hypothetically speaking, you met someone who told you they had two children, and one of them is a girl. What are the odds that person has a boy and a girl? -Jeff Atwood, December 30, 2008 http://www.codinghorror.com/blog
  • 14. Unfinished game LoC readable? fun? Java 53 barely nope C# 49 kind of not really Python 10 clean, much more fun concise than the above
  • 15. Why Python  programming is fun again  agility  elegance  you don't have to fight the language
  • 16. Why Python Java is the COBOL of the 21st century. -Sean Kelly, JPL, NASA
  • 17. Spirit of C Python is close to the “Spirit of C” (more than C++/ Java/...), as per ISO C Standard's “rationale”:  trust the programmer  don't prevent the programmer from doing what needs to be done  keep the language small and simple  provide only one way to do an operation  make it fast, even if it's not guaranteed to be portable (the only bit not @100% in Python)
  • 18. Python vs. C(++,#)/Java/..  everything is a first-class object - functions, methods, modules, ..  typing: strong, but dynamic - names have no type, objects have types  no “declarations”, just statements - implicit compilation, .pyc files - everything is run-time (compile-time too)  spare syntax, minimal ornamentation - no { } for blocks - no ( ) for conditions - a lot less punctuation
  • 19. Python vs. C(++,#)/Java/.. In the 1960's the KGB was very interested in learning everything possible about the American space program, sending all sorts of spies to find every possible piece of information. One afternoon, a breathless spy returned to headquarters with a piece of paper in his hand, excitedly shouting to his superior, "Comrade! Comrade! The Americans are using Lisp to write their rocket launching software!“ The commander was skeptical. "How do you know?" "I broke into their research lab and stole a page from the teletype machine! It's not the whole program, but it's the final page and contains the concluding logic of the program! See for yourself!" The commander looked at the page and smiled:
  • 21. Why Python Example #2: Create a Coordinate class which holds a latitude and longitude, to be used by a TelemetryTracker object.
  • 22. Why Python this example will show Python vs. Java but is actually Python vs. Java / C# / PHP / (most others)
  • 24. Philosophy You know you've reached perfection in design, not when you have nothing more to add, but when you have nothing more to take away. -Antoine de Saint Exupery
  • 25. Why Python Java: Python:
  • 26. Why Python The Java guys will say:  my IDE can generate most of that - code is read a lot more than written
  • 27. Why Python The Java guys will say:  my IDE can generate most of that - code is read a lot more than written  but, your fields are public - Python philosophy
  • 28. Why Python The Java guys will say:  my IDE can generate most of that - code is read a lot more than written  but, your fields are public - Python philosophy  can't we apply this to other languages?
  • 29. Why Python Java: Python:
  • 30. Why Python Eventually, the code will end up in production.. Java: Python:
  • 31. Why Python .. time passes ..
  • 32. Why Python .. time passes .. Eventually, decodeLat receives bad data This is a bug! What do we do? - add a check
  • 33. Why Python Add a setter and a getter:
  • 34. Why Python Add a setter and a getter: Let's try it out:
  • 35. Why Python and the TelemetryTracker code: Python: - still works Java: - needs modification
  • 36. Why Python in the end: Python: - gives you a choice - you can even change your mind Java/C#/PHP/..: - no choice
  • 37. Why Python  programming is fun again  agility  elegance  you don't have to fight the language  the language trusts you  .. it accommodates you
  • 38. Why Python  programming is fun again  agility  elegance  you don't have to fight the language  the language trusts you  .. it accommodates you  .. and will not go out of it's way to stop you
  • 39. Why Python Python has lots & LOTS of good books:
  • 40. Why Python  programming is fun again  agility  elegance  you don't have to fight the language  the language trusts you  .. it accommodates you  .. and will not go out of it's way to stop you  good documentation (lots of books)  good support: lots of forums, mailing lists, IRC
  • 41.
  • 42. Why Python Large number of high quality 3rd-party libraries and frameworks: - networking: twisted, cogen, concurrence - scientific: NumPy, ScyPy, PyEvolve (genetic algorithms) - testing: PyUnit, Google Mox - fuzzing: Fuzz - database: SQLAlchemy, Elixir, Django ORM - web crawling: BeautifulSoup, lxml, Scrappy - game development: PyGame - GUI: PyGTK, wxPython, PyQt, GTK# -templating: Genshi, Mako, Kid, Jinja2 - cryptography: M2Crypto, PyCrypto, Keyczar, .. many, many others
  • 43. Why Python  programming is fun again  agility  elegance  you don't have to fight the language  the language trusts you  .. it accommodates you  .. and will not go out of it's way to stop you  good documentation (lots of books)  good support: lots of forums, IRC, mailing lists  lots of high quality 3rd-party libraries
  • 44. Why Python But most interesting to us, lots of great web frameworks:
  • 45. Why Python  programming is fun again  agility  elegance  you don't have to fight the language  the language trusts you  .. it accommodates you  .. and will not go out of it's way to stop you  good documentation (lots of books)  good support: lots of forums, IRC, mailing lists  lots of high quality 3rd-party libraries  many great web frameworks