Larry is correct to point out that anything PHP can do...you can do with perl (mod_perl)...often better, and still keep the language you use for everything else. In this sense the rise of PHP has mystified me.
Why the need for a novel language to do web scripting? The only argument I can see is ease of installation and learning, but those aren't good reasons for serious developers.
I don't know - if I all I need to do is check some cookies and output a stylesheet based on those cookies, or dip into a database and sort and output some data, why do I need perl? I can do it quickly and painlessly in my page with PHP. No need to go around insulting those of us who use it as "unserious."
I see perl's coolness, but just to play contrary deity's advocate with you... why not PHP?:)
because PHP tends mixes content / presentation and control
It's the programmers that tend to mix the layers, not the language itself. You might think PHP's ability to mix logic and presentation is a fault. I disagree. Let's take a look at some of the things that Larry said about Perl, and apply them to PHP:
As for Perl, it has never been "structured" in that sense, though it has always been structured in the sense that you can create as much structure as you like. The whole point is that the structure is optional, not imposed externally.
This describes the PHP situation fairly accurately. As the programmer, you get to determine the level of structure. This week I've worked on two applications in PHP. One of them is a very unstructured little script so that my brother can get my dynamic IP address. The other is an OO content management system that uses templates for everything. If I had to use highly structured techniques for the first script, it would have been too much of a hassle to bother. If I'd written the second application in unstructured blender mode, I might as well not have bothered.
Now I'm not going to say that I haven't written big projects in an unstructured manner. I've also over-structured small projects. When you wield flexibility, sometimes the gun gets pointed at your foot.
Back to Larry: You have to have discipline to do programming in the large, but you'll choose the discipline by turning up the big discipline knob yourself, not by having someone else turn it up for you.
This is a philosophical decision, but it's one that I tend to agree with. Having the structures available lets you work on large projects. Not forcing you to use them lets you scratch the little itches. There is a ton of bad PHP out there, but that is the programmer's fault, not the language's.
Good point on PHP (Score:2)
Why the need for a novel language to do web scripting? The only argument I can see is ease of installation and learning, but those aren't good reasons for serious developers.
Re:Good point on PHP (Score:5, Insightful)
I don't know - if I all I need to do is check some cookies and output a stylesheet based on those cookies, or dip into a database and sort and output some data, why do I need perl? I can do it quickly and painlessly in my page with PHP. No need to go around insulting those of us who use it as "unserious."
I see perl's coolness, but just to play contrary deity's advocate with you... why not PHP? :)
Re:Good point on PHP (Score:1)
because PHP tends mixes content / presentation and control. and that mix does not scale well. and is a real pain fixing.
not that perl or java automatically fixes this it's just as easy to do in both, but i have seen it more in PHP websites.
Re:Good point on PHP (Score:3, Insightful)
because PHP tends mixes content / presentation and control
It's the programmers that tend to mix the layers, not the language itself. You might think PHP's ability to mix logic and presentation is a fault. I disagree. Let's take a look at some of the things that Larry said about Perl, and apply them to PHP:
As for Perl, it has never been "structured" in that sense, though it has always been structured in the sense that you can create as much structure as you like. The whole point is that the structure is optional, not imposed externally.
This describes the PHP situation fairly accurately. As the programmer, you get to determine the level of structure. This week I've worked on two applications in PHP. One of them is a very unstructured little script so that my brother can get my dynamic IP address. The other is an OO content management system that uses templates for everything. If I had to use highly structured techniques for the first script, it would have been too much of a hassle to bother. If I'd written the second application in unstructured blender mode, I might as well not have bothered.
Now I'm not going to say that I haven't written big projects in an unstructured manner. I've also over-structured small projects. When you wield flexibility, sometimes the gun gets pointed at your foot.
Back to Larry:
You have to have discipline to do programming in the large, but you'll choose the discipline by turning up the big discipline knob yourself, not by having someone else turn it up for you.
This is a philosophical decision, but it's one that I tend to agree with. Having the structures available lets you work on large projects. Not forcing you to use them lets you scratch the little itches. There is a ton of bad PHP out there, but that is the programmer's fault, not the language's.