Topic on Manual talk:Coding conventions

Deprecate private variables and methods?

4
Peachey88 (Flood) (talkcontribs)
Peachey88 (Flood) (talkcontribs)

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.

This post was posted by Peachey88 (Flood), but signed as MaxSem.

Peachey88 (Flood) (talkcontribs)

Protected seems preferable, for extensibility purposes.

This post was posted by Peachey88 (Flood), but signed as Tisane.

Peachey88 (Flood) (talkcontribs)

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.

This post was posted by Peachey88 (Flood), but signed as ^demon.