Re: private, protected, readonly, public

From: Date: Fri, 12 May 2006 21:14:40 +0000
Subject: Re: private, protected, readonly, public
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
Etienne Kneuss wrote:
Yes, I also consider the visibility as a candy functionality.
Etienne Kneuss wrote:
    
2) It only requires a bit of discipline, not to edit the properties you
want to be readonly.
      
well, then we don't need private/protected/public at all,
as it only requires a bit of discipline not to access the properties you want to be visible to the class or its children only?
    
It's only candy functionality when you're not in a position of possibly having to hand the application you've written over to a bunch of developers you don't know, who probably won't read the docs and will do things the wrong way. Having visibility in this case really, really helps - and more than anything, it covers my back when they screw up. Yeah, if all you're writing is small apps, you're not going to have an issue - or if you're only using a handful of developers, it won't be an issue, but it's a very good thing when the future development cycle of a product isn't clear.

Thread (92 messages)

« previous php.internals (#23320) next »