Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

sigmadog

macrumors 6502a
Original poster
Feb 11, 2009
835
753
just west of Idaho
I have been working with a client for a few years, doing minor maintenance on their site (which was created by another designer a few years ago in straight html). During that time, I have been subtly suggesting that when it came time to re-design their site, they should move it to an Apache server so that I could utilize PHP to help modularize the site, making maintenance and revisions easier.

Well, they just notified me yesterday that they are contracting with a new host server, and that they will be building the site using Perl, and would I be interested in doing it.

Since I don't know Perl, I can't really take the job on, but it brought up the following questions:

The last time I looked at Perl was way back in 2000 or there about, so I've been out of the loop for a few years, but it seems to me that, in terms of building a simple informational web site with some modest interaction (a form here or there, and occasional image swapping), isn't Perl a bit of overkill, and wouldn't PHP/javascript be much simpler to develop with, and easier to maintain?

Also, since Perl usually runs on Linux/Apache, isn't it a simple matter to also include PHP on the server?

It's rare to come across a web host that has one but not the other.

Am I wrong here?
 
Well, they may have PHP support, they only said they would be using Perl. I wouldn't say Perl is overkill, just more old fashioned. I know some Perl and like the language, but mostly use it for admin tasks like running backups and doing cleanup jobs from a cronjob on my web host.

In terms of what would be easier, it's all in what you know. Some people are more comfortable with Perl, others PHP, and others yet .Net. They can all get the job done, it just depends on the developers to choose the language they feel best for them.
 
Personally I would say Python or Ruby would be better than either Perl or PHP but I would rate Perl higher than PHP.

I have absolutely no idea why so many people seem to think PHP is such a great language. When you have choices such as Java or Python to work with why would you use a language like PHP?
 
language choice for web programming is mostly personal preference. only rarely is there an obvious choice. usually it has more to do with server type and programmer knowledge.

perl is a fantastic language. it is what i started on, and tho i mainly do PHP now, perl is still where my heart is.

what's the difference between the two? not much, really. PHP was based off of Perl syntax. and while they have strayed over the years, transitioning between the two can be easy. the only thing 'old fashioned' about perl is that by default you are limited to the CGI-BIN. naturally you can configure your webserver to alter this if you want.

as to why someone would ever use PHP: there is a structural advantage to putting a script into the page file, rather than having it called from the CGI-BIN. it makes for cleaner website structures, and, i have found at least, less repeat HTML coding.

that being said, i've done all of that too with Perl, .htacess and text files.

Java has even jumped on this with JSP pages. admittedly my python is rather new, i taught it to myself to crunch numbers for an aerodymanics class, but i can see why it is well liked.

PHP was built to work with MYSQL and because of that became a strong language for database prgramming.

IMHO, perl would do what you wanted fine (yes sorry, back to the original post). a simple form is one of the oldest CGI scripts out there. rotating images can be done in javascript. but like i said, with the similarities between Perl and PHP, both can handle it.

sorry if that was a bit of a ramble.
 
Well, they just notified me yesterday that they are contracting with a new host server, and that they will be building the site using Perl, and would I be interested in doing it.

Is the new host the only reason they want to use Perl?
 
there is a structural advantage to putting a script into the page file, rather than having it called from the CGI-BIN. it makes for cleaner website structures, and, i have found at least, less repeat HTML coding.

And some major disadvantages. If you aren't careful, program logic becomes inextricably linked to presentation, which makes it next to impossible to maintain consistency or to change the look of your site. (This isn't exactly PHP's fault as a language, but PHP makes it easy to end up in that situation.)

There can also be a security advantage to keeping all executable code in the same place, if you do code reviews. Most people don't do that anyway though.

My preference is to use a template language instead of mixed HTML and code. PHP allows you to execute arbitrary code inside a code block, while most template languages limit you to simple control structures (if/else and loops). That way you are forced to move complex logic out of your presentation.
 
And some major disadvantages. If you aren't careful, program logic becomes inextricably linked to presentation, which makes it next to impossible to maintain consistency or to change the look of your site. (This isn't exactly PHP's fault as a language, but PHP makes it easy to end up in that situation.)

There can also be a security advantage to keeping all executable code in the same place, if you do code reviews. Most people don't do that anyway though.

My preference is to use a template language instead of mixed HTML and code. PHP allows you to execute arbitrary code inside a code block, while most template languages limit you to simple control structures (if/else and loops). That way you are forced to move complex logic out of your presentation.

agreed, esp with the security.

what i do is make the template.php file with variables in it, so the presentation can be altered, but $header, $content, $footer, etc. are still constructed by the scripts.

but in the end it still goes back to the programmer. i suspect that your php files would be well constructed (perhaps better than mine, since i am a hobbiest at best) whereas someone else's could be like reading VBscript.

(sorry to anyone who uses VBScript, personal grudge, nothing more)
 
Perl, it seems to me, is one of the easiest languages to learn, and one of the hardest languages to learn to program right.

Cliff has spoken :)
 
Java has even jumped on this with JSP pages. admittedly my python is rather new, i taught it to myself to crunch numbers for an aerodymanics class, but i can see why it is well liked.

I wouldn't say Java has jumped on anything. Java Server Pages were released in 1999.

PHP 3 (the first version to be similar to todays version) was only released officially in 1998.

The advantage of Java is a clear separation of logic and presentation. Logic is performed in the Enterprise tier while the web tier is solely dedicated to web pages, servlets and web service frontends.
 
Is the new host the only reason they want to use Perl?

The site is for a credit union, and consists of a public section and private section. The public portion is all marketing stuff and general info; this is the stuff I, as a graphic designer, would work on. The private section is online banking in a secure environment for members; I have had, and will continue to have nothing to do with this section.

I suspect that Perl was chosen with the online banking aspects in mind, and little consideration was given to the marketing section.
 
I wouldn't say Java has jumped on anything. Java Server Pages were released in 1999.

PHP 3 (the first version to be similar to todays version) was only released officially in 1998.

The advantage of Java is a clear separation of logic and presentation. Logic is performed in the Enterprise tier while the web tier is solely dedicated to web pages, servlets and web service frontends.

and ASP was out in 1996 (tho if you wanted to argue it was useless until 2.0 in 97 i'd agree). at the time, Java was applets, and while its outlook was promising with enterprise and beans, this was in the 1.1, 1.2 era.

also this was height of dot-com boom, so a year delay was eternty. jsp was a reaction to the fact that applets were too damn slow. people weren't using them for anything (except asteriods, had that on my geocities page). sure you'd find it here or there, but not much. jsp brought speed to java that was much much needed.

now, let me be clear: i think java is the bees knees and have since the first day i heard about it. it has come so far since i first learned it in the 1.0 days it is unbelievable. and everything you said I agree with and is beyond my programming abilities.

but there is a reason why i learned asp then php and not JSP. Hell i couldn't find a Tomcat server in the 90's to save my life for any reasonable amount. we were pumping out perl and php (pretending to know MySQL but not doing so hot) and calling it a day.

now we know better. well, i do at least. that is why i am an engineer and not a programmer.

but this is a digression. perl still rocks.
 
I have absolutely no idea why so many people seem to think PHP is such a great language. When you have choices such as Java or Python to work with why would you use a language like PHP?

I prefer PHP to Java because of the weak typing. Its much more flexible for refactoring.

At the end of the day, however, languages don't matter too much, especially when picking a general purpose programming language. Anything can be done in any language and any programmer can learn a new language.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.