Programming with
         Dynamic Confidence


                                     Matt Harrison
                      ma...
Confessions
                                                              Read only

                                     ...
Missing functionality!
    No private members          No “debug” build
●                           ●


    No constants  ...
Less is more
Smaller == ?

 Easier to read
●

●Less bugs

●Less time

●Easier to change

●Time for fun things

●Less testing

●Less to ...
If it's not tested it's broken

                 Bruce Eckels
Simple Edit/Update Flow

 Change/update
    foo.py




diff foo.py foo.py~     Patch
Complex Edit/Update Flow
 Check in SCM


  Run unit tests


Examine coverage


                   No
                     ...
http://www.flickr.com/photos/hypowren/523594838/
pep8.py

#python pep8.py ­­show­pep8 SQLAlchemy­0.3.7­
py2.4.egg/sqlalchemy/sql.py
...
SQLAlchemy­0.3.7­py2.4.egg/sqlalche...
pylint

Global evaluation
­­­­­­­­­­­­­­­­­
Your code has been rated at 
4.15/10
640 Kb ought to be enough for anyone




http://www.flickr.com/photos/esparta/187132368/in/set-72157594187689069/
Measuring programming progress
 by lines of code is like measuring
aircraft building progress by weight




  http://www.f...
Controlling complexity is the
   essence of computer
        programming

                Brian Kernighan
Refactoring

 A change made to the internal
structure of the software to make
   it easier to understand and
    cheaper t...
Code coverage
       reports
considered dangerous?
http://flickr.com/photos/editor/90242221/
UQDS
Questions?
Thanks
Simplicity is prerequisite for
          reliability
                Edsger W. Dijkstra
Os Harrison
Upcoming SlideShare
Loading in …5
×

Os Harrison

825 views

Published on

Published in: Business, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
825
On SlideShare
0
From Embeds
0
Number of Embeds
35
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Os Harrison

  1. 1. Programming with Dynamic Confidence Matt Harrison matthewharrison@gmail.com http://panela.blog-city.com/ OSCON July 26, 2007
  2. 2. Confessions Read only Ask Question Committers Buggers Patchers http://www.flickr.com/photos/flikr/45457114/in/photostream/
  3. 3. Missing functionality! No private members No “debug” build ● ● No constants No difference ● ● between initialization No explicit exception ● & assignment catching No pointers ● No preprocessor ● No case statement ● No compilation ● warnings No boolean type* ● No final variables No malloc/free ● ● No enumerations No buffer overflows ● ●
  4. 4. Less is more
  5. 5. Smaller == ? Easier to read ● ●Less bugs ●Less time ●Easier to change ●Time for fun things ●Less testing ●Less to review
  6. 6. If it's not tested it's broken Bruce Eckels
  7. 7. Simple Edit/Update Flow Change/update foo.py diff foo.py foo.py~ Patch
  8. 8. Complex Edit/Update Flow Check in SCM Run unit tests Examine coverage No Create unit test Code covered? Yes Change code Patch Check in SCM
  9. 9. http://www.flickr.com/photos/hypowren/523594838/
  10. 10. pep8.py #python pep8.py ­­show­pep8 SQLAlchemy­0.3.7­ py2.4.egg/sqlalchemy/sql.py ... SQLAlchemy­0.3.7­py2.4.egg/sqlalchemy/  sql.py:2445:35: W601 .has_key() is deprecated,  use 'in'     The {}.has_key() method will be removed in  the future version of Python. Use the 'in'  operation instead, like:     d = {quot;aquot;: 1, quot;bquot;: 2}     if quot;bquot; in d:         print d[quot;bquot;]
  11. 11. pylint Global evaluation ­­­­­­­­­­­­­­­­­ Your code has been rated at  4.15/10
  12. 12. 640 Kb ought to be enough for anyone http://www.flickr.com/photos/esparta/187132368/in/set-72157594187689069/
  13. 13. Measuring programming progress by lines of code is like measuring aircraft building progress by weight http://www.flickr.com/photos/esparta/187132368/in/set-72157594187689069/
  14. 14. Controlling complexity is the essence of computer programming Brian Kernighan
  15. 15. Refactoring A change made to the internal structure of the software to make it easier to understand and cheaper to modify without changing its observable behavior Martin Fowler
  16. 16. Code coverage reports considered dangerous?
  17. 17. http://flickr.com/photos/editor/90242221/
  18. 18. UQDS
  19. 19. Questions?
  20. 20. Thanks
  21. 21. Simplicity is prerequisite for reliability Edsger W. Dijkstra

×