PHPNews

Repository Pattern In Rails

Written by Matt Briggs - Published on Matt Briggs
Aggregated on Thursday February 23, 2012 - Permalink

I have been working a lot on an app using MongoDB as the datastore, and Mongoid as the OR/M (or ODM to be more specific). In a relational database, you keep your data as segregated as reasonably possible, and then join it together in appropriate ways when you need it. The up side to this is that it is incredibly flexible, and chances are you wont hit a situation where you need your data in a form …

Continue reading »


Awesome Emacs Plugins: Evil Mode

Written by Matt Briggs - Published on Matt Briggs
Aggregated on Monday February 27, 2012 - Permalink

I want to do a series of posts on some of the cool emacs plugins I use. Before I do that though, I want to talk a bit about why I use and love emacs. The saying “Care about the code, not the tools” is an anathama to me, it is like “Care about breathing, but don’t worry about drinking”. Breathing is incredibly important, I agree, but consuming liquid regularily is pretty high up there on the list …

Continue reading »


Why I like Object#tap

Written by Matt Briggs - Published on Matt Briggs
Aggregated on Thursday March 8, 2012 - Permalink

In a recent Destroy All Software screencast, Gary mentioned how he really doesn’t like Object#tap . He was using it in this sort of context 1 2 3 4 5 6 7 8 9 10 class StoreCache def self.for_term(term) begin CachedScore.for_term(term) rescue CachedScore::NoScore RockScore.for_term(term).tap do |score| CachedScore.save_score(term, score) end end end …

Continue reading »


Awesome Emacs Plugins: CTags

Written by Matt Briggs - Published on Matt Briggs
Aggregated on Sunday March 18, 2012 - Permalink

I wanted to write a series of posts on awesome emacs plugins I use, since I have put a lot of time and effort into my emacs configs . The funny thing I find about emacs though is that there is such a massive amount of functionality already provided, most neat things plugins do is augment stuff that is already there. So I think most of these posts are going to be a third about emacs, a third …

Continue reading »


The Many Faces of Ruby Callables

Written by Matt Briggs - Published on Matt Briggs
Aggregated on Saturday May 5, 2012 - Permalink

One of the most valuable ideas from functional programming is the idea of Higher Order Functions , or functions that take functions as an argument. It is such a good idea that it has become part of pretty much every modern language, whether functional or not. Amoung the OO imperative languages that have embraced this idea, the ruby community has probably gone the furthest, where it is the first …

Continue reading »


Mixins are not always a refactoring anti-pattern

Written by Matt Briggs - Published on Matt Briggs
Aggregated on Monday May 7, 2012 - Permalink

Steve Klabnik just posted an interesting post about mixins . Steve is a really smart guy, and I usually agree with him, but I think his justification is a little bit weak in this case. Mixin Refactoring through Class Gutting Oh man, he is so right that this is an anti-pattern. It happens a lot in ruby, someone says “Hey, this thing is doing too much. The only method of code reuse I really …

Continue reading »