April 13th, 2000, 08:18 PM
After reading through three or four PHP tutorials (hello world through mySQL), I'm still left wondering,
"What's the big deal?"
At first glance (and usually the most incorrect) PHP seems like another new technology that people will have to learn, but why bother? Sure there are some nifty features, but nothing mind-blowing.
April 13th, 2000, 09:24 PM
For me PHP is THE choice for dynamic web development. I have tried ASP, Cold Fusion and Perl. I really liked perl and before that I was in love with Cold Fusion. I might even still be using Cold Fusion if it had been freeware.
In Cold Fusion I loved the ability to drop code straight in middle of html. In perl I like the million and one ways to do some specific task. And now in PHP I have some versability of perl (Thank God for regular expressions) and style of Cold Fusion.
I never used ASP too much, but I can tell you that I really prefer MySQL over Access. :-)
One of the first things I did in PHP was session management (That's having variables for each session and so carried over the pages). This is one very critical feature that perl and PHP are missing by default (Both CF and ASP have it). And soon-to-be-released PHP4 will also support sessions.
You asked "What's the big deal?". Well if you're developing anything that can be implemented using databases, PHP is IMHO the best choice of the four presented before in this post. I just love the speed you can get things together with it. And well.. Learning PHP was really much easier for me than it was to learn CF or Perl (or ASP).
What more can I say? I just love PHP. :-)
April 14th, 2000, 12:16 AM
Okie doke, let me attempt to summarize your points since a quoted reply here is a bit more difficult than email =)
(1) Support for regular expressions
(2) Intermixed code w/HTML
(3) Session management
(4) Rapid development
(1) Regular expression support
I haven't used them so I'm unfamiliar with it. At what point in your application do you use reg exps? I would imagine parsing, however that's not to be understated. I'm sure that was a big part of why you liked Perl =) PHP gets a point here!
(2) Intermixed code w/HTML
ASP, and even better - JSP support this as well and from the looks of it, this is the same for all of these langauges - that is, none of the offer any more/less along these lines.
(3) Session management
Same as #2.
(4) Rapid development
See #3. =)
This leads back to the question I posed before, "What's the big deal?" What does PHP offer me that I can't find somewhere else, aside from ASPs reliance on MS?
Lord knows I would never use ASP. VBScript is a subset of an already ****ty language. JSP is all I would realistically consider, and now that I've heard of PHP, I'm rather exicted as this sort of competition is great for developers. I'm looking forward to learning more. I can't believe I hadn't heard of it sooner =)
Thanks for your reply Dist!
April 14th, 2000, 08:51 AM
no nothing mind blowing until of course you actually use it, then ..... after playing with php/mysql for a couple of hours - I found that I could create dynamic pages from a database with user interface , I do not mean I found out I could - I mean I did - its too bloody simple (yet efficient) to be true. For every possible requirement PHP seems to have the answer in one form or another and it rarely takes long to find a neat QUICK and effective solution using PHP , it appears to cover all the stongpoints of other languages in one, I commonly read in forums about peoples problems with PERL mailforms , counters, etc etc - and I often wonder why the hell they bother as most of them use PHP and some form of database ....for if while - mail() !!! how simple can it get?.
A lot of 'serious' , 'proffessional' programmers seem to sneer at anything that is too easy - why?
""What's the big deal?" What does PHP offer me that I can't find somewhere else, "
nothing - except try finding all the "somewhere else" whizbangs all in ONE language - go on try .....
&OK I am looking forward to session management in PHP4 but there are ways and means around that for now , cookies , ip address , hidden frames(yuk) database etc- all of which are easily managed by PHP !
well thats what I think anyway - course I could be wrong - if not I will send you a picture of that yacht mmmmmmmm satelite connection????
April 14th, 2000, 02:46 PM
If you get that yacht, I'd like a ride =)
Ok, seriously tho', that's exactly my question: *what exactly* are the whizbangs you're talking about?
Using VBScript (ASP) and Java (JSP) it is very easy to create pages using databases. AAMOF, this is what I do, and yesterday it took about 15 minutes to have a nicely formatted popup window from scratch that made use of a number of SQL queries to display some information to a user.
I mean, I've seen and used the syntax for accessing a database in all three languages and it's the same three lines:
execute (returning a recordset)
Only thing is that VBScript's error handling ability is about as robust as a house of cards on a windy day. "on error goto" <-- booooo, whereas at least PHP has the Perl-ish "die" =)
Session management is functional in VBScript/ASP, but a complete joke as you cannot REMOVE something from the session, you can only reset it. So when I save a their original destination so I can forward them after login, it stays there already. It's rockin' in JSP because it java.util.Hashtable.
Yeah, I think I'll just pass that as a param since I can't delete it
Either VBScript/ASP or JSP can do any of the things you've mentioned with no difficulty and equal simplicity. I believe there's even a 1:1 mapping of lines of code. I guess right now I see PHP as "just another language" with its perks, as all language have their own.
I am not a proponent of any particular language, I'm just trying to learn more about PHP from a bunch of sites and forums like this.
April 15th, 2000, 12:57 PM
.... OK - another approach, the point I was trying to make before I got carried away with the yacht, In all languages there are cons , you mention error handling in VB , ASP is likely to look very sluggish against the new Zend engine etc etc - none of the above are disastrious .
While PHP has its cons - sessions(soon to dissapear).... well ok thats all that's comes to mind , there are I am sure more - but why work with a langauge that lets you down in one area & support it with another, when 1 language does it all? (In my opinion).
You seem to prefer JSP - I have no working knowledge of it so I can not comment fairly on it and if you find it deals with your everyday needs sufficiently then I suggest you stick with it .
"if it 'aint broke , dont fix it" - is a good philosophy, if however it is lacking in any serious way & if you have to resort to other languages to prop it up - well then take a look at PHP - it only takes a few minutes to get the hang of it anyway and it wont cost you a penny to try , or a windows box to run it ! (as it happens I use windows at home/work to develop (booooo hisssss shame))
I think I want a red Yacht & anyone with a bottle is welcome.
April 15th, 2000, 02:30 PM
In JSP, pages are compiled into servlets (check the .class files in the JSP engine's TMP directory). This way, they stay resident in Apache's memory space (or wherever the JSP mod is located) and accept requests.
Now I think this is probably dependant upon the implementation of the engine, specifically Sun's reference impl. of the JSP engine...? Anyways, I'm not sure how ASP and or PHP handle this, as its a HUUUGE performance gainer, and a big part of the reason people use servlets instead of CGI w/<insert language of your choice> where a new process is spawned each time.
If this is the case w/PHP (interpreted each time?) I must doubt its applicability in a high-transaction production environment.
What's your take on this?
April 17th, 2000, 11:20 AM
Hmmmmmmmmmmmmm - really getting out of my depth now so I must first consult an Oracle or 2 - I'll be back!