Saturday, March 3, 2012

Personal (and non-popular) Rails development rules of thumb

  • View first, then Controller and Model last.
  • In Controller tests:
    • Don't mock ActiveRecord method
    • Do stub ActiveRecord method (No real SQL execution allowed)
    • Do mock custom model method
    • Use signature from model mock to create real method in model (or module)
    • Should not contain more than 5 lines or 10 function calls
  • In Model tests:
    • Do real SQL execution (No mock, no stub)

Clojure has lesser typing error problems than the others well-known dynamic typing languages

Give these snippets a try. // JS function foo () {   bar(1) } # Ruby def foo   bar(1) end ; Clojure (defn foo []    (bar 1)) As yo...