The Joel on Software Discussion Group (CLOSED)

A place to discuss Joel on Software. Now closed.

This community works best when people use their real names. Please register for a free account.

Other Groups:
Joel on Software
Business of Software
Design of Software (CLOSED)
.NET Questions (CLOSED)
TechInterview.org
CityDesk
FogBugz
Fog Creek Copilot


The Old Forum


Your hosts:
Albert D. Kallal
Li-Fan Chen
Stephen Jones

PHP more maintainable than Perl, also Pepsi way better than Coke

You know, as much as I hate to see Joel backhand ole Perl, I've seen it done before (http://www.cabochon.com/~stevey/blog-rants/blog-ancient-perl.html) and I'm over it. Whatever. It's not a real object oriented language, too many idiosyncrasies, yadda yadda yadda I woke up next to python.

But, I mean, PHP?? Uh, what?

Weekly root exploits, a thousand ways to escape a DB insert, object oriented is even further behind in adoption than Perl (there's actually tons of pretty clean oo Perl code, on CPAN), doesn't play well with apache2.

Oh but it's popular. Yes, it's very easy to find PHP programmers. You know, it's also pretty easy to find JavaScript programmers! COBOL was apparently pretty hot at one point.

It's not that I have anything against PHP. I mean, people seem to get sh*t done with it. And they're not all friggin frigtards. Even 37 signals built their website in PHP and those guys are supposed to be the bees knees.

But ... PHP is industrial strength, Python is halfway there, and Perl is ass?

Yes. Also: Toyota can be deeded to your grandkids, but Honda will explode before you drive it home; Heath tastes totally incredible and Skor will make you vomit.
a Hack
Friday, September 01, 2006
 
 
Yeah, the pragmatic world is unfair. I second your distrust of PHP, but if you can hire the best and keep them hired for years, PHP might suffice. The rookies can get schooled by the experts so they don't blew ths systems when they touch them.

For instance, here's an article on security of PHP:
http://www.phphacks.com/content/view/30/33/
Lostacular
Friday, September 01, 2006
 
 
BTW, security of web apps is an issue of all languages. All it takes is some misuse, assumption or ignorance.
Lostacular
Friday, September 01, 2006
 
 
"But ... PHP is industrial strength, Python is halfway there, and Perl is ass?"

Perl is ass for web development.  They had the hugest headstart imaginable for being a web scripting environment and it's still ass. 

There are the same number of people talking about using Perl for web development as Lisp...  what does that tell you?
Almost H. Anonymous Send private email
Friday, September 01, 2006
 
 
"You know, it's also pretty easy to find JavaScript programmers!"

What do you mean by this? Do you imply that Javascript is an inferior language in some way?
Berislav Lopac Send private email
Friday, September 01, 2006
 
 
You know, I never really got to like PHP as a language. But as a tool to accomplish a goal it has allways served me well! Never really learnt it, but somehow it's easy to wing and does most things as expected....
Daren Thomas Send private email
Friday, September 01, 2006
 
 
"There are the same number of people talking about using Perl for web development as Lisp...  what does that tell you?"

Where do you get those numbers from? There's lot of midrange/highend web development going on in perl. Lot and lots of high-end sites use it. For instance, amazon.com is a perl shop. Yahoo has lots of perl in production. Livejournal is a perl site. Sure, coding CGI in plain perl is kinda last century, but why do that when you've got a plentora of MVC frameworks, templating systems and ORMS to choose between on CPAN?
Marcus Ramberg Send private email
Friday, September 01, 2006
 
 
I really have to agree with Daren Thomas.  His comment applies to all KINDS of 'languages'.  Perl, PHP, shell, etc.  They may all be total crap, but I can get things done in them. 

I try to be kind to the next person who has to work with that tool, since these tools have a way of outliving their authors, but there you have it.
Michael Dwyer Send private email
Friday, September 01, 2006
 
 
Berislav, JavaScript is better than Perl in some ways, for example it has a very clean modern object model. And it's indespensible (and turing complete) on the client side. But that doesn't mean it's appropriate for building a large-scale Web app on the server side!
a Hack
Friday, September 01, 2006
 
 
If Perl is ass, then in what key ways is PHP NOT ass in comparison?

The criticism I have always heard of Perl is that it is unmaintainable, other programmers cannot build on your work as easily, too many ways to do things. How does this not apply to PHP?

Or does the sheer mass of PHP in developer momentum help in some concrete way?
a Hack
Friday, September 01, 2006
 
 
"The criticism I have always heard of Perl is that it is unmaintainable, other programmers cannot build on your work as easily, too many ways to do things. How does this not apply to PHP?"

PHP is simple.

I won't claim that it isn't ugly.
(although with PHP5 you can smooth over the ugly bits pretty well)
Almost H. Anonymous Send private email
Friday, September 01, 2006
 
 
aHack, you're quite correct about Javascript; I just wanted to make sure. It's surely a shame that one of the best modern languages doesn't have a decent server-side implementation, and I keep hoping someone will create some that will catch on.

Actually there have been such efforts to that end, although few have really caught on: http://en.wikipedia.org/wiki/Server-side_JavaScript
Berislav Lopac Send private email
Friday, September 01, 2006
 
 
Berislav, like many people I recently picked up JavaScript after a long hiatus. I read the thick O'Reilly Definitive Guide (4th ed) first.

In my very limited recent experience, I really wish JavaScript had a proper foreach loop (I know about "for ... in" but it's not nearly the same, and another for var i; i<array.length;i++ loop I will go crazy) and a "map" method or function.

I get the feeling it would be a great server side language with some tweaks and lots of libraries, which is probably the trickiest part. But everyone will already know it from AJAX work so it could definitely happen.
a Hack
Friday, September 01, 2006
 
 
Almost H that's a good point. To go from perl code to Web page is at LEAST two files, a perl script and a template, plus you have to know which modules to pull in. And if you want community support and good libraries you'll quickly want to move to three layers (MVC), and then you have to choose librarieries again.

Then if you want to go fast you need mod_perl, which requires at minimum a virtual server. PHP can sprint with one file uploaded to a shared host.

I still argue, though, that for an enterprise-size app, where you're definitely going to be doing MVC, Perl likely has at least equal number of experienced coders out there as PHP, and probably more and more coherent modules. But I've not spend significant time in the PHP world.
a Hack
Friday, September 01, 2006
 
 
With mod_perl you only need one file to get going. Sure it's on a server, but so is PHP. And a module in perl is ready to be unit tested, ran thru a debugger and/or profiled much easier than a PHP script.

PHP's main advantage is that there are lots of hosted PHP solutions, and with perl ... one really wants to have access to install more libraries, as it CPAN already has most naything you need.

There is a danger that perl will become the COBOL of the future as support and development is falling behind (a recent Linux distro had a non-functioning perl profiler, imagine if it didn't have PHP or mySQL, they'd never hear the end of it!).
Spinoza Send private email
Friday, September 01, 2006
 
 
Spinoza, you need just one file if you're willing to put the HTML inside the code, which is pretty icky. With PHP, the code is inside the HTML, much easier to deal with. My point was that with perl, you're gonna need a template alongside the code .

 And mod_perl won't work on shared hosts due to security issues with shared memory (yes PerlRun works but that doesn't buy you much).
a Hack
Friday, September 01, 2006
 
 
"I really wish JavaScript had a proper foreach loop (I know about "for ... in" but it's not nearly the same"

And why is it not? If only because foreach gives you a separate variable for the key and another for the value, that is simple to emulate with:

for (bar in foo) {
    baz = foo[bar];
    document.write(baz);
}
Berislav Lopac Send private email
Saturday, September 02, 2006
 
 
Berislav:
"It's surely a shame that one of the best modern languages doesn't have a decent server-side implementation, and I keep hoping someone will create some that will catch on."

I thought the same thing a few years ago. It seems like the only thing that stopped JavaScript from becomming a really great server-side scripting platform was a lack of a hierarchical library importing system.

The only way to build modular software with JavaScript is just to lexically include one file into the global context of another file.

If JavaScript had similar package/import semantics as Java, then server-side JS would have become popular years ago.
BenjiSmith Send private email
Tuesday, September 05, 2006
 
 
Benji, it apparently hasn't prevented PHP from becoming a major server-side Web platform.

But I agree, some kind of hierarchical imports and/or Python-like namespaces would certainly be a great step ahead.
Berislav Lopac Send private email
Tuesday, September 05, 2006
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
 
Powered by FogBugz