Re: [Newbies] Are setters a good idea?

2008-09-28 Thread Blake
On Sat, 27 Sep 2008 20:47:39 -0700, Ralph Johnson [EMAIL PROTECTED] wrote: On Sat, Sep 27, 2008 at 1:40 PM, Andy Burnett [EMAIL PROTECTED] wrote: I read somewhere - can't remember where - that setters are considered evil. This is not a good argument. Many Smalltalk objects are not

Re: [Newbies] Are setters a good idea?

2008-09-28 Thread Blake
On Sun, 28 Sep 2008 13:27:52 -0700, Blake [EMAIL PROTECTED] wrote: If you're going to assign an action verb to a setter, it should be reflective of the process. donut := Donut makePlain. donut ice: #chocolate. donut addSprinkles: jimmies atRandom. Looking at this again, it doesn't seem

Re: [Newbies] Are setters a good idea?

2008-09-28 Thread K. K. Subramaniam
On Sunday 28 Sep 2008 12:10:37 am Andy Burnett wrote: I read somewhere - can't remember where - that setters are considered evil. The argument was that in the real world you can't suddenly change the colour of a car, just by settings its colour value. Instead, you have to perform some action,

[Newbies] Are setters a good idea?

2008-09-27 Thread Andy Burnett
I read somewhere - can't remember where - that setters are considered evil. The argument was that in the real world you can't suddenly change the colour of a car, just by settings its colour value. Instead, you have to perform some action, e.g. sprayPaintCar: aColour. Therefore in the OO world,

Re: [Newbies] Are setters a good idea?

2008-09-27 Thread Marcin Tustin
The short answer is that you are exposing the internals of the object. If you have an object that is just a packet of values, great. If you have an object that will always have e.g. a colour, then possibly great, or possibly not depending on the domain. On Sat, Sep 27, 2008 at 7:40 PM, Andy

Re: [Newbies] Are setters a good idea?

2008-09-27 Thread Ralph Johnson
On Sat, Sep 27, 2008 at 1:40 PM, Andy Burnett [EMAIL PROTECTED] wrote: I read somewhere - can't remember where - that setters are considered evil. The argument was that in the real world you can't suddenly change the colour of a car, just by settings its colour value. Instead, you have to