Posted by
CmdrTaco
on from the get-your-develop-on dept.
An anonymous reader writes "PHP just released the first release candidate of PHP 5 after 4 beta releases. It is considered stable and feature-complete -- so get testing!"
Power Power Power
by
ObviousGuy
·
· Score: 2, Interesting
It's funny, I remember when it was a main tenet of programming that data should be separate from presentation. However, PHP has shown just how powerful integrating data and presentation can be through inlining code directly into a webpage layout.
As Perl seems to fade more into irrelevence, languages that hold onto a strong central theme like PHP, Python, Ruby, and Dylan are coming to the fore to take its place. Whenever I see a story about PHP, I think more about the death throes of Perl than about PHP itself.
-- I have been pwned because my/. password was too easy to guess.
Re:Power Power Power
by
Anonymous Coward
·
· Score: 5, Insightful
It's funny, I remember when it was a main tenet of programming that data should be separate from presentation. However, PHP has shown just how powerful integrating data and presentation can be through inlining code directly into a webpage layout.
Try something complicated. You'll change your tune right quick.
Re:Power Power Power
by
Anonymous Coward
·
· Score: 4, Insightful
Powerful is one thing, maintainable another.
Keeping data and presentation separate is still the best thing to do. But that's why we have CSS. So unless you're still using tables, font tags or whatnot, you're not integrating data and presentation.
Re:Power Power Power
by
Charles+Dart
·
· Score: 3, Interesting
Separating code and content (and style) is what I use php for. If you are putting php in your html you are doing it backwards. Marked up content goes in one database table CSS goes in the other and php puts them together.
Re:Power Power Power
by
mcrbids
·
· Score: 2, Informative
It's funny, I remember when it was a main tenet of programming that data should be separate from presentation. However, PHP has shown just how powerful integrating data and presentation can be through inlining code directly into a webpage layout.
Mixing logic and presentation is a no-no for effective software design.
-- I have no problem with your religion until you decide it's reason to deprive others of the truth.
Re:Power Power Power
by
kevin_conaway
·
· Score: 4, Insightful
Umm, Perl is not dead or dying. It may not be used as much as it used to for CGI programming but in the world of system administrators, it is still very much alive and even growing. An admin without perl is making his or her life much worse than it could be
Re:Power Power Power
by
junkymailbox
·
· Score: 2, Insightful
I've tried both simple and complicated. It's in the design. You can easily write incomprehensible code that's not easy to maintain in any language.
Re:Power Power Power
by
w3weasel
·
· Score: 2, Insightful
inline into a web page is HORRIBLE, it's hard to read, it's easy to miss a badly spelt variable name
PHP can be written as OO or Speghetti; inline with presentation or seperate... the choice is yours... (if you know what you are doing... PHP can be incredibly flexible)
--
Just as irrigation is the lifeblood of the Southwest, lifeblood is the soup of cannibals. -- Jack Handy
Re:Power Power Power
by
sir_cello
·
· Score: 2, Insightful
Different horses for different courses. The great thing about ever popular use of computing languages the sheer diversity and the speciality of niches.
Don't try to compare a high level rendering and application logic language like PHP against the toolbox data manipulating kitchen sick included lanaguage of perl.
Yep. And if you inline presentation and data in a complicated web app, that's bad design.
Re:Power Power Power
by
justMichael
·
· Score: 4, Informative
Do yourself a favor and do not mix business and presentation...
Somewhere down the line you are going to have a person working on design that doesn't understand PHP and breaks something. Then you can either spend who knows how long to figure out what is broken or throw out their work and just roll back to what's under revision control (you use revision control, right?). Either way you wasted time. Or worst case, nobody notices the logic is broken and it makes it to production.
Go find a template engine that you like and use it. You'll be happy in the long run.
Re:Power Power Power
by
Snoopy77
·
· Score: 2, Insightful
PHP has shown just how powerful integrating data and presentation can be through inlining code directly into a webpage layout.
A lot of people using PHP, ASP, JSP, ColdFusion are doing their best to separate data collection and manipulation with the actual presentation of the data.
My particular favourite methodology fusebox tries to help programmers separate the model and the view. It is unbelievable how simpler web applications are to write when you do separate data and presentation.
I may be feeding the troll but they don't let me feed the aninamls at the zoo anymore.
-- "She's a West Texas girl, just like me" - G.W Bush
Iraqis
Re:Power Power Power
by
loginx
·
· Score: 5, Informative
Whoever said that PHP only uses inline HTML for the presentation layer is a tool.
Thereareseveraltemplating enginesavailable that effectively separate the application layer and the presentation layer for PHP applications. These engines are quite heavily used also (check the source code of most large open source projects and commercial applications...)
Re:Power Power Power
by
FyRE666
·
· Score: 3, Insightful
If you are putting php in your html you are doing it backwards. Marked up content goes in one database table CSS goes in the other and php puts them together.
That's possibly the most ridiculous thing I've ever read here (above -1 anyway). Why on Earth would you want to keep hammering the database for HTML markup, let alone CSS text?!! You'll find there's this thing known as a "filesystem" that does a better job at returning such content, much more quickly and more efficiently.
If you really are using the method you suggest above, then I can only imagine you don't have a very busy site...
Re:Power Power Power
by
Rui+Lopes
·
· Score: 2, Insightful
Keeping data and presentation separate is still the best thing to do. But that's why we have CSS. So unless you're still using tables, font tags or whatnot, you're not integrating data and presentation.
I think you are wrong... CSS splits STRUCTURE from PRESENTATION. DATA is what you put between tags. You can have the same structure with diferent data instances, presented in several diferent forms. Oh, BTW, php, asp, jsp are BAD ways of using this kind of design. Try using XML/XSLT/CSS to unleash the true power of web...
-- var sig = function() { sig(); }
Re:Power Power Power
by
loginx
·
· Score: 4, Interesting
I personally use a proprietary templating engine, but if I was to use any of the open-sourced ones, I would first look at what my requirements are.
If you are looking for a full-fledged templating that has all the bells and whissles, I would recommend Smarty because it has a massive amount of feature and seems to be quite endorsed by official PHP developers.
If you are looking for something a little simpler to bring more speed and less overhead to your presentation layer, I do like the approach of the Sigma templating engine (in the links posted above) as it brings only what you really need and does it very quickly.
Re:Power Power Power
by
sporty
·
· Score: 2, Interesting
Yet it does such a bad job of enforcing it. You'd think for a language who's job that acts as a conduit between your view layer and your model would at least do a good job at it.
Or are we going to add another few thousand functions into the core language. Again.
--
-
ping -f 255.255.255.255 # if only
Re:Power Power Power
by
Tablizer
·
· Score: 2, Informative
I think the "separate presentation" thing does not work well in practice. One-to-one translations usually don't work, and the frequency of out-right switches to other platforms/UI is not frequent enough to justify the up-front costs IMO.
See the debate at: http://www.c2.com/cgi/wiki?SeparateDomainFrom Prese ntation
Re:Power Power Power
by
oZZoZZ
·
· Score: 2, Informative
Agreed... I wrote a 150k line 'application' for a company's inventory and job control... after a month into the project, I had to scrap the whole project and start again. I ended up using 'module' functions to query databases, another set of 'modules' to format the data as xml, and another set to process the xml data with xslt using sablotron.
The three internal-tiers worked remarkably well, and made changing the application extremely easy. To make changes even easier, all insert functions were selects to postgres stored procs written in pl/pgsql, and all selects were done to views, both of which could be very easily changed without affecting the underlying data structure (or the underlying data structure could be changed without affecting the program).
Re:Power Power Power
by
Doyle
·
· Score: 2, Informative
Re:Power Power Power
by
SnatMandu
·
· Score: 2, Insightful
First off you can't even compare Perl to PHP.
Oh Really?
Perl is a general purpose progamming language not a simpleton web language such as PHP.
Evidently, you've had no trouble making a comparison... do you need a special badge or licence to make such comparisons?
Re:Power Power Power
by
matt4077
·
· Score: 2, Insightful
The problem with template engines is, of course, that they are either not powerful enough for what you do, or they become a new language by themselves. What good does it do, to replace a php if() { }else {} statement with some uber-xml-template-engine's ? None, other that everybody who needs to use your system has to learn another language.
For a php-product of ours, we have chosen to simply use php as the template language. The codebase itself is OO and seperate from the html, but somewhere you just have to have a loop through every row of a result making a table with it. And right there you have to mix logic and presentation, because presentation becomes part of the logic.
Hmm... why do we always get new expressivity features and library extensions, instead of new safety features and ways for statically checking our code (such as type checking, a novel but, admittedly, completely impractical and academic invention that only freak languages use)?
I guess because people like me prefer to complain and use other languages instead of fixing unsafe ones...
Using unit testing in a test-first mode of development can make type problems go away.
Re:Safety?
by
Anonymous Coward
·
· Score: 2, Informative
Well that depends, would you include: private and protected members/methods, abstract classes, class type hints, the "final" keyword, destructors and/or exception handling as safety features?
Since I only really use my own classes, I'm not overly concerned about hiding internal class members/methods, but I'm really looking forward to exceptions (nothing like doing a big block of queries, ALL of which have the same error checking code).
As for type checking, yes, my partner and I (him a Perl hacker and me a former Delphi designer) have expressed a definite desire for at _least_ a strict mode. PHP is hardly the only language with loose types... and considering that you are often dealing with form input, which is text, it's nice to not have to do explicit casts all the time.
Of course when working with databases (at least if you don't just make every field a TEXT or equivalent type), it's nice to have that kind of type checking. In which case it is possible to check those types. See the !== and === operators, as well as a series of is_() functions (such as is_string(), is_integer(), etc.
Personally, I wish they could have come up with a real date/time type... that's one thing I really miss about Delphi...
PHP is a weakly-typed language by design, not because they haven't gotten around to implementing type checking yet. If you're feeling insecure about your code, you can always explicitly typecast your variables or use the settype function to calm your nerves.
I've been using PHP extensively for years now and I can't say I've ever run into a problem with its handling of data types. Let's not forget that PHP is, after all, a scripting language.
Forget abstraction. It is even more trivially solved by using placeholders with prepared SQL statements, like "select * from table where field1 = ?". The driver should then take a paramater in the execute() function, figure out what type it is supposed to be, and convert the parameter, or error out if it can't. It worries about escaping quotes, newlines, and any other special characters. Inject THAT.
-- "Hot lesbian witches! It's fucking genius!"
Don't take it to school!
by
DanThe1Man
·
· Score: 3, Funny
Much improved.
by
Sheetrock
·
· Score: 3, Interesting
A test run of our PHP setup on PHP5 RC1 seems to be more responsive and crisp than it was on PHP4. I've also heard the syntax is being improved in some areas, which would be quite the boon (our site looking somewhat spaghettish as it is.)
Didn't have to jump through any hoops that weren't explicitly mentioned to get it installed, and haven't noticed any problems so far. Hopefully this is a sign that the official PHP5 is soon to arrive.
--
Try not. Do or do not, there is no try. -- Dr. Spock, stardate 2822-3.
Re:Time for /. to
by
Sheetrock
·
· Score: 5, Interesting
Although you might be kidding (since/. has an established base of well-tweaked high quality/high performance Perl code), not only is PHP and in particular PHP5 is an excellent choice for prototyping because of the integration between display and function, but it's probably the right choice most of the time for people who are seeking to integrate databases with web functionality without delving into high-priced solutions.
/. is in a special situation due to the amount of traffic it receives, and the amount of effort that has gone into making Slash the powerhouse that it is has no doubt driven projects like perl_mod to increase the efficiency on the webserver side. While PHP would only improve on the appearance and capability to add user functionality, there would be issues with stability.
--
Try not. Do or do not, there is no try. -- Dr. Spock, stardate 2822-3.
Re:Time for /. to
by
Micah
·
· Score: 2, Interesting
For a site like Slashdot, PHP would kill performance. mod_perl caches psuedo-compiled code in the webserver. PHP has to be re-interpreted for every page hit. You can install the Zend Optimizer, but from my limited trials with Xaraya running under it I wasn't all that impressed.
Personally, I think Slashdot needs to be re-written in C. See my journal for the complete idea.
Re:Time for /. to
by
Anonymous Coward
·
· Score: 3, Informative
You don't want Zend Optimiser (pointless) you want Turck MMCache
turck-mmcache.sf.net
It caches the compiled op-codes. Makes php MUCH faster. Reduced the load average on my machine from about 8 to 0.56
How does PHP comapre in terms of speed and ease of Use to other scripting languages like ASP, perl, JSP, or serverside Javascript.
I guess a lot of PHP user base was once doing mod_perl and CGI. I personally use JSP, but often find it too cumbursome for quick hacks.
-- for the last time people, I am "frodo from middle eaRTH", not "middle eaST".
Re:PHP in comparision to others
by
Phexro
·
· Score: 2, Insightful
Not sure about speed. It seems fast enough for most stuff, but I'd do some careful benchmarking and optimization if I was writing/designing a big app.
I've never used ASP or JSP, but PHP is much easier to pick up than Perl or JavaScript. It's very simple, and uses C/C++-like syntax without the complexity you have to learn to program effectively in C/C++.
Unfortunately, this means that there's huge amount of PHP code that's utter crap out there, because you don't have to think before you code.
Re:PHP in comparision to others
by
protohiro1
·
· Score: 2, Interesting
PHP is insanely easy to use. I think that is one of its biggest draws. I tried using JSP back in the day but it was really over the head of this artist. In terms of speed...well you're asking the wrong guy but I can't detect any difference between static pages and php pages (but my scripts are very simple). Products like vBulletin and Moveable type are very popular and seem to run at a decent speed and scale, so I think php is battle tested. Although the two web developers I know use ASP and JSP respectivly and don't seem to take PHP to seriously.
-- Sig removed because it was obnoxious
Re:PHP in comparision to others
by
Charles+Dart
·
· Score: 4, Informative
PHP is very fast and easy to use. The php.net website has great documentation. With the PEAR extension database abstraction is possible making all your data functions totally portable. As for quick hacks php can be run on the command line which is very quick and very hackey. I have been using it for years in tandem with MySQL and find that it meets all my needs (except for the fact that MySQL doesn't have nested queries but that is coming in the next release and I will be a happy man!) I also know JSP and Oracle but prefer PHP/MySQL by far.
Re:PHP in comparision to others
by
justMichael
·
· Score: 3, Informative
If you put a site together with a little planning and a properly setup cache and then use a template engine that supports output caching you can rival static pages depending on how often the page "needs" to hit the DB.
This really all depends on the sites content, an average ecommerce site probably only needs to hit the database once a day, slash on the other hand could cache the front page for non-logged in users for 5 minutes, which I believe they are doing now with perl.
As usual YMMV.
significant changes
by
berkleyidiot
·
· Score: 5, Informative
be careful upgrading, as the semantics regarding object assignment have changed from copy to reference. i know some of my code would make use of the old copy-on-assignment semantics.
other than that, looks like version 5 introduces some cool stuff, ala java. abstract classes, exceptions, method visibility, and interfaces to name a few. can't wait to give it a try.
Re:significant changes
by
Carl+T
·
· Score: 5, Insightful
the semantics regarding object assignment have changed from copy to reference
Sounds to me like the migration to PHP 5 will be a long and painful one. The project I've been working on in PHP for the last couple of years sure could use some of the new features, and if what another poster said about responsiveness translates to higher speed, that's another reason to switch. Then again, looking through megs of PHP code for things that are suddenly ever so slightly broken because of subtle language changes is not exactly fun.
For new projects, OTOH, I don't see much reason to stick with PHP 4, except the horrors of having to instruct users that they need to upgrade their PHP interpreter(s) again.
--
This signature is not in the public domain.
Re:significant changes
by
T3kno
·
· Score: 4, Informative
All of the XML stuff has changed as well, I found that out while going through the Core PHP, which has been *cough* updated *cough* to cover PHP5. They forgot to mention that they were talking August 2003 PHP5, AKA PHP5 before libxml2.
The nice thing is that it nearly completely models the functions listed in the w3c recomendation for the DOM Level 3 Core, which are also nearly identical to the XML::LibXML module in Perl.
So, IHMO PHP5 = Good, Core PHP 3ed = Bad!
-- (B) + (D) + (B) + (D) = (K) + (&)
Re:significant changes
by
qlippoth
·
· Score: 2, Insightful
be careful upgrading, as the semantics regarding object assignment have changed from copy to reference. i know some of my code would make use of the old copy-on-assignment semantics.
Which is why it may suffer problems with a lot of hosting companies upgrading and adopting PHP5 initially. Its seems like 90% of the borrowed code and available projects out there tend to be class based (even though most small projects don't necessarily need to be done in OOP, but this isn't an argument I'm going to delve into), which may subsequently become broken if said hosting company were to upgrade to the new version. Then again, one could always compile both versions to use different extensions like.php4,.php5...
-- Mmmm, -funroll-loops
Damn, you're clueless
by
jbellis
·
· Score: 5, Interesting
- for all but the most trivial sites, separating code & presentation is a Good Thing - PHP supports this kind of separation. google for template libraries.
Re:Power Power Power [where's my perl!?!]
by
Telastyn
·
· Score: 5, Insightful
Huh?
Having been a big PHP fan, let me assure you that PHP has a strong central theme like a kleptomaniac with ADD has a strong attention span.
Having been a big PHP fan, every story about PHP releases reminds me of the page long list of vulnerabilities and issues under it's entry in netbsd's package listing.
Having since moved to perl, I'm wondering if those death throes you're talking about are the same ones that haven't arrived on my BSD machine yet...
I just think about how easy it is to create something with PHP. Not necessarily the death throws of Perl. I started with CGI and Perl, and did quite a lot of it many years ago. I've worked with ASP too; I liked the flow of it, but it was too microsoft centric. When I came to doing web programming again, PHP was what was available, and I LIKE IT! Very powerful.
Any language that has a 4000 page Help document that is extremely easy to use and find information, is an excellent programming language.
Re:It is NOT stable
by
panic911
·
· Score: 2, Interesting
lol, good point.
I've been playing with PHP5 since Beta1 and honestly, I've never noticed any stability issues with it. Of course, that's not to say that it was stable (could have been bugs or security issues).
PHP5 has really great Object Oriented functionality. I'm glad to see that it isn't far from being released.
Re:It is NOT stable
by
LostCluster
·
· Score: 3, Informative
A "release candidate", by definition, is thought to be stable, but they're not quite sure enough to declare it in the stable release yet.
Re:It is NOT stable
by
Anonymous Coward
·
· Score: 3, Insightful
You'll know it's stable when porn sites start transitioning to it. Consider the load testing that they are able to throw at any software.
Apache 2.x safe to use yet?
by
Anonymous Coward
·
· Score: 5, Interesting
I remember reading within the PHP docs about how unsafe it was to use the 2.x release branch of Apache with PHP...something to do with thread safety if I recall.
Anybody know if PHP 5.x has overcome this limitation?
Re:Apache 2.x safe to use yet?
by
Wonko42
·
· Score: 2, Interesting
I've been using PHP 4.x with Apache 2.x (as a module) for over a year now, on both FreeBSD and Windows, with no problems. I haven't tried PHP 5 yet, but I imaginine it works fine too.
Re:Apache 2.x safe to use yet?
by
QuasiEvil
·
· Score: 2, Interesting
The only thing I remember was a problem relating to multiple includes of PHP scripts. The PHP people pointed at Apache, Apache people pointed at PHP. Something about apache filter vs. something-or-other, blah blah blah. Suffice to say they finally got things together a while back, and I run PHP 4.3.x on a handful of production servers (some with quite high load and mostly PHP pages) without issue.
I don't remember the exact details of the whole fiasco, but both sides racked up a black eye in my book. It was a very basic piece of functionality that they didn't seem to be moving too quickly to fix. It delayed my upgrade to A2 for about eight months and annoyed me every time I thought about it.
That said, PHP absolutely rocks. Fast, efficient, and concise. I just view it as improved C, which in my world (a world sans objects), is a very good thing.
Re:Apache 2.x safe to use yet?
by
shiflett
·
· Score: 4, Informative
You have to use the pre-fork MPM, which is the same condition you'll have when using various modules with mod_perl. Basically, PHP core is thread-safe, but you're likely to use some extensions in your own configuration, and these aren't necessarily thread-safe.
I'm not aware of a list of "who's safe", but such a thing would be nice.
Re:Apache 2.x safe to use yet?
by
mattdm
·
· Score: 2, Insightful
My understanding (and I don't actually use PHP, so maybe I'm out of date) is that with PHP 4.x, at least, it worked fine with the traditional fork-based Apache model, but br0ke with threads. (And for this reason, the threaded binary is installed at/usr/sbin/httpd.worker and/usr/sbin/httpd is the old-fashioned way on Red Hat's distro.)
Re:Apache 2.x safe to use yet?
by
gabe
·
· Score: 2, Interesting
Re:Apache 2.x safe to use yet?
by
Electrum
·
· Score: 2, Interesting
I remember reading within the PHP docs about how unsafe it was to use the 2.x release branch of Apache with PHP...something to do with thread safety if I recall.
PHP is not thread safe and likely never will be. The core is thread safe, but not all the extensions are guaranteed to be thread safe due to the external libraries they use. Thread safe issues likely won't show up during testing, but will show up in production under heavy load. This is the reason Zeus recommends using FastCGI instead of ISAPI for PHP, and the reason the recently released Zend WinEnabler uses FastCGI.
I strongly recommend using the FastCGI interface to PHP, even under Apache. The FastCGI interface is much faster than mod_php4 under Zeus and will likely faster under Apache too. It has the advantages that you can control resource usage better (no bloated PHP environment in every Apache process), run PHP as a different user than the web server and even run PHP on a different machine than the web server.
FastCGI rocks. It is a shame that many things are written as Apache modules and not FastCGI. The trend of "compiling everything into the web server" is bad engineering.
Speed: they're all "fast enough." All of these scale well enough that for most sites you won't care, and none of them really scale well enough to support something like cnn.com. [Read through the archives to get a feel for the pain/. has to go through to serve its audience, for instance. And/. isn't even THAT big.] No flame; just that all these options are low/middle end.
Ease of use:
Classic ASP is pretty close to Perl. ASP.NET is a rather different paradigm, with a slightly steeper learning curve but more than enough added power to make it worthwhile. Unfortunately ASP.NET is a classic "leaky abstraction;" it tries to make things simple that sometimes aren't, and this will bite you.
Perl: it's nearly impossible to maintain a substantial site in perl with multiple developers working on the code. The language works against you here. Again,/. is a case in point. There's a reason/. doesn't upgrade to the latest & greatest very often.
JSP: takes a PHP-ish approach but Java is a statically typed language which makes using it for web apps _extremely_ verbose in comparison to the other languages here.
Javascript: poor fit for server-side use. Nobody does anything serious with it that way.
Verdict: They all suck to one degree or another. It's heresy on/. I know, but of these, ASP.NET is probably the best choice. If you want a toolkit/language that won't make site maintenance hell, OpenACS (tcl) or Zope (python) is probably a better bet. If you want something that will scale to absolutely huge levels (like the aforementioned CNN), J2EE is about the only game in town. (But a living hell to code for -- not recommended for smaller projects!)
Re:Here you go
by
perrin_harkins
·
· Score: 3, Insightful
All of these scale well enough that for most sites you won't care, and none of them really scale well enough to support something like cnn.com.[...]If you want something that will scale to absolutely huge levels (like the aforementioned CNN), J2EE is about the only game in town.
Yahoo uses PHP and Perl. Amazon uses Perl. TicketMaster uses Perl. These are some of the biggest sites in existence. The only truly large site using Java is eBay, and they are not using all the standard J2EE stuff. And I can't believe you are claiming that Tcl is more maintainable than Perl.
Re:Here you go
by
flocculent
·
· Score: 5, Informative
While I agree with the rest of your comments it's not really true to say that ASP/PHP/etc won't scale to the size of a site like cnn.com. They may not always be your best choice of language, but they do fit certain niches rather well. In general, for a website to scale well, the overall system/software design is much more important than choice of language/environment. (Though it's true that j2ee app servers give you a big headstart here)
Whether a website will scale to cnn like levels is dependent on quite a few factors... two of the main ones that come to mind are:
a) How much work the site has to do to build a page (think basic marketing website vs an online banking site)
b) Sensible overall design (both code and network/hardware).
A well built PHP site (i.e many servers load balanced, well cached page content, intelligently coded to scale from the outset) will scale to whatever you like, at least for cnn type content which is easily cached.
I worked on one of the very few major news websites that coped with Sept11th traffic, and that website was developed using Linux/Apache/PHP/MySQL. (we only just coped mind you!;)
I remember reading a while back that yahoo use PHP for various bits and pieces too..
Javascript: poor fit for server-side use. Nobody does anything serious with it that way.
Actually, in a 'classic' ASP environment, server-side JavaScript (JScript) is a vastly superior option to VBScript. I have used it extensively in the past for small-to-medium sized corporate intranet apps at my job. You get identical access to the ASP, COM and Windows-scripting object models, and much better object-oriented support to boot. JavaScript is damn solid; I wish it had a server-side presence in the Unix world.
Plus, in a Windows environment JScript is probably the closest thing to PHP, in terms of syntax and relative complexity.
Unfortunately ASP.NET is a classic "leaky abstraction;" it tries to make things simple that sometimes aren't, and this will bite you.
Agreed completely. With this stated, I'm surprised you would rate ASP.NET the best choice. What you pointed out is a significant issue, especially when one relies on Visual Studio. Too many web developers don't understand how a lot of their code works; VS.NET takes that problem to a frightening new level.
If you want something that will scale to absolutely huge levels (like the aforementioned CNN), J2EE is about the only game in town. (But a living hell to code for -- not recommended for smaller projects!)
No argument.
Perl: it's nearly impossible to maintain a substantial site in perl with multiple developers working on the code. The language works against you here.
Totally disagree. Put *good* Perl programmers on a team, make them adhere to sane coding/documentation standards, and give them Mason or HTML::Template (depending on preference); you'll get maintainable site. The catch with Perl is that it punishes seat-of-pants code slinging more harshly than the other languages mentioned. I know it's a mantra around here, but you CAN write clear Perl code. (Disclaimer: I mostly use Perl nowadays.)
I really like Python, but I usually run back to Perl for CPAN and the quality/volume of the documentation available. I don't have enough real-world experience with it to fairly judge against the others. Ditto Tcl.
Cheers.
-- Bush is a cylon.
Re:That IS kind of funny
by
smack_attack
·
· Score: 2, Interesting
I think you are referring to sites that get killed from too many connections to MySQL (due to the poor defaults in MySQL). As someone who programs for high traffic adult sites, I can attest that PHP can handle loads of traffic with ease, it's the databases that usually fuck up first. And even then that's usually just due to retarded coding practices.
Funny enough though,/. uses MySQL without apparent problems, but then again there's a lot of page caching.
An article discussing some of the new PHP5 features.
Uh, mod down, WRONG!
by
Anonymous Coward
·
· Score: 2, Informative
MT runs on Perl, (not even mod_perl at that) not PHP.
If it ran on PHP (or even mod_perl), it probably wouldn't have the scability issues it currently has.
Re:It is NOT stable
by
Anonymous Coward
·
· Score: 3, Insightful
...why do people mod this shit up? It's NOT fucking insigtful, it's redundant. The entire parent post could be removed and no one would think anything different than if it was never posted to begin with. It's just repeating shit that was already said and is so blatantly fucking obvious to anyone who cares enough to use it.
"RC1 != Stable". No fucking shit, Captain Obvious. That's why it's a RELEASE CANDIDATE *gasp*. Nowhere did it state "Put this on your production machines at once." It said "stable enough for people to start playing with."
Let me guess, the sun is yellow?
Modding this shit up just encourages people to post brain-dead information and therefore makes everyone stupider in return. So don't do it.
Php 4 vs php5
by
Billly+Gates
·
· Score: 2, Interesting
I wonder if I can install both so I can play with php5.
The "good design" police... have fun with it!
by
turnstyle
·
· Score: 3, Interesting
For starters, I'd say that PHP is more a challenge to ASP than Perl.
(I see plenty of Windows users adding PHP to systems that already support ASP)
In any case, all the talk of "good" design ignores all the new and not hardcore coders who can play with something like PHP (as well as ASP) but not so much Perl.
(note aslo that Apple includes PHP on their OSX boxes)
My point is that, in my opinion, one of the things so nice with PHP is that it's just fun to play with. If some coders want to "inline" their code, let them, and let them have some fun, eh.
It's like the pre-Web days when "designers" got into scripting with HyperCard and Lingo.
Re:It is NOT stable
by
penguinblotter
·
· Score: 4, Funny
heh heh - you said "load"
-- Mind the gap
Control vs. Abstraction
by
Eberlin
·
· Score: 4, Interesting
Having browsed only a few ASP.NET howtos but not having had the opportunity (or misery -- since this IS slashdot) to code in it, I'm not too familiar with ASP.NET
OTOH, I am a bit more involved in programming in PHP. I think it's fairly nice and simple enough. Haven't gotten into a lot of the OO stuff but it's still fairly powerful with the simple things I do.
From what I've read, ASP.NET abstracts a LOT of the stuff from the programmer. Forms pretty much take care of themselves, validate on their own, and repopulate themselves for the user to correct. Among other things, this helps isolate code from content.
From experience (which may be very limited), PHP doesn't have this feature. This allows for so much more control over what happens to your forms, but also introduces more code into the mix which could get ugly after a while.
Thus we have control vs. abstraction -- a classic debate. Convenience and rapid development would lean towards abstraction (as anyone who coded VB may argue). Would be nice if PHP had that n00b convenience somewhere while still being great for more advanced coders.
Ultimately, control is probably the choice for anyone who wants to get past the abstraction. Besides, in the long run, you'd probably want to write your own data validation code (or at least implement an open-source version) instead of relying on a (closed-source) language to check for you. That's simply a matter of trust.
running both php 4 and php5
by
ubiquitin
·
· Score: 3, Informative
For people who think there must be something better to write web-based applications than PHP, I invite you all to take a look at Seaside by Avi Bryant, a web framework available for Squeak and, I think, VisualWorks Smalltalk. It uses continuations to make programming a web application basically the same as coding a desktop application. It features many, many things that PHP cannot do.
I hear this alot and I don't get it. I find PHP code very legible. In fact, I find every language that I have a good knowledge of to be quite legible.
Now if I have a lower level of knowledge of a language I often have trouble reading it, but that's usually because I didn't know that syntax X could be used to accomplish the task, I always used syntax Y. This happens to me alot in Perl, I can make it do alot, but since I'm not as familar with it, there are always ways I don't know to accomplish the tasks.
Of course this assumes the author is a somewhat reasonable individual, knows to use the proper control structures and the like.
So I genuinely ask, what is it about the syntax of this language that gets people? Is it too many curly braces or what?
For those of you who don't know PHP, just wait a version or two. It already supports VB, C, C++, Javascript and Perl style coding. Version 5 is basically Java. Expect Intercal, Unlambda, and BrainF*** support by version 7 or 8. If you know a Turing-complete language, chances are you'll be able to use it to code PHP by the end of the decade.
PHP vs. Perl
by
transient
·
· Score: 4, Interesting
I swear I'm not trying to start a flamewar with this, so please respond appropriately.
What advantage does PHP have over Perl?
At first, I rejected PHP because of its (apparent) preference for intermingling presentation and logic. As has been thoroughly discussed in another thread, separating the two is not only possible but recommended. That doesn't give PHP any points though -- it just removes a penalty.
Both languages have a wide range of libraries/modules to choose from (although I think the score here goes to Perl). Their syntax is nearly identical. They both run on lots of different platforms. PHP is pegged as a tool for making web sites, while Perl is a general-purpose scripting language that happens to be useful for web sites too.
So, make a business case for me. I manage a development team (I rose from the ranks so save your MBA jokes for another day) and I want to know why I should consider PHP over Perl.
--
irb(main):001:0>
Re:PHP vs. Perl
by
The_DOD_player
·
· Score: 2, Insightful
First, the two languages are very similar, with PHP biased towards web-programming, mostly by the absense of particular libraries. But PHP is also emerging as a general purpose language. There has been some experiments to get a GTK capability to PHP.
But, if you already have a staff trained in perl, there's IMO not any real reason for you to switch to PHP.
I have, however, developed a preference for PHP, it has a simpler syntax, and better naming conventions. PHP has more text and perl have more meta-characters when defining arrays, doing string manipulation ect. PHP is simply more readable, to beginners at least. What is the point for example for an array to be prefixed by % or @ or $, depending on the context?
Re:PHP vs. Perl
by
Gerner
·
· Score: 2, Informative
So my background is C, C++, and Java ( 10+ years ) and about three years ago I needed to start writing some web based applications. I tried both Perl and PHP and they both did the job. Eventually PHP won out for most all of my web development because it is so familiar to use for someone with my background. This is PHP's big win, it is easy to be very productive very quickly because the syntax is so familiar for a lot of developers. The available third party libraries and the online documentation alse keep developers productive.
My bet is that anyone who has never used either Perl or PHP will choose PHP, if they've already developed in one of the languages I mentioned above.
Re:PHP vs. Perl
by
claar
·
· Score: 4, Informative
Well, if you rose from the ranks, then you should be able to perform a simple test:
Think of a task that will take about 20 minutes to program
Program it in both Perl (use perldoc as another poster suggested) and PHP (use php.net/manual/en)
Wait 2 weeks
Attempt to add a simple feature to each script. Time yourself and compare
???
Profit!
When I go back and look at my Perl scripts I wrote a couple weeks ago, it takes me a while to get my head back into the script. With PHP, the code is always straight forward. It may be more verbose, but I understand it much more quickly than my Perl.
Besides this, I've found PHP's documentation to be far superior to any other languages'. When I do web programming, give me PHP anyday.
The only thing Perl has over PHP in my mind is that CPAN is currently far superior to PEAR. If you need many special libraries, you may want to consider Perl.
</ramble>
-- I'd give my right arm to be ambidextrous...
Apache 2.x MPM is safe with PHP 4.3.x
by
dananderson
·
· Score: 2, Informative
Apache 2.x is safe if you use the MPM (process) model, not the thread model. The problem isn't PHP, but multiple underlying libraries used by PHP. YMMV.
Don't use PHP 5.x yet for production. Wait until it's released (at least), or a few months after the initial release.
Re:Apache 2.x MPM is safe with PHP 4.3.x
by
ergonal
·
· Score: 2, Interesting
Here's what Rasmus said 6 days ago in a bug report:
We are not talking about just Apache2 here. We are talking about Apache2+an MPM+PHP+3rd Party Libs. The folks at apache.org are only concerned with Apache2 itself, and for serving up static files it is better than Apache1 in many respects. However we have to worry about a lot more stuff here. In fact, we couldn't care less about serving up static files. The main issues as I see them are: <p> 1. Thread safety issues. - It is very difficult to track down threading problems and we don't have decent tools to help us.</blockquote> - The thread safety of many 3rd party libraries are unknown quantities and can depend on the OS, libc and even compile flags. - Many distributions seem to ship with the Worker MPM as the default and that is the MPM that gets the most attention. This is a hybrid multi-process, multi-threaded MPM.
2. You can eliminate the threading problem by running the prefork MPM which effectively makes Apache2 behave just like Apache1 in the way it forks processes and serves one request at a time per process. Issues here: - Apache2 itself is rather fringe still. It has approximately a 5% marketshare vs. 65% for Apache1 at the time of this and out of that I would guess the majority are running the Worker MPM. So we are talking about a fringe MPM in a fringe server. This means it has not had anywhere near the attention from people running large production web server farms that it needs for me to comfortably say that this is a solid piece of code with all the kinks worked out. - The benefits of moving to Apache2+prefork are questionable. The new filter API would be one of the benefits, but it still has some issues and by default we run PHP as a handler, not a filter currently. You can optionally run it as a filter but people have had problems with that.
Until such a time when enough clueful PHP people think there are enough realworld useful features in Apache2-prefork or even Apache2-threaded to actually sit down and bang away at PHP and the majority of the PHP extensions under Apache2. Or if enough regular users report back that they tried it and had absolutely no problems then we will change our reccomendation, but for the time being I don't think that we in good faith can tell users that Apache2+PHP is something they should be putting into production.
Did you test PHP5 or have a wine tasting?!
by
Anonymous Coward
·
· Score: 5, Funny
A test run of our PHP setup on PHP5 RC1 seems to be more responsive and crisp than it was on PHP4.
Riiight. "Crisp". Yeah, that sounds like a very analytical test run you did. Did you also notice PHP5's woody undertones and how it satisfies the spirit without weighing down the heart?
You got to be kidding. PHP has two primary strengths: architecture and standards. Java is a general purpose language build from the ground up as an OOP. Java is used from embedded systems, mobile phones, desktops, webapps to world class enterprise projects. Java has a sound definition as a language and its virtual machine. Java standards are defined by the JCP with formal methods for approving changes including Apache. AFAIK PHP is used only in webapps. OOP was added as an afterthought. PHP is a project of the Apache Software Foundation. Architecturally has native standard access to databases and there are drivers for every db, supports distributed transactions, has message queues, takes advantages of multiprocessors, JIT native compilers in the VM, libraries for every need. Don't know about PHP but for what I know Java has a more advanced architecture.
The majority of java webspace applications were written before css and xhtml were mainstream. What apps are you talking about? The PHP changelog shows that PHP 4.0 was released in may 2000. The great mayority Java webapps are based on servlet API 2.2 or later which where release on april 2000. Please explain how Java apps are less suportive of css and xhtml than PHP. BTW, how many PHP 3.x webapps are there?
I predict that there will be a need for css and xhtml conversions among the big java web apps and this will be readily delegated to PHP. If I would have a Java webapp that needs to support css and xhtml it would be ridiculous to rewrite the app in another language, when it could be easily adapted. How would I explain it to my customer? There's nothing in Java or PHP that prevents using css or xhtml or making them automatically supported.
I don't mean that PHP isn't useful, but Java has just a broader scope.
--
"I think this line is mostly filler"
Get to know PHP5
by
gabe
·
· Score: 3, Informative
If you're wanting to learn about all the wonderful new features in PHP5, then grab this book. It covers more advanced topics (hence the name Advanced PHP Programming) but it's an absolute must for serious PHP developers. If you're a beginner, learn PHP in general first, then grab that book.
--
Gabriel Ricard
Perl's grammar is too big
by
SnatMandu
·
· Score: 4, Interesting
PHP has a smaller syntactical (is that a word?) footprint. As you said that you manage a development team, this is important. The Perl motto of "There's more than one way to do it" becomes an issue when you've got multiple developers working on the same codebase. You can write and (attempt to) enforce code style rules in your organization, which mitigates this a little bit, but it takes time to write those guidelines, get buy-in, and enforce.
I use perl often, but I consider it a "fire and forget" language. I use it for sysAdmin type work often, when I'm doing something once, and want to write a quick script that nobody (including me) will ever lay eyes on again. For real development, where I'm trying to create a maintainable piece of software, with input from other developers, I stick to PHP.
Re:Perl's grammar is too big
by
SnatMandu
·
· Score: 4, Interesting
Most of your criticisms of PHP are totally on the money.
But come on. Once a programmer really gets into perl, only another hard-core perl person can read their scrawl. Don't get me wrong, I love perl. But it's a horrible choice for a large project with many developers.
I've not dug into perl documentation for a while (has it been years?), but last time I checked, it was about 100 man pages. With php, if I think there's a function called split, I type http://www.php.net/split and there's the docs.
Re: perldoc, c'mon! I get the impression you've never had to maintain code written by a hard-core perl programmer (or maybe you are one). For hobby stuff, use any language you want, but for business purposes, I don't want to have to search for developers who are so fucking specialized in perl. With PHP, I can make anybody who learned the basics fo C and make them productive in about 48 hours, working on someone else's code. With a big perl codebase, that same person is going to have to be twice as expensive if they're going to jump in head-first.
Re: too many overlapping core functions - I don't know what you're talking about. There are a few aliases in there (ie: chop or rtrim (which actually is annoying, since chop() should work like it does in perl, IMO)), but I don't see a lot of overlap.
I think perl is really neat, but it's overkill. I know that's the tried and true criticism, but I really think it's true. I don't want to give a group of 4-12 developers of varying cluefulness that sort of capacity to create havoc for each other.
Re:Perl's grammar is too big
by
Anonymous Coward
·
· Score: 2, Interesting
Here's an example of what the parent poster was talking about:
ereg()/ereg_replace()
eregi()/eregi_replace()
split()/spliti()
C'mon! Just make the "i" part another argument! Sheesh!
Some functions are split with underscores (mysql_connect, ereg_replace, file_exists()) others are just mashed together words (fgetcsv(), all standard POSIX calls, etc.). It's polluted with dozens, if not hundreds, of in-core functions!
Perl, on the other hand, derives its real strength from libraries (CPAN!). Like Java, C++, Python or any other language.
Which is harder? Learning hundreds of built in functions or figuring out a library? Dunno, hard to say, but libraries seem a lot more popular than throwing hundreds of core functions into a language.
Documentation? Sure, you have www.php.net/[function], I've got "perldoc -f [function]". I don't need net access to do a quick lookup. Not to mention all module documentation is available through perldoc on the commandline as well.
And if you have a problem with unreadable, unmaintable code, fire the programmer and get someone who can stick to coding standards, comment their code, and keep the cutesy one-liner hacks out of their code.
Give any group of 4-12 developers a big project, and they'll create chaos if you don't have them stick to coding standards. Especially if they don't know the language inside and out - Perl OR PHP!
Re:Perl and even better?
by
C_Kode
·
· Score: 2, Informative
Most of our company's web applications are written in PHP, but that isn't where php has the heaviest use in our company. I have the CGI version of it installed on all of our Windows servers, and use it as the *shell scripting language* for our Windows boxes. It's like batch files that can use complexed logic, network protocols, database connectivity, and best of all. It's absolute ease of use. It has made alot of my Windows jobs a breeze to automation and manage.
Finally clause
by
BlueLabel
·
· Score: 4, Interesting
I used to be a PHP developer, but switched to python-based content management systems due to the elegance and ease of programming in python. However, I was interested to see how PHP had progressed since the last version, and read the article linked by Slashdot.
The main reason I initially dumped PHP was its atrocious error handling. Python and other more elegant languages use exception handling, which is much more elegant than checking return codes and setting error handlers.
I had read earlier than PHP 5 would include exception handling, but wouldn't include the "finally" clause. For programmers that understand and use exceptions, the finally clause is _very_ useful. I try to avoid using C++ simply because it doesn't have a finally clause (and no, the object destruction mechanism is not a good substitute).
So, I became very excited when I read the following:
Note that there is support for "catch all" and for the "finally" clause.
(http://www.php.net/zend-engine-2.php)
However, I couldn't find any examples showing the "finally" clause or the "catch all" clause in use.
So, I went grepping through CVS.
In the changelog for PHP, it is suggested that all exceptions _must_ inherit from a base 'Exception' class, which means that catching and exception of type 'Exception' is a basic "catch all". However, I couldn't find _any_ evidence in CVS that a "finally" clause has been introduced in PHP 5.
Has anyone here found evidence that the "finally" clause exists in PHP 5?
-- Devin
Re:just too bad
by
SnatMandu
·
· Score: 2, Informative
References work well enough. Show me where you've been constrained.
magic_quotes - you're totally right. Teh are the SuX. But it's not hard to work around. You just have some low-level test that checks the mq setting, and then conditionally addslashes() or not. It's not *that* hard. It's just one of those things you figure out when you realize that, for example, you're writing code that you're going to publish.
XML/XSLT for humans?
by
phutureboy
·
· Score: 3, Insightful
OK, I tried using XML & XSLT under PHP a couple years ago, for the CMS system which is linked in my.sig. It was one of the most frustrating experiences of my life.
Firstly, it required that PHP be recompiled with the Sablotron module, which would have made the software inaccessible to most of its current user base.
Secondly, writing the XSL stylesheets was complicated as hell. The learning curve associated with them would have made the software inaccessible to ~96% of its current user base, probably including me. (it now uses its own templating system which allows designers to create the templates.)
Has any of this changed? For example, are there any WYSIWYG editors which make it easier to write stylesheets? Will PHP 5 have XSLT capabilities built-in?
Or am I missing something? Is XSLT really not as hard to get started with as I think? (If I'm just a dumbass, I'm sure someone on/. will quickly point that out:)
Re:XML/XSLT for humans?
by
prockcore
·
· Score: 2, Informative
Firstly, it required that PHP be recompiled with the Sablotron module, which would have made the software inaccessible to most of its current user base.
Yeah, that blows. But XSLT is probably the most powerful and quickest templating systems available.
We use XSLT to serve up all of our stories. We wrote an apache module which is passed two IDs, one ID is the story, the other is the xslt. The module fetches the xml from a database, and loads the xslt from disk. Applies the two, and returns the output. (It does a lot more, including fetching index pages and building xml search results, both of which have their own XSLTs to be applied)
We then have a PHP front end which basically calls the apache module and then passes the output to the end user.
It is extremely fast, and it makes it very easy to provide multiple versions of a story (HTML, RSS, PDA, WML, Email, and printer friendly version).
In fact, the database is still the slowest piece of the puzzle.
XSLT takes some time to learn, but it's not that hard, and the results are amazing.
Re:XML/XSLT for humans?
by
trianglecat
·
· Score: 2, Informative
Well... XMLSPY is one choice. The enterprise edition comes with "Sylesheet Designer" (which has since been renamed "stylevision" me thinks) in the last update. It is supposed to be a WYSIWYG editor which includes tags to your xml schema. My experience is with stylesheet designer...its buggy, it takes lots of tweaking, but again its a helluva lot better than doing it by hand.
Re:It is NOT stable
by
footNipple
·
· Score: 3, Funny
...why do people mod this shit up? It's NOT fucking insigtful, it's redundant. The entire parent post could be removed and no one would think anything different than if it was never posted to begin with. It's just repeating shit that was already said and is so blatantly fucking obvious to anyone who cares enough to use it.
Lighten up Francis;-)
Connection pooling ?
by
vlad_petric
·
· Score: 4, Insightful
All the OO features are nice, but what's really missing in PHP are some critical "enteprise" features, like true connection pooling (and no, pconnect doesn't count).
--
The Raven
Stable my ass!
by
krumms
·
· Score: 4, Informative
I reported a showstopper bug two days ago that crashed Apache 2 hard.
It's been fixed now, but I don't see how they can go and say "Oh, it's really really getting there now" after bugs like that have been discovered so recently.
But PHP's development is odd to say the least. In the Betas alone, entire sections of functionality have been rewritten. From scratch. I mean, shit.
Don't get me wrong, PHP is a great language and PHP5 is a step in the right direction but the development of PHP seems, to me at least, so hell for leather.
Re:Sys Admin stuff with PHP? Really?
by
solidox
·
· Score: 2, Interesting
i got a few php scripts on a cronjob to do database backups and such things. i also use it for quick admin type hackie scripts. personally i recon it's far superior to bash/perl/etc for shell scripting
It's funny, I remember when it was a main tenet of programming that data should be separate from presentation. However, PHP has shown just how powerful integrating data and presentation can be through inlining code directly into a webpage layout.
As Perl seems to fade more into irrelevence, languages that hold onto a strong central theme like PHP, Python, Ruby, and Dylan are coming to the fore to take its place. Whenever I see a story about PHP, I think more about the death throes of Perl than about PHP itself.
I have been pwned because my
Hmm... why do we always get new expressivity features and library extensions, instead of new safety features and ways for statically checking our code (such as type checking, a novel but, admittedly, completely impractical and academic invention that only freak languages use)?
I guess because people like me prefer to complain and use other languages instead of fixing unsafe ones...
Old but still funny.
Student Suspended Over Suspected Use of PHP
Didn't have to jump through any hoops that weren't explicitly mentioned to get it installed, and haven't noticed any problems so far. Hopefully this is a sign that the official PHP5 is soon to arrive.
Try not. Do or do not, there is no try.
-- Dr. Spock, stardate 2822-3.
move to PHP
Indefinitely Detained US Citizen
I guess a lot of PHP user base was once doing mod_perl and CGI. I personally use JSP, but often find it too cumbursome for quick hacks.
for the last time people, I am "frodo from middle eaRTH", not "middle eaST".
be careful upgrading, as the semantics regarding object assignment have changed from copy to reference. i know some of my code would make use of the old copy-on-assignment semantics.
other than that, looks like version 5 introduces some cool stuff, ala java. abstract classes, exceptions, method visibility, and interfaces to name a few. can't wait to give it a try.
- for all but the most trivial sites, separating code & presentation is a Good Thing
- PHP supports this kind of separation. google for template libraries.
Huh?
Having been a big PHP fan, let me assure you that PHP has a strong central theme like a kleptomaniac with ADD has a strong attention span.
Having been a big PHP fan, every story about PHP releases reminds me of the page long list of vulnerabilities and issues under it's entry in netbsd's package listing.
Having since moved to perl, I'm wondering if those death throes you're talking about are the same ones that haven't arrived on my BSD machine yet...
I just think about how easy it is to create something with PHP. Not necessarily the death throws of Perl. I started with CGI and Perl, and did quite a lot of it many years ago. I've worked with ASP too; I liked the flow of it, but it was too microsoft centric. When I came to doing web programming again, PHP was what was available, and I LIKE IT! Very powerful.
Any language that has a 4000 page Help document that is extremely easy to use and find information, is an excellent programming language.
http://github.com/gbook/nidb
lol, good point.
I've been playing with PHP5 since Beta1 and honestly, I've never noticed any stability issues with it. Of course, that's not to say that it was stable (could have been bugs or security issues).
PHP5 has really great Object Oriented functionality. I'm glad to see that it isn't far from being released.
A "release candidate", by definition, is thought to be stable, but they're not quite sure enough to declare it in the stable release yet.
You'll know it's stable when porn sites start transitioning to it. Consider the load testing that they are able to throw at any software.
I remember reading within the PHP docs about how unsafe it was to use the 2.x release branch of Apache with PHP...something to do with thread safety if I recall.
Anybody know if PHP 5.x has overcome this limitation?
Speed: they're all "fast enough." All of these scale well enough that for most sites you won't care, and none of them really scale well enough to support something like cnn.com. [Read through the archives to get a feel for the pain /. has to go through to serve its audience, for instance. And /. isn't even THAT big.] No flame; just that all these options are low/middle end.
/. is a case in point. There's a reason /. doesn't upgrade to the latest & greatest very often.
/. I know, but of these, ASP.NET is probably the best choice. If you want a toolkit/language that won't make site maintenance hell, OpenACS (tcl) or Zope (python) is probably a better bet. If you want something that will scale to absolutely huge levels (like the aforementioned CNN), J2EE is about the only game in town. (But a living hell to code for -- not recommended for smaller projects!)
Ease of use:
Classic ASP is pretty close to Perl. ASP.NET is a rather different paradigm, with a slightly steeper learning curve but more than enough added power to make it worthwhile. Unfortunately ASP.NET is a classic "leaky abstraction;" it tries to make things simple that sometimes aren't, and this will bite you.
Perl: it's nearly impossible to maintain a substantial site in perl with multiple developers working on the code. The language works against you here. Again,
JSP: takes a PHP-ish approach but Java is a statically typed language which makes using it for web apps _extremely_ verbose in comparison to the other languages here.
Javascript: poor fit for server-side use. Nobody does anything serious with it that way.
Verdict: They all suck to one degree or another. It's heresy on
I think you are referring to sites that get killed from too many connections to MySQL (due to the poor defaults in MySQL). As someone who programs for high traffic adult sites, I can attest that PHP can handle loads of traffic with ease, it's the databases that usually fuck up first. And even then that's usually just due to retarded coding practices.
/. uses MySQL without apparent problems, but then again there's a lot of page caching.
Funny enough though,
Hammer of Truth
An article discussing some of the new PHP5 features.
MT runs on Perl, (not even mod_perl at that) not PHP.
If it ran on PHP (or even mod_perl), it probably wouldn't have the scability issues it currently has.
...why do people mod this shit up? It's NOT fucking insigtful, it's redundant. The entire parent post could be removed and no one would think anything different than if it was never posted to begin with. It's just repeating shit that was already said and is so blatantly fucking obvious to anyone who cares enough to use it.
"RC1 != Stable". No fucking shit, Captain Obvious. That's why it's a RELEASE CANDIDATE *gasp*. Nowhere did it state "Put this on your production machines at once." It said "stable enough for people to start playing with."
Let me guess, the sun is yellow?
Modding this shit up just encourages people to post brain-dead information and therefore makes everyone stupider in return. So don't do it.
I wonder if I can install both so I can play with php5.
http://saveie6.com/
(I see plenty of Windows users adding PHP to systems that already support ASP)
In any case, all the talk of "good" design ignores all the new and not hardcore coders who can play with something like PHP (as well as ASP) but not so much Perl.
(note aslo that Apple includes PHP on their OSX boxes)
My point is that, in my opinion, one of the things so nice with PHP is that it's just fun to play with. If some coders want to "inline" their code, let them, and let them have some fun, eh.
It's like the pre-Web days when "designers" got into scripting with HyperCard and Lingo.
Everybody's welcome.
Here's what I do: Bitty Browser & Andromeda
heh heh - you said "load"
Mind the gap
Having browsed only a few ASP.NET howtos but not having had the opportunity (or misery -- since this IS slashdot) to code in it, I'm not too familiar with ASP.NET
OTOH, I am a bit more involved in programming in PHP. I think it's fairly nice and simple enough. Haven't gotten into a lot of the OO stuff but it's still fairly powerful with the simple things I do.
From what I've read, ASP.NET abstracts a LOT of the stuff from the programmer. Forms pretty much take care of themselves, validate on their own, and repopulate themselves for the user to correct. Among other things, this helps isolate code from content.
From experience (which may be very limited), PHP doesn't have this feature. This allows for so much more control over what happens to your forms, but also introduces more code into the mix which could get ugly after a while.
Thus we have control vs. abstraction -- a classic debate. Convenience and rapid development would lean towards abstraction (as anyone who coded VB may argue). Would be nice if PHP had that n00b convenience somewhere while still being great for more advanced coders.
Ultimately, control is probably the choice for anyone who wants to get past the abstraction. Besides, in the long run, you'd probably want to write your own data validation code (or at least implement an open-source version) instead of relying on a (closed-source) language to check for you. That's simply a matter of trust.
Yes, I've run php5 and php4 on the same box for almost a year. There are a handful of howto's for running two modules under apache, for examplea quickl Google gives me: www.schlitt.info/applications/blog/archives/83_How _to_run_PHP4_and_PHP_5_parallel.html
http://tinyurl.com/4ny52
For people who think there must be something better to write web-based applications than PHP, I invite you all to take a look at Seaside by Avi Bryant, a web framework available for Squeak and, I think, VisualWorks Smalltalk. It uses continuations to make programming a web application basically the same as coding a desktop application. It features many, many things that PHP cannot do.
For those of you who don't know PHP, just wait a version or two. It already supports VB, C, C++, Javascript and Perl style coding. Version 5 is basically Java. Expect Intercal, Unlambda, and BrainF*** support by version 7 or 8. If you know a Turing-complete language, chances are you'll be able to use it to code PHP by the end of the decade.
WARNING: there is a trojan on your
What advantage does PHP have over Perl?
At first, I rejected PHP because of its (apparent) preference for intermingling presentation and logic. As has been thoroughly discussed in another thread, separating the two is not only possible but recommended. That doesn't give PHP any points though -- it just removes a penalty.
Both languages have a wide range of libraries/modules to choose from (although I think the score here goes to Perl). Their syntax is nearly identical. They both run on lots of different platforms. PHP is pegged as a tool for making web sites, while Perl is a general-purpose scripting language that happens to be useful for web sites too.
So, make a business case for me. I manage a development team (I rose from the ranks so save your MBA jokes for another day) and I want to know why I should consider PHP over Perl.
irb(main):001:0>
Don't use PHP 5.x yet for production. Wait until it's released (at least), or a few months after the initial release.
I have a webpage on how to build and use PHP with Apache 2.x at http://dan.drydog.com/apache2php.html 4.3.4
A test run of our PHP setup on PHP5 RC1 seems to be more responsive and crisp than it was on PHP4.
Riiight. "Crisp". Yeah, that sounds like a very analytical test run you did. Did you also notice PHP5's woody undertones and how it satisfies the spirit without weighing down the heart?
So does PHP5 have proper Unicode support, or are we still supposed to pretend that you can treat UTF8 as ASCII and that it will 'just work'?
You got to be kidding.
PHP has two primary strengths: architecture and standards.
Java is a general purpose language build from the ground up as an OOP. Java is used from embedded systems, mobile phones, desktops, webapps to world class enterprise projects. Java has a sound definition as a language and its virtual machine. Java standards are defined by the JCP with formal methods for approving changes including Apache.
AFAIK PHP is used only in webapps. OOP was added as an afterthought. PHP is a project of the Apache Software Foundation.
Architecturally has native standard access to databases and there are drivers for every db, supports distributed transactions, has message queues, takes advantages of multiprocessors, JIT native compilers in the VM, libraries for every need. Don't know about PHP but for what I know Java has a more advanced architecture.
The majority of java webspace applications were written before css and xhtml were mainstream.
What apps are you talking about? The PHP changelog shows that PHP 4.0 was released in may 2000. The great mayority Java webapps are based on servlet API 2.2 or later which where release on april 2000. Please explain how Java apps are less suportive of css and xhtml than PHP. BTW, how many PHP 3.x webapps are there?
I predict that there will be a need for css and xhtml conversions among the big java web apps and this will be readily delegated to PHP.
If I would have a Java webapp that needs to support css and xhtml it would be ridiculous to rewrite the app in another language, when it could be easily adapted. How would I explain it to my customer? There's nothing in Java or PHP that prevents using css or xhtml or making them automatically supported.
I don't mean that PHP isn't useful, but Java has just a broader scope.
"I think this line is mostly filler"
If you're wanting to learn about all the wonderful new features in PHP5, then grab this book. It covers more advanced topics (hence the name Advanced PHP Programming) but it's an absolute must for serious PHP developers. If you're a beginner, learn PHP in general first, then grab that book.
Gabriel Ricard
PHP has a smaller syntactical (is that a word?) footprint. As you said that you manage a development team, this is important. The Perl motto of "There's more than one way to do it" becomes an issue when you've got multiple developers working on the same codebase. You can write and (attempt to) enforce code style rules in your organization, which mitigates this a little bit, but it takes time to write those guidelines, get buy-in, and enforce.
I use perl often, but I consider it a "fire and forget" language. I use it for sysAdmin type work often, when I'm doing something once, and want to write a quick script that nobody (including me) will ever lay eyes on again. For real development, where I'm trying to create a maintainable piece of software, with input from other developers, I stick to PHP.
Most of our company's web applications are written in PHP, but that isn't where php has the heaviest use in our company. I have the CGI version of it installed on all of our Windows servers, and use it as the *shell scripting language* for our Windows boxes. It's like batch files that can use complexed logic, network protocols, database connectivity, and best of all. It's absolute ease of use. It has made alot of my Windows jobs a breeze to automation and manage.
I used to be a PHP developer, but switched to python-based content management systems due to the elegance and ease of programming in python. However, I was interested to see how PHP had progressed since the last version, and read the article linked by Slashdot.
The main reason I initially dumped PHP was its atrocious error handling. Python and other more elegant languages use exception handling, which is much more elegant than checking return codes and setting error handlers.
I had read earlier than PHP 5 would include exception handling, but wouldn't include the "finally" clause. For programmers that understand and use exceptions, the finally clause is _very_ useful. I try to avoid using C++ simply because it doesn't have a finally clause (and no, the object destruction mechanism is not a good substitute).
So, I became very excited when I read the following:
Note that there is support for "catch all" and for the "finally" clause.
(http://www.php.net/zend-engine-2.php)
However, I couldn't find any examples showing the "finally" clause or the "catch all" clause in use.
So, I went grepping through CVS.
In the changelog for PHP, it is suggested that all exceptions _must_ inherit from a base 'Exception' class, which means that catching and exception of type 'Exception' is a basic "catch all". However, I couldn't find _any_ evidence in CVS that a "finally" clause has been introduced in PHP 5.
Has anyone here found evidence that the "finally" clause exists in PHP 5?
Devin
References work well enough. Show me where you've been constrained.
magic_quotes - you're totally right. Teh are the SuX. But it's not hard to work around. You just have some low-level test that checks the mq setting, and then conditionally addslashes() or not. It's not *that* hard. It's just one of those things you figure out when you realize that, for example, you're writing code that you're going to publish.
OK, I tried using XML & XSLT under PHP a couple years ago, for the CMS system which is linked in my .sig. It was one of the most frustrating experiences of my life.
/. will quickly point that out :)
Firstly, it required that PHP be recompiled with the Sablotron module, which would have made the software inaccessible to most of its current user base.
Secondly, writing the XSL stylesheets was complicated as hell. The learning curve associated with them would have made the software inaccessible to ~96% of its current user base, probably including me. (it now uses its own templating system which allows designers to create the templates.)
Has any of this changed? For example, are there any WYSIWYG editors which make it easier to write stylesheets? Will PHP 5 have XSLT capabilities built-in?
Or am I missing something? Is XSLT really not as hard to get started with as I think? (If I'm just a dumbass, I'm sure someone on
Lighten up Francis ;-)
All the OO features are nice, but what's really missing in PHP are some critical "enteprise" features, like true connection pooling (and no, pconnect doesn't count).
The Raven
I reported a showstopper bug two days ago that crashed Apache 2 hard.
It's been fixed now, but I don't see how they can go and say "Oh, it's really really getting there now" after bugs like that have been discovered so recently.
But PHP's development is odd to say the least. In the Betas alone, entire sections of functionality have been rewritten. From scratch. I mean, shit.
Don't get me wrong, PHP is a great language and PHP5 is a step in the right direction but the development of PHP seems, to me at least, so hell for leather.
i got a few php scripts on a cronjob to do database backups and such things.
i also use it for quick admin type hackie scripts.
personally i recon it's far superior to bash/perl/etc for shell scripting