Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re^3: Is Perl the right language for a large web application?

by DaveBrighton (Initiate)
on Apr 19, 2013 at 09:45 UTC ( #1029491=note: print w/replies, xml ) Need Help??

in reply to Re^2: Is Perl the right language for a large web application?
in thread Is Perl the right language for a large web application?

I think PHP does appear easier, since you can usually read exactly what's happening and people recognise the PHP doing stuff within a familar HTML structure. Although maybe that's with dancer etc now - it's a long time since I used perl CGI. It's also the case now that people assume that PHP is the thing to use. Poeple even talk about the LAMP stack (which is pretty standard and powerful, I have to say)
  • Comment on Re^3: Is Perl the right language for a large web application?

Replies are listed 'Best First'.
Re^4: Is Perl the right language for a large web application?
by tobyink (Abbot) on Apr 19, 2013 at 11:27 UTC

    One of the main reasons PHP is easier for a lot of newbies is that their web hosting company has already set things up to make things as easy as possible. Just rename one of your HTML pages ".php" and you can start sprinkling in some code.

    Perl, if your web host supports it at all, is probably running via CGI (fine for small scripts, but not the most efficient method for large scale projects); modules that could make your life easier, like Plack, may not be pre-installed, and installing them without root access may be non-obvious; for people who have never touched a Unix command-line before, even trivial things like chmod +x represent a major barrier to entry.

    This is fixable but would require co-ordinated effort from the Perl community. For example: a web-based control panel to make it easy to manage local::lib directories, and which would also provide one-click glue between Apache and a PSGI application. (Plus evangelism, evangelism, evangelism to get this widely pre-installed by major hosting providers.)

    While PHP is easy to get started, it also has drawbacks that make PHP development harder in the long term for bigger projects. Until very recently, namespace management was poor, meaning that every part of your code had to be careful not to tread on every other part's function names. All functions lived in a single flat namespace. (Class methods being an exception.) Namespaces were introduced in PHP 5.3, but are not yet widely used. None of the many, many, many built-in PHP functions are namespaced. Most large PHP projects (e.g. Drupal) still use a flat namespace.

    PHP's OO model is less flexible than Perl's too. With the recent addition of traits, it compares favourably to languages like Java and Python, but it's still not up there with the mighty Moose. With fewer options for recombining different bits of code into different objects, DRY can suffer.

    There are other things, but I won't bore you all.

    Incidentally Dave, we appear to live around the corner from each other. (On a planetary scale at least.)

    package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1029491]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2017-02-22 20:56 GMT
Find Nodes?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?

    Results (335 votes). Check out past polls.