From: James Edward Gray II Date: 2006-11-15T23:54:30+09:00 Subject: Re: [QUIZ] VCR Program Manager (#101) On Nov 13, 2006, at 5:56 PM, Jamie Macey wrote: > Rule of the day was the simplest thing that could possibly work. As > such, I didn't feel the need to split the logic out into a separate > Program class, but I kept two arrays of prospective programs - one for > recurring and one for one-shot. When I was new from to Ruby, from Perl, I use to think those ad hoc data structures were "the simplest thing" too. With a fair amount of Ruby experience now, I'm not so sure though. For example, have a look at Dale Martenson's solution, which is very close to your own in size. Dale used a Program class. In fact, Program could be as simple as: Program = Struct.new(:start_time, :end_time, :channel, :days) Then add could be: class ProgramManager def add(program_details) @programs << Program.new( *program_details.values_at(:start, :end, :channel, :days) ) end end I'm not saying anything about your solution here. Just thinking out loud in hopes of inspiring discussion... ;) James Edward Gray II