Fwd: Fw: PHP question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---------- Forwarded message ----------
From: As'ad Djamalilleil <asad.kom@xxxxxxxxx>
Date: Fri, Aug 29, 2014 at 8:18 PM
Subject: Re:  Fw: PHP question
To: Andy McKenzie <amckenzie4@xxxxxxxxx>


imho, it depends on how big the program you would develop and for what
purpose (bussiness or scientific), but most market don't care how you do
it, procedural or OOP way, as long as it effectives.


On Thu, Aug 28, 2014 at 8:07 PM, Andy McKenzie <amckenzie4@xxxxxxxxx> wrote:

> On Tue, Aug 26, 2014 at 6:53 AM, Baber <baber_abbasi@xxxxxxxxxxx> wrote:
>
> > Hi
> >
> >
> >
> > Apologies if I have sent email to the wrong address.
> >
> > I have a very simple question regarding PHP i.e
> >
> > Does coding in PHP in procedural way (not object oriented) is still
> market
> > standard and not obselete?
> >
> > Many thanks,
> >
> > ---------------
> > Baber
> > baber_abbasi@xxxxxxxxxxx
>
>
> I think the answer is that you need to know and use both.  There are times
> when object oriented makes a lot of sense:  when writing an inventory tool
> that needs to track the attributes of a lot of physical objects, treating
> them as data objects works really cleanly, and makes the program much
> easier to read.  In my view, that's arguably the biggest advantage of
> object oriented code:  it's frequently much more readable.
>
> On the other hand, I've seen a script meant to move a couple of files to a
> new location where the author decided to do everything object oriented, and
> spent forty or fifty lines defining classes for the files and folders they
> needed.  That was, in all honesty, kind of dumb, since I rewrote it as
> about a fifteen line procedural script.  It ran faster and with less
> resources required, and probably took a tenth of the time to write.
> (Nevermind that PHP isn't really a fantastic choice for command line work
> anyway, and writing a one-liner to call a perl script probably would have
> been a lot better...)
>
> Basically, both approaches have uses, and if you only learn one, or decide
> that one is always universally better, you'll be making your life harder
> than it needs to be at least some of the time.
>
> Andy McKenzie
>

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux