From: Ron Jeffries Date: 2001-12-11T22:22:58+09:00 Subject: [ruby-talk:28210] Re: John Roth dolt ( Re: A challenge to proponents of Unit Testing. ) On 11 Dec 2001 02:39:53 -0800, sureshvv@hotmail.com (suresh vv) wrote: >> The intent was to return a 1 for equilateral, 2 for isoceles, and 3 >> for scalene. Representing the triangle was not part of the job. >> > >Sounds like a cop out. You forgot/ignored the "triangle" part of the problem >and just dealt with 3 numbers, returning the number of unique numbers. > >There is a lesson in there somwhere for what happens when you >get away from the "real world". One of the things we often forget in our zeal to be object oriented is that the problem is best solved by the most appropriate abstraction. If the problem is to identify whether a triangle is equilateral, isoceles, or scalene, it is ONLY the values of the lengths of the sides that matters. Therefore a collection of three numbers is very likely the right abstraction. Just my opinion, of course ... Ronald E Jeffries http://www.XProgramming.com http://www.objectmentor.com