Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

RE: Combining PHP and Perl

by pandr (Acolyte)
on Oct 15, 2000 at 12:44 UTC ( [id://36799]=note: print w/replies, xml ) Need Help??


in reply to Combining PHP and Perl

A lot of wise advise has been given already. There is one additional point you may want to consider. It is somewhat related to Tom's "GUIs Considered Harmful". The whole post can be found at guis but I will quote a small part here:

"It's all well and good to place a GUI wrapper around an existing tool, but to design a new application with only a GUI interface in mind is to forever limit that tool's flexibility."

Because web programming is similar to gui programming you have the very same pitfalls. Consider a portal like site where users are allowed to create accounts. You may start by implementing this in pure PHP (the create_account.phtml page) and this typically involves DB access, password checking and what not. As your site grows you want to be able to administrate it in a more effecient manner, so you write a command line tool (in Perl) to allow quick (i.e. scriptable) handling of the accounts. This is were the pain begins. Now you have identical logic (SQL-statements, password checks, etc.) implemented in PHP and in Perl. Of course you know that is bad, but if you have thousands of lines of PHP code you are trapped!

I am not saying PHP is bad. I use it myself from time to time. But I have seen people get burnt by the above scenario.

(Yes, I know PHP can be used to create command line scripts, but that is definitely NOT where its strenghts are, IMO)

Replies are listed 'Best First'.
RE: RE: Combining PHP and Perl
by footpad (Abbot) on Oct 15, 2000 at 22:23 UTC
    Now you have identical logic...implemented in PHP and in Perl.

    I have noticed this myself, even in the admittedly simple uses I've put these two. One my sites is based around templates originally generated by PHP3. Given PHP's security problem with multi-part forms, I decided to implement an upload process using perl.

    In doing so, I found that I had to re-design my template process to make them easier to share between PHP and perl. While a reasonably trivial task, it did take some time that I could have used for other portions of the project.

    The lesson, then, is to take some extra time during your design phase to make sure that your implementation can suport multiple tools and processes.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://36799]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-25 22:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found