[KLUG Members] PHP vs ASP

members@kalamazoolinux.org members@kalamazoolinux.org
Mon, 11 Nov 2002 16:03:01 -0500


>a)  Variable scoping.
. . .
>PHP's just goofy -- but in a somewhat good way.  You have global variables,
>but to access them have to pull them into scope with the 'global' keyword
>when in functions.  That's kind of nice, when you're working on a team of
>people who don't know -NOT- to pollute the global namespace, but when you're
>working on a team of sane individuals it's more of a nuisance. 

Globals bad.  PHP's pass-by-reference is also very nice, particularly when using
objects. 

>b)  Data types.
....
>in either Visual Basic or Visual C++ together.  Anything remotely complex
>should be pulled out into a COM component where you can use a "real"
>language.  Because of this everything in VbScript is a "VARIANT" type which
>is really a big C union.  You get a "type" flag and a "data" set for each
>variable.  Why they took a tightly-typed language like C++ and made
>everything untyped is beyond me.  

A morons version of XDR?  COM is supposed to be language and platform
independent,  it isn't, but originally was thought it would be.  This union
method makes it easy to map values of different types, etc... between disparate
languages and such.  But there certainly are easier more transparent ways.  One
must remeber how old COM is.

>c)  Short-circuited conditionals.
>This is a major pet-peeve of mine.  Vbscript won't short-circuit a
>conditional which prevents me from writing stuff like:
>Do Until (rs.EOF() AND rs.Fields("ProductID").Value <> lngLastProductID )
>	' ... stuff
>Loop

What! OMG!  That clinches it, VBscript sucks.

>e)  Database access.
>Tie, almost.  PHP gives you the low-level DB access calls if you need them,
>but it's not a good idea to use them.  You'll shoot the "portability" of your
>project in the foot.  Better off going with ADODB which is based off MS's ADO
>that you'll use alot in VbScript.  PHP wins here though simply because it's
>underlying datatype doessn't do the brain-damaged things that VBScript does
>when you get back a NULL.

Yes, the PEAR libraries are fantastic.  When you start using PHP, investigate
them right away.