Rules to live by
# Write specs before coding
# Do the simplest thing that works
# Refactor early and often
REST and BDD
One of the challenges facing any developer is keeping current with modern methodologies. This is especially so with Ruby on Rails, whose practitioners are probably more open-minded than most when it comes to adopting new ideas that work.
Two practices which have now entered the Rails mainstream are REST and BDD.
REST, which stands for Representational State Transfer, is the use of URLs to represent unique conceptual resources, which are accessible as physical representations through content type negotiation (from http://safari.oreilly.com/9780321501745). That might sound like a mouthful, but the net result is a simplification of how to interact with applications.
BDD is Behaviour Driven Development. BDD is a logical next step from TDD (Test Driven Development). BDD switches the paradigm from one of testing the code you’ve written (or are about to write), to a language of description and specification. Instead of writing tests, we write specifications. The benefit of this is firstly that specs are a more logical thing do be doing before you start coding, and secondly that the language used to describe a specification is far more readable and understandable than the language used in tests.
Unfortunately with both concepts being relatively new, there’s not a lot out there describing the practice of using these techniques. REST seems to get at most a chapter or two in the crop of current books. BDD hasn’t even made it to a printed book yet.
So these are the resources we’ve found to get ourselves up-to-speed…
BDD:
- http://dannorth.net/introducing-bdd
- http://behaviour-driven.org/
- http://video.google.com/videoplay?docid=8135690990081075324
- http://www.oreillynet.com/pub/a/ruby/2007/08/09/…
- http://peepcode.com/products/rspec-basics
REST:
- http://peepcode.com/products/restful-rails
- http://www.b-simple.de/documents
- http://safari.oreilly.com/9780321501745
I hope some of those are useful for anyone trying to learn this stuff.