This is a rebuttal post to comments posted Private Methods Considered Harmful
I do not wholeheartedly believe that private methods are evil, or that they were mistakenly included in the PHP language by the core development team. Nor do I believe that there are only two true options when it comes to devising visibility requirements: public and protected. There is a place for private methods, in PHP development and elsewhere.
Tuesday, December 11th, 2012 @ 10:33 am |
Comment (3) |
Categories: Best Practices, Object-Oriented Development
Tags: php best practice, OOP, object oriented programming, software, object oriented development, private, protected, public, visibility, PHP, php programming
The following is an excerpt from a draft version of Do This, Not That: Object Oriented Development. Sign up today to be the first to get a copy this week!
A few weeks ago, I was tasked with integrating a library that was designed by someone else. This library was intended to access APIs and return the data so that it could be used by my application. This seemed straightforward enough, except that the API I was working with had a few quirks, namely that it interpreted the query string directly, and so it was possible to have a query string similar to this:
Monday, December 10th, 2012 @ 6:00 am |
Comment (14) |
Categories: Software Development, Best Practices, Object-Oriented Development
Tags: book, object, method, private method, protected method, object oriented development, PHP, do this not that, development, library, library development