Programming with
Dynamic Confidence
Matt Harrison
matthewharrison@gmail.com
http://panela.blog-city.com/
OSCON July 26, 2007
Confessions
Read only
Ask Question
Committers Buggers
Patchers
http://www.flickr.com/photos/flikr/45457114/in/photostream/
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
● ●
Less is more
Smaller == ?
Easier to read
●
●Less bugs
●Less time
●Easier to change
●Time for fun things
●Less testing
●Less to review
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
http://www.flickr.com/photos/hypowren/523594838/
pep8.py
#python pep8.py showpep8 SQLAlchemy0.3.7
py2.4.egg/sqlalchemy/sql.py
...
SQLAlchemy0.3.7py2.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 = {\"a\": 1, \"b\": 2}
if \"b\" in d:
print d[\"b\"]
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.flickr.com/photos/esparta/187132368/in/set-72157594187689069/
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 to modify without
changing its observable
behavior
Martin Fowler
Code coverage
reports
considered dangerous?
http://flickr.com/photos/editor/90242221/
UQDS
Questions?
Thanks
Simplicity is prerequisite for
reliability
Edsger W. Dijkstra
0 comments
Post a comment