PHPNews

"Iterating over a list and filtering" OR "Iterating over a filtered list"

Written by Corey Haines - Published on Corey Haines
Aggregated on Sunday September 22, 2013 - Permalink

Noticing a pattern The other day, I was working on some list-processing code. The system was serializing a set of commands to send to another server for further execution. Only a subset of the commands needed to be sent, so each serialization routine was responsible for filtering its child objects. I noticed an interesting pattern around the filtering, and I started thinking. Processing a …

Continue reading »


Thoughts on the symmetry between good test names and your object's API

Written by Corey Haines - Published on Corey Haines
Aggregated on Thursday March 6, 2014 - Permalink

While running coderetreats , I have the opportunity to see a lot of people working on Conway's Game of Life . As we go through the day, I make comments about design, both in the large and in the small. Over the years, I've seen similar patterns pop up across many different developers. This article is one of those ideas that has come up over the years. One of the 4 Rules of Simple Design is …

Continue reading »


Some thoughts on pair-programming styles

Written by Corey Haines - Published on Corey Haines
Aggregated on Sunday March 16, 2014 - Permalink

Over the past 10 years of practicing extreme programming, I've done a lot of pairing; I've worked in traditional pairing styles, and I've written code with people in less-traditional places. I've worked with folks who have been pairing much longer than I have, and other who had never written code like this before. And over the past 5 years of facilitating coderetreat workshops, I've watched a …

Continue reading »


Understanding the 4 Rules of Simple Design - My Book

Written by Corey Haines - Published on Corey Haines
Aggregated on Sunday April 6, 2014 - Permalink

So, I wrote a book called Understanding the 4 Rules of Simple Design ! Huzzah! It has been a long time coming, for sure. Here's a bit more information about it, as well as some feedback from readers. I've also created a free downloadable sample to get a taste of it. I'm donating 10% of the profits to support kids-oriented programming events. I already have funds earmarked to support a …

Continue reading »


We don't (always) need no stinkin' testing framework

Written by Corey Haines - Published on Corey Haines
Aggregated on Sunday April 20, 2014 - Permalink

So much setup So, for some crazy reason, I like writing small collection implementations. I don't worry too much about performance, I'm just writing them as small exercises when I want to write something. Because of their size and fairly straight-forward(haha) requirements, I can use them to experiment with how I write tests. But, often I find setting up a testing framework to feel so …

Continue reading »


Speeding Up ActiveRecord Tests

Written by Corey Haines - Published on Corey Haines
Aggregated on Sunday May 4, 2014 - Permalink

It is no secret that I'm a huge proponent of fast tests and their contribution to effective testing and design techniques. When doing any form of test-first development, the length of the feedback cycle when running individual tests should be as fast as possible. The design techniques associated with test-driven development (TDD), in particular, rely on taking small steps, teasing out design …

Continue reading »