PHP5 and Questioning OOP
11th April 2003
An Interview with Sterling Hughes on PHP5 from the PHP-Con site:
Personally, while I have programmed with both C++ and Java, I am mostly a procedural guy. I feel that most object oriented programming consists of abstracting different problems into the same problem and then resolving that problem. Sure it makes it easier, but its incredibly inefficient for developing a small set of interconnected programs, which really is the whole point in web development.
That’s not to say I’m unhappy with PHP5. Most of the stuff in PHP5 is great, most notably exceptions; I’ll certainly be taking advantage of many of the new features in Zend Engine 2. But most of my code is procedural, and Zend Engine 2 is mostly an object oriented functionality upgrade.
That’s the second time this week I’ve come across an opinion that questions the benefits of the OOP-at-all-costs approach to programming. The first was in Paul Graham’s The Hundred Year Language:
Somehow the idea of reusability got attached to object-oriented programming in the 1980s, and no amount of evidence to the contrary seems to be able to shake it free. But although some object-oriented software is reusable, what makes it reusable is its bottom-upness, not its object-orientedness. Consider libraries: they’re reusable because they’re language, whether they’re written in an object-oriented style or not.
I don’t predict the demise of object-oriented programming, by the way. Though I don’t think it has much to offer good programmers, except in certain specialized domains, it is irresistible to large organizations. Object-oriented programming offers a sustainable way to write spaghetti code. It lets you accrete programs as a series of patches. Large organizations always tend to develop software this way, and I expect this to be as true in a hundred years as it is today.
As undergraduates, we have been exposed to the joys of object oriented programming from our first week at Uni, possible because we’re supposedly destined for the large organisations Paul mentions. It’s nice to see the view from the other side of the fence for a change.
More recent articles
- Weeknotes: more datasette-secrets, plus a mystery video project - 7th May 2024
- Weeknotes: Llama 3, AI for Data Journalism, llm-evals and datasette-secrets - 23rd April 2024
- Options for accessing Llama 3 from the terminal using LLM - 22nd April 2024
- AI for Data Journalism: demonstrating what we can do with this stuff right now - 17th April 2024
- Three major LLM releases in 24 hours (plus weeknotes) - 10th April 2024
- Building files-to-prompt entirely using Claude 3 Opus - 8th April 2024
- Running OCR against PDFs and images directly in your browser - 30th March 2024
- llm cmd undo last git commit - a new plugin for LLM - 26th March 2024
- Building and testing C extensions for SQLite with ChatGPT Code Interpreter - 23rd March 2024
- Claude and ChatGPT for ad-hoc sidequests - 22nd March 2024