{{{ Recently I sat in a job interview, we were TDDing a data structure. That was fun, but it turned out that one big minus for me was that *I insisted on testing a private method*. I still believe that when writing a class that’s reused in multiple places (maybe as a gem) you have… Continue reading Private Methods: To Test or Not To Test?
Tag: ruby
Are Class Methods Evil?
{{{ Two things I like in programming: *Object instances and abandoning global things.* I especially “appreciate any DCI effort”:http://andrzejonsoftware.blogspot.com/2011/02/dci-and-rails.html in the community helping us getting away from classes back to thinking about objects and clean responsibilities. In order to explain my thoughts about DCI, here’s a first post about class methods, which seem to be… Continue reading Are Class Methods Evil?
Hooks and callbacks for Ruby. But simple.
Callbacks are executable things, like a Proc or methods in Ruby, whereas a hook is usually a spot in your code where you want to execute a certain subset of callbacks. Or, precisely, callbacks that are associated to the hook. I have lots of these places throughout my libraries, and after playing around with ActiveSupport::Callbacks… Continue reading Hooks and callbacks for Ruby. But simple.