PHPNews

Breaking Up the Behemoth

Written by Blog - Sandi Metz - Published on Blog - Sandi Metz
Aggregated on Wednesday September 13, 2017 - Permalink

Good Morning, I've been thinking about how applications evolve, and what we might do if we're unhappy with the results. Three apparently unrelated ideas have been percolating in my head. In this newsletter I'll introduce each one and connect them together, in hopes that understanding these connections will help us understand our apps. These thoughts are very definitely my opinion, …

Continue reading »


Why We Argue: Style

Written by Blog - Sandi Metz - Published on Blog - Sandi Metz
Aggregated on Tuesday July 18, 2017 - Permalink

This post originally appeared in my Chainline Newsletter . I've been thinking about why we argue about code, and how we might transform vehement differences of opinion into active forces for good. My thoughts spring from a very specific context. Ten or twelve times a year I go to an arbitrary business and spend three or more days teaching a course in object-oriented design. I'm an …

Continue reading »


The Half-Life of Code

Written by Blog - Sandi Metz - Published on Blog - Sandi Metz
Aggregated on Thursday June 1, 2017 - Permalink

This post originally appeared in my Chainline Newsletter . I've been thinking about the half-life of code. In his Software that Fits in Your Head talk, Dan North defines the half-life of software as (I'm paraphrasing) "the amount of time required for half of an application's code to change so much that it becomes unrecognizable." In that talk he tells the story of working on a high …

Continue reading »


SOLID Design Principles - Dependency Injection

Written by Blog - Sandi Metz - Published on Blog - Sandi Metz
Aggregated on Saturday March 21, 2009 - Permalink

Not as Painful as it sounds… Nothing is more pleasing than beautiful code. And nothing is more heart-breaking than watching beautiful code get destroyed. Lately, I’ve been paying particular attention to SOLID Object Oriented Design (OOD) principles and their interaction with TDD. I’m finding that, while TDD is an essential first step, it just isn’t enough. If I want my code to survive …

Continue reading »


Ruby Case Statements and `kind_of?`

Written by Blog - Sandi Metz - Published on Blog - Sandi Metz
Aggregated on Friday June 12, 2009 - Permalink

You’re an object – Stand up straight and act like one! Imagine you have this code: Code 1: class MyView attr_reader :target def initialize(target) @target = target end def double case target when Numeric then target * 2 when String then target.next # lazy example fail when Array then target.collect {|o| MyView.new(o).double} else …

Continue reading »


How Shall We Define Design?

Written by Blog - Sandi Metz - Published on Blog - Sandi Metz
Aggregated on Thursday July 5, 2012 - Permalink

I love object-oriented design. It’s like open source software in general; perfect strangers come up with ideas that can save me time and money and then, out of the goodness of their hearts, go to a fair amount of trouble to pass these ideas on. I benefit from their efforts every day. However, you don’t have to go far to find competent, thoughtful, well-intentioned folks who curse and spit …

Continue reading »