Re: ASP.NET VS PHP OOP

From: Andy Harris (aharris_at_cs.iupui.edu)
Date: 04/05/04


Date: 5 Apr 2004 11:26:26 -0700

This is a PHP board, so expect a biased response. However, I've
played with both environments (in fact written books on both) so I
feel somewhat comfortable wading into this minefield.

Tiger Woods carries a whole bagfull of clubs (Ok, his caddy does)
because each club does a different job well. Professional contract
programmers are allowed to have favorite languages, but my current
favorite language is the one paying my bills.

What makes a particular application object oriented or not is really
the programmer and the design of the algorithms, not simply the
language. Some languages (did I hear 'Java?') require you to think in
an OOP format, so you don't get the choice to be procedural. Some
environments do not offer any possibility of OOP. Other environments,
including .NET and PHP, allow you to choose. For a lot of simpler
programs, the overhead of designing in an OOP format isn't worth the
software engineering payoff, because there simply won't be that much
formal software engineering on simple one-programmer jobs.

For certain kinds of problems, especially those requiring multiple
programmers and a complex object hierarchy, OOP makes a lot of sense.
Of course, the .NET framework itself is exactly that sort of complex
hierarchy, so if you're working in .NET, you're using OOP whether your
own code is OOP-based or not.

Strangely enough, because C#.NET and VB.NET use the same .NET OOP
framework, programming in these two langauges is 90% identical.
However, you'll see that VB.NET programmers (who usually come from a
VB6 background) tend to write code that's object based, and not as
strictly OOP, where C# programmers (who often come from a Java
background) write almost the same code with the stricter Java
stylings.

Having said all this, PHP is one of my favorite languages, because I
can decide how formal I want to get. I frankly don't use a lot of OOP
stuff in my PHP work because I don't need it and it doesn't save me a
lot of time. I'm glad to be using a language that gives me the
flexibility to choose.

As for speed, I think the comparisons are a bit spurious. Certainly a
compiled (or half-compiled) language will be faster than an
interpreted one. However, it's important to recognize that it's no
longer 1964, nor are client-server programs frequently called upon to
do 3D rendering or other computationally intensive work. The economy
of client/server programs is actually in _development time_ more than
_processor time_. An environment that creates less efficient code but
more efficient programmers can be very desirable.

Nor is it 1990. While the execution speed of a server-side app
matters, the delay caused waiting for the program to execute is
minimal compared to the potential communication bottlenecks inherent
in the n-tiered design strategy.You can often get a lot more bang for
the buck improving the communication aspects than worrying about your
execution time.

So I'm ok with somebody suggesting that PHP isn't truly OOP. It
doesn't MAKE me think in an OOP style, but provides (finally) a good
enough implementation of OOP that I can go there if I want to.

and - It's pretty easy to write
and - I don't have to buy lots of stuff from MS to work it
and - It really works on multiple platforms
and - It's free

-just my thoughts...



Relevant Pages

  • Re: Case sensitivity in programming languages.
    ... the language. ... And these conventions take advantage of case sensitivity. ... In PHP it can be any of those things. ... group of programmers who want t force their stupid ideas onto others. ...
    (comp.lang.php)
  • Re: ASP.NET VS PHP OOP
    ... This is a PHP board, ... favorite language is the one paying my bills. ... an OOP format, so you don't get the choice to be procedural. ... programmers and a complex object hierarchy, OOP makes a lot of sense. ...
    (comp.lang.php)
  • Re: Breaking backwards compatibility - good or bad?
    ... but in the case of a computer language, these two qualities are often intrinsically related to the semantics, structure and useability, and so can't be ignored. ... Ignoring them is what led to PHP 4. ... of programmers out there who are used to OO features in more "structured" languages, but laughed at PHP 4's attempt at OO, and still laugh at the mish-mash nonsense of inconsistency that litters PHP 5. ... The support and interest of professional software developers is crucial ...
    (comp.lang.php)
  • Re: [PHP] PHP4 vs PHP5 Performance?
    ... C is a low-level language whereas php is a high level language. ... i am biased toward oop / design patterns. ... Migrate doesn't necessarily mean ditching PHP4 compatibility. ...
    (php.general)
  • Re: Learning PHP
    ... php to be so natural that everything flows like a simple script. ... For most of you advanced programmers out there. ... Whenever I am working on code I always have php.net open in the background for reference. ... I have developed a 'natural' feel for the structure and syntax of the language and I know of most of its capabilities and what I can and can't do with the language, but I have not memorized or learned all the language references. ...
    (comp.lang.php)