On Wed, 2008-04-30 at 09:39 -0600, Nathan Nobbe wrote:
> 
> so really, all we would get is a group of member variables we know
> would be there...

No, you know nothing about the existence of properties when using
getters and setters. Just because you have getColour() and setColour()
in no way implies you have $this->colour

> wow, that seems pretty pointless to me.

It would seem it does. Wrapping all my properties in redundant
getter/setter methods often seems pointless to me and a whole slew of
other people.

> and in the case of the setter, the client doesnt know about the logic
> behind the call, so the fact is supplying 3.14 may not result in 3.14
> actually getting set.

You're presuming logic. I'm not. I just want to get/set the property
without invoking a function call. If properties didn't have their uses,
then you wouldn't be able to access them from the object. Since I'm not
forced to use a getter/setter method, then it follows that properties
were designed to be accessed and not necessarily wrapped in a method for
retrieval and setting.

>   this is why setter methods are import, per my previous statements. 

Important for some. You once again, with all your hand flapping, assume
we want some kind of operation on the data. If we do not, and this
happens a lot, then we're just wasting cycles... and order of magnitude
more cycles.

>  i do not consider adding data 'after declaring properties' in
> interfaces equivalent to supplying an implementation for the method,
> because php is not strongly typed, therefore no class will ever be
> able to control what sort of data is set on the properties.  that is
> the entire problem with your proposition.

Ummm, this functionality already exists. Your argument neglects to
consider that objects already exist where the properties can be directly
accessed and set. Your argument assumes a need to "manage" the data
being assigned. Your argument assumes the data wasn't already "managed"
by the assigner of the data. You assume a lot, and yet we all know in
practice there are many, many, MANY implementations of classes where the
properties are directly exposed. This may not be something YOU like, but
it is what many others like. Some people still care about efficient code
versus the flexibility of meeting a demand that may never arise.

> i have to work today, and im sure people are getting sick of my
> bickering, but truthfully, i would like to know why interfaces were
> added to php in the first place?  where, if any place, did they take
> inspiration from, java, c++, neither ?  i only ask because im dying to
> know and we're on the topic..

Create a new thread. You rider question isn't relevant to this thread.

Cheers,
Rob.

-- 
http://www.interjinn.com
Application and Templating Framework for PHP


-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to