There was much discussion on Twitter about the concepts of using “final” and “private” in objects, and what exactly the best practices are. The conversation seemed to boil down to three distinct questions:
- Should an object be open for extension, and expose its internals for that purpose?
- Does exposure of those internals create a de facto contract with children for their behavior?
- Should software only be used as intended by its designers, or should it be modified, extended and changed by the end user to fit certain, specific goals?
Every two weeks I send out a newsletter containing lots of interesting stuff for the modern PHP developer. You can expect quick tips, links to interesting tutorials, opinions and packages. Want to learn the cool stuff? Then sign up now!