Re: OOP versus Procedural/Functional [message #177668 is a reply to message #177663] |
Thu, 12 April 2012 17:18 |
Jerry Stuckle
Messages: 2598 Registered: September 2010
Karma:
|
Senior Member |
|
|
On 4/12/2012 11:33 AM, M. Strobel wrote:
> Am 12.04.2012 13:56, schrieb crankypuss:
>> On 04/11/2012 11:09 AM, M. Strobel wrote:
>>> Am 11.04.2012 13:16, schrieb crankypuss:
>>>> On 04/09/2012 01:35 PM, Mr. B-o-B wrote:
>>>> > I was curious about peoples thoughts in regards to OOP with PHP.
>>>> >
>>>> > Are there pro's/con's of writing OOP code versus procedural/functional
>>>> > coding?
>>>> >
>>>> > Strictly speaking for PHP, I do the bulk of my coding as
>>>> > procedural/functional. I really haven't found any added benefit to going
>>>> > the OOP route.
>>>> >
>>>> > Am I missing something, or is it just a different approach to the same
>>>> > problem?
>>>>
>>>> OOP is basically a good idea carried to an extreme.
>>>>
>>>> There is a boatload of value in the concept of inheritance, but that's largely
>>>> negated by the mechanics of how inheritance is done in OOP languages.
>>>>
>>>> Polymorphism is something that's more in the eye of the programmer than in the
>>>> language, data constructs can be specific or generalized.
>>>>
>>>> The idea that making something into an object gives it superior robustness is a joke
>>>> if you can step back and look at it.
>>>>
>>>> I remember writing a Java application and trying to derive an actually useful string
>>>> class from the garbage they had declared "final" and that was it for me and Java. I
>>>> cannot begin to count the times when I've had to hoke up an object pointer to use
>>>> some simple processing method that was part of a C++ class.
>>>>
>>>> Of course that's all personal opinion. I avoid all OOP constructs in PHP wherever I
>>>> can, the more closely I can make it resemble C the easier it will be to convert it
>>>> when the time comes. There is one exception to that in my code, one of the zip
>>>> functionalities is only supported through some objects... that stuff is encapsulated
>>>> in a subroutine.
>>>>
>>>> Since I value inheritance I've build myself a layered methodology that lets me
>>>> override various functions by adding or inserting different layers at runtime.
>>>>
>>>> Perhaps the nicest thing about programming is that it puts the lie to religious
>>>> adherences... as one of my college instructors put it, "if your program works for all
>>>> cases it is by definition correct".
>>>
>>> Second phrase could have been "But there are many more aspects of software quality".
>>>
>>> /Str.
>>
>> Sure, and if he'd really wanted his students prepared for the real world he'd have
>> said something about quality being meaningless in the face of profit, so what?
>
> Ignoring good advice, "state of the art", "best practices" isn't something to teach.
> It happens.
>
> And quality is not completely meaningless if the customer can have a look at the code
> and see what he is paying for.
>
> /Str.
They ARE things which should be included in every course. We do it in
ours - which is one reason corporations like us.
Corporations are interested in quality. Support costs are a major expense.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
|
|
|