Deprecate private variables and methods?

Jump to: navigation, search

Shall we deprecate private variables and methods? They seem evil, since they make it more cumbersome to extend classes.

Tisane 08:08, 8 July 2010 (UTC)07:10, 5 December 2011

We're actually trying to use them in new code because they help in separating abstractions and give us better better control over proper interfaces to access data. You can't force people to uses accessor methods if they still can access class variables directly. Unfortunately, due to PHP's low entry requirements, many PHP programmers know nothing about proper OOP/OOD and produce such opuses instead.

Max Semenik 10:02, 8 July 2010 (UTC)07:10, 5 December 2011

Protected seems preferable, for extensibility purposes.

Tisane 16:15, 8 July 2010 (UTC)07:10, 5 December 2011

It depends. Public, private and protected all have their places. Some times you want something private because you /don't/ want subclasses to be able to change the implementation.

^demon07:11, 5 December 2011