5 best practices for (web/ software) development (2010)
DESCRIPTION
Some of the best practices we've acquired while developing for the web! A presentation for students Communication and Multimedia Design at Noordelijke Hogeschool Leeuwarden in their Discover Web2.0 lecture series.TRANSCRIPT
5 BEST PRACTICES FOR DEVELOPMENT
5 best practices for (web/ software) development
ERWIN ELLING
@erwinelling
“passionate web versatilist”
5 BEST PRACTICES
1:MODEL VIEW
CONTROLLER
http://www.flickr.com/photos/wardofsky/2350781947/
we use the django framework (for python)
there’s also rails (for ruby)
and e.g. cakephp (for php)also other frameworks (non-MVC) save lots of time: ARP (for flash), jquery & prototype (for javascript), ...trend towards more and more abstraction and more human readable code
models
url dispatcher
controllers (called views in django; django prefers to call their framework: MTV)
view (template in django)
2: DO NOTREINVENTTHE WHEEL
http://www.flickr.com/photos/european_patent_office/3364865051
reuse the stuff that’s readily available
DJANGOSNIPPETS
django pluggables for code
google groups for help
do not develop it yourself when it’s already available: ning
wordpress
again frameworks: pinax, framework (combination of apss) on top of django
used pinax for jijmaaktgeschiedenis.nuwanted to add twitter...
someone else had done most of the work for me
hardly had to code myself: just added this; easy
3: DEVELOPMENT INFRASTRUCTURE & VERSION
CONTROL
http://www.flickr.com/photos/11397615@N00/3306159672/
different environments in your infrastructureDevelopment, Test, Acceptance, ProductionIn Dutch OTAP: Ontwikkel, Test, Acceptatie, Productie
http://www.flickr.com/photos/parsingphase/3294364709/version control, e.g. SVN, git, mercurial
blame someone for mistakes! oops, i did it again
let the person who makes mistakes pay for the team’s beers!
4: AUTOMATEhttp://www.flickr.com/photos/denis_fox/3537539725/
think about how many repetitive tasks you perform!
this doesn’t look as much work, but i made some faults and have to do this 10 times a daynow i can do this with one command!
use shortcuts for repeatable tasks
capistrano (in ruby)e.g. for automating deployment and testingrollbacks when things go wrong
buildout, in python
automation is good for avoiding problems. letting people fool around while sudo’ing is dangerous
e.g. sudo rm -rfoops!
5: CLEAN CODE
http://www.flickr.com/photos/ezu/277341190/costs some time at first, saves lots of time later
comments
refactor, refactor, refactorno todo’s in codeget rid of ugly stuffno hacks to “solve” problems
how many fucks in google code?
DRY
http://www.flickr.com/photos/plinton/21543765220Don’tRepeatYourself
fat models, skinny controllers
pair programming, code reviews, read other’s code