Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Is Perl the right language for a large web application?

by walkingthecow (Friar)
on Apr 19, 2013 at 06:11 UTC ( #1029460=perlquestion: print w/ replies, xml ) Need Help??
walkingthecow has asked for the wisdom of the Perl Monks concerning the following question:

I've been using Perl for years now, but my experience with it has been mostly automating system administration tasks via command line scripts, and a few small web applications. I love Perl, regardless of all the readability issues people complain about. However, I am currently undertaking the task of writing a very large FOSS web application, and I have a few concerns:

1. Is Perl a good language for writing modern web applications? Any good examples of web applications written in Perl?
2. I often feel that people look at Perl as some language from 1998, and Python is the new big thing. I'd like for people to want to use what I am working hard on, so this is a big concern for me.
3. I really don't want this to turn into a big debate, but what are the advantages of using Perl for this over Python or Ruby on Rails, and vice-versa. Is there any resounding reason not to use Perl? I am quite comfortable with Perl, and have only really tinkered with Python, so I'd really like to use what I am comfortable with. I'd love to hear any other reasons there may be for choosing one over the other. (I don't care about frameworks really. I think I am doing this from the ground up.)

Any input you all may have is greatly appreciated. Thank you!

By the way, the web application is basically everything and the kitchen sink, so I see it being a very large project.

Comment on Is Perl the right language for a large web application?
Re: Is Perl the right language for a large web application?
by jakeease (Friar) on Apr 19, 2013 at 07:18 UTC

    Take a look at Catalyst and see if it would be suitable. I recently spent 4 years working on an outdated hand-coded CMS that started back in 1996 and I understand your angst. I'm just starting w/ Catalyst; it looks like a good choice to me.

    Update: "outdated" was not the most accurate description there. It handles constant updating to 200 websites, getting 40 million unique visitors per month, and over 250 million page views per month.

    With four Perl programmers, we were quite busy making requested mods, bug fixes,and content updates.That kept us plenty busy.

    So the better term would have been "not modern." Especially since Modern begins with 5.10. We did switch up to 5.8 during that time.

      Thank you for pointing me in the direction of Catalyst. Initially, I was thinking about doing this without using a Framework, but Catalyst looks to be quite flexible and I can see it saving me a lot of time.
        In addition to Catalyst, I would recommend that you also look at some of the newer webapp frameworks, such as Dancer and Mojolicious. Personally, I prefer Dancer, but your taste may vary.

        Regarding point 3 in the original post, the #1 reason for you to choose Perl for this project rather than Python or Ruby is that you present yourself as already being significantly more proficient in Perl than the others. All three languages are more-or-less equivalent technically, so the most important criterion to consider when making a free choice between them is "Which one do I know and like best?"

      Hi,

      I am writing PERL web applications for over 10 years now. A video one of them is here: http://youtu.be/nHXZ-44nOUo.

      My way of building them

      Install an Apache versrion >2, mod_perl, DBI/DBD, CGI, CGI::session, create a set of directories: cgi, css, js, lib, img and tmp, RTFM about PERL and CGI (http://oreilly.com/catalog/cgi2/chapter/ch08.html) and build your application. Scale out with the Apache features (mpm and cluster), set up your database as a cluster and your corporate application is alive.

      The way to build them which pleases your manager

      Install Catalyst. During the time you will read the Catalyst books, my application will be in production. However Catalyst has a lot of tools and your boss will definitely like it. It might even become strategic.

      The result

      In both case you will have with a state of the art application, which will be built at reasonable, if not record breaking costs. Provided you write proper code, your application will run over 10 years without any problem.

      Major projects written in PERL

      Switzerland, state of Geneva, Justice department: This department is using PERL to realize a web application to manage all court procedures. The project manager introduced it to me and is happy about his choice regarding PERL. It is the biggest PERL project I know.

      Metadot: Metadot is portal written in PERL. At the time I used it, it did not work under mod_perl and had a lousy performance. It is however a good portal.

      Amanda: Amanda is the backup system I use. It is an open source software delivered with most Linux distributions. It is also the example of what you should not do. The PERL code was badly written and issue arose as PERL 5 was introduced. If I remember it correctly foreach $tmp @list is legal in PERL 4 but not PERL 5. So Amanda was not working any more! Accordingly avoid cheap code in PERL! In other words: best practices are a must!

      Alternatives listed in your post.

      Ruby: Forget it. The only time I had to use Ruby the code did not work because of deprecated method usage. Such a language can definitely not be used at corporate level.

      Python: No clue! Never used! Notice I heared of Python allready in 1993! In fact it was released in the late 1980s!

      The problems

      You state the problem yourself. PERL is badly perceived mostly because too much lousy code was written with it and security issues appeared. An article I read in 2000 about it was cited to me again during a security review in 2008! Now make a guess of your major issue: the management:

      • Management does not like PERL because they are not a lot of programmers around.
      • Management does not like PERL because the corporation next door does not use it.
      • Management does not like PERL because you can write lousy code with it.
      • Management does not like PERL because they can not sue someone in case of failure.
      • Management does not like PERL because they do not even know about it.

      These are your problems and the problems I faced and still face after 15 years of freelance consulting for major international corporations. Notice a multi with over 40'000 employees did not want to used it because PERL is open source, but it was installed on the corporate laptop I got as part of the operating system!

      Good luck

      K

      The best medicine against depression is a cold beer!
Re: Is Perl the right language for a large web application?
by HelenCr (Monk) on Apr 19, 2013 at 07:24 UTC

    walikngthecow: this is a good question, that I (and many others) have been wrestling with, from time to time.

    In my opinion, in comparison to Python, Perl is more expressive, more powerful, and much neater in its language architecture. I think the Perl sigil methodology is brilliant (namely, that scalars start with a '$', arrays with a '@', hashes with a '%' and so on); that the operator determines the expression context, instead of the variable type; these and several other pillars of the Perl language make it really distinct.

    On the other hand, many areas of the Python language seem like a kludge (for example, its regex implementation, and its implementation of array slicing).

    If you know Perl well - if you have mastered Perl - then you have in your possession a considerably more powerful tool than Python.

    Some additional considerations:
    1. On a sizable web project, you need to use a tool - I understand that "Catalyst" is a popular one - but I've never used it. I have been using wxPerl.
    2. It seems to me that the user base of Python is much, much larger than that of Perl (maybe because of the rumors that Google is using Python internally?) and that the Perl user base is slowly shrinking. A couple of years ago, there was a resurgence in Perl, since the biology departments, in universities, have discovered that it's convenient (and powerful) to use Perl for manipulating genome sequences. But since then, it seems that Perl usage is flat and decreasing.

    Helen

      Lots of companies/organisations use Perl extensively on sizeable projects - the BBC, LoveFilm and GlaxoSmithKline are 3 I have personal experience of.

      One thing that puzzles me is that PHP seems to be the standard web development language, even at enterprise levels. I can appreciate it is perhaps easier to program in, but the fact that its performance seems to be some way behind Perl leaves me mystified as to why it is a choice for large scale projects.

      I develop in Perl and PHP, finding that the former jobs are less available but more demanding and more rewarding, whilst the latter keep my bank balance afloat till the next Perl job.... :-)

      If any of my proposed solutions have minor errors, it's because I don't waste my genius on trivial matters. :-P
        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)
Re: Is Perl the right language for a large web application?
by McA (Curate) on Apr 19, 2013 at 12:28 UTC

    Hi,

    you asked for examples. One popular is www.booking.com hiring new perl developers regularly. I'm pretty sure this is a big web app.

    My opinion to your questions. You say you love perl: Stick to it. If there are no strategic reasons to choose from a programming language, than it's best to take the one you're very productive in. And be sure, you have to learn much web app stuff. So you'll be happy not to learn the programming language as a building block.

    Best regards
    McA

Re: Is Perl the right language for a large web application?
by Pizentios (Scribe) on Apr 19, 2013 at 13:34 UTC
    Try http://www.mojolicio.us/ It's great! I find development in Mojolicious fast and easy for many different aspects of webdevelopment.
    -Pizentios
      I'll second this, Mojolicious IS great. I'm currently working on a web app and went with it and have been very happy with my decision.

      As mentioned above in another reply, Dancer too is pretty similar. The main difference between Mojolicious and Dancer is that Mojo has no dependencies on anything from the CPAN (opting to implement everything internally) while Dancer is a bit smaller and uses things from the CPAN.

      Both are smaller than Catalyst.
Re: Is Perl the right language for a large web application?
by surio (Initiate) on Apr 19, 2013 at 13:45 UTC
    Hi there,

    First, there is a lot of activity about booking.com lately, who do all their backend work in Perl, and are actually looking for Perl developers. I personally know the team that is contracted to actively help booking.com's initial screening. If you or someone you know are seriously interested in a *hardcore* Perl gig in Amsterdam, PM me with your contact mail (sawbonessurio AT gmail), and I'll put you in touch with them.

    AFAIK, a lot of film websites and film revenue databases are written on perl.

    Coverity, puppetlabs, Big Blue Marble, onyx neon, etc... etc...

    Big chunks of weborama (Europe's largest online marketing firm) use perl. AFAIK, they are rewriting their entire system to Perl(!) because it outshines their other setups!

    This is not big, but here's a newest addition to Perl based web applications: http://www.steve.org.uk/Software/slaughter/guide

    Thing is, as you rightly mentioned yourself, there's some unwanted negative publicity about Perl being some kind of washed up, primitive language, so companies don't go around advertising that they actively use Perl.

    Seriously man. Just go with what you know best.

    P.S: I have some free time on my hands. If you need some extra pair of hands on deck to help you with this FOSS application, don't hesitate to reach out to me (sawbonessurio AT gmail). :-) Glad to help you with the coding. :-)
    I am dead serious with my offer to help!


    Have a nice weekend!
      I missed them earlier, but BLEKKO and DuckDuckGo, both of which are excellent, thriving search engines, are completely written in Perl! Go figure!

      I think you are in excellent company as far as usage of Perl is concerned. Seriously, stop worrying about it and get cracking with your massive project using Perl :-) :-)
Re: Is Perl the right language for a large web application?
by sundialsvc4 (Abbot) on Apr 19, 2013 at 14:10 UTC

    Well, you could ask The Washington Post what they think of Python ... their system is a super-set of what we know as Django.   On the other hand, you could ask The Huffington Post what they think of Perl ... their system is built on Movable Type.

    All of these languages (with the possible exception of Java ;-) ) are more than powerful enough to do the job that they do every day.   All of them are very much in common use.   And, so, this should be your take-away:

    Most of the software in the world is existing (“legacy”) code.   It exists, it pulls the freight, it pays the bills, it works.   Uhh, more or less.   It almost never makes sense to re-write anything.   (And, even if you did, the re-write would immediately join “the legacy.”)   You should therefore make it your business to study many programming-tools and to try to maneuver your experience to include many of them.   It is highly prized to be able to encounter a system that you have never seen before, yet in a matter of days to be truly productive in it because you have encountered “similars” before.

    Python, for example, has a very strong influence from Common LISP.   Perl, to this day, shows the influence of awk.   Java shows you what happens when a committee tries to design anything at all.   Prolog shows you how to solve a problem by describing it.   HaXe ... Ruby ...   And so on, and on, and on.   Never stop learning and exploring programming-language tools.   Write one yourself, someday, and/or involve yourself in an existing project that is now doing so.   Personally, I find this to be one of the most engaging and stimulating aspects of our profession.   We’re not only using the tools that we have, but constantly inventing more.   Every existing language “champions” something, and it’s very important to learn what that “something” is.   You know, say, how Perl does it .. now go see how Python does it very differently.   They see the problem differently and approach it in a different way, yet it is the same problem.   One day, you will encounter a new and difficult-to-solve problem that is being a conundrum to the team that you are now working with, and, bing! you recall something that the others have not (yet) encountered .. or vice-versa.

      Most of the software in the world is existing (“legacy”) code.

      If the software is "in the world" it must exist; therefore the words "Most of" are redundant; and the whole sentence is just a typical example of stating the obvious.

      But when it comes to choosing a programming language to use, you are doing so before the new software is written at which point it doesn't yet exist.

      So why keep trotting out this bland, meaningless, and totally irrelevant truism every time someone mentions language choice?


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.
      > Python, for example, has a very strong influence from Common LISP. Perl, to this day, shows the influence of awk.

      Please elaborate the "LISP influence" (except docstrings) in Python not present in Perl.

      I'd be also interested to know which of them are special to "Common" LISP and not present in other dialects like Scheme or eLISP...

      Cheers Rolf

      ( addicted to the Perl Programming Language)

Re: Is Perl the right language for a large web application?
by surio (Initiate) on Apr 19, 2013 at 17:44 UTC
    I missed them earlier, but BLEKKO and DuckDuckGo, both of which are excellent, thriving search engines, are completely written in Perl! Go figure!

    I think you are in excellent company as far as usage of Perl is concerned. Seriously, stop worrying about it and get cracking with your massive project using Perl :-) :-)
Re: Is Perl the right language for a large web application?
by blue_cowdawg (Monsignor) on Apr 19, 2013 at 18:38 UTC
        By the way, the web application is basically everything and the kitchen sink, so I see it being a very large project.

    I'm not sure that what language your write it in is of valid consideration. Whichever language you do write it in you still are going to be bound by some semblance of proper programming technique.

        Any good examples of web applications written in Perl?
    You're using one.

        I often feel that people look at Perl as some language from 1998, and Python is the new big thing. I'd like for people to want to use what I am working hard on, so this is a big concern for me.
    Who cares what people think? There is always going to be "the new thing" and someday someone is going to think rails|java|python|whatever is "old hat" and want everybody to jump on the bandwagon for the new thing.

    If the code is well crafted and the UI is comfortable for folks to use they are going to want to use your application reguardless of what language you write it in. In fact unless you tell them they may never know.

        I am quite comfortable with Perl,
    So run with it.

    So far I've crafted web applications in:

    • Perl/CGI: My default.
    • mod_perl: One or two apps.
    • Java under pure JSP and servlets.
    • Java using Java Server Faces
    • Java using Struts/Tiles
    • Ruby on Rails
    • PHP
    with the Java applications using Hibernate as their peristence layer.

    My considered opinion is they each have their advantages and drawbacks. I like some of the UI features of Java Server Faces (JSF). Hibernate is good stuff but can be a bit temperamental.

    All in all my favorite is still Perl/CGI and PHP being my least favorite.


    Peter L. Berghold -- Unix Professional
    Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg
Re: Is Perl the right language for a large web application?
by Your Mother (Canon) on Apr 19, 2013 at 19:24 UTC
    I don't care about frameworks really. I think I am doing this from the ground up.

    That’s a recipe for FAIL if it really is a massive project. It’s also an end-run around the language question. If you really plan to do everything from scratch then language choice should only have one criterion: whichever you know best. If you really do plan to do a huge project without frameworks, or at least scaffolding, and tons of tests and so on and such like, you will fail. You may bristle and -- and gnash now at that string of words but I am a vessel of truth in this. Learning frameworks is hard, sometimes very, doing it yourself is as hard + you lose the combined effort of the dozens of devs and hundreds of users who built and tested everything.

    On the intended question. Yes, Perl. It has every tool for success.

Re: Is Perl the right language for a large web application?
by VinceW (Initiate) on Apr 19, 2013 at 22:20 UTC

    As an initiate I'm probably in the position to have a go at this question from the 'outside'. So please bear in mind I don't want to offend anyone, but only want to give my point of view on development of 'large' webapplications. It's my intent to add my 5 cents to this discussion (where possible).

    I don't know (yet) if Perl would be the proper language for -your- project to build in. In my opinion there are more perspectives to take into consideration for that. I will name a few; the architecture it is suppost to fit in, the duties it has to perform (interaction), the platform it has to operate on, etc. Answers to those question should, in my opinion, also be taken into consideration when picking the language.

    As for the age of Perl concerns, I would point out that this can also be an advantage. Bleeding-edge languages/tools are not always the best things happening to enterprise software. So when picking a language I would also take into account the expected lifetime of the application and the fact if there are significant other reasons (as compliancy, etc) which have to be met.

    As for frameworks, I think there isn't a framework around (in any language) which hasn't have a learning curve. It is worth the time to investigate what this curve might be, but also what the pro-and-cons are of some frameworks, starting with the ones in the language(s) you already have knowledge of and compare them to each other and to the requirements the application (and its environment) has to deal with.

    After taking those items (also) in consideration, it might turn out that Programming in Perl of this website indead is the best choice (with or without a framework), or not.

    But as always ... since there are always more ways of doing things, there is not such thing as the one-right solution.

    small, perhaps trivial update. The question as asked is also a question I (still) have. So the answers of others are also a contribution to my learning curve. tnx.

    Best,
    VinceW

Re: Is Perl the right language for a large web application?
by topher (Scribe) on Apr 20, 2013 at 04:17 UTC
    I don't care about frameworks really. I think I am doing this from the ground up.

    Intentional ignorance is a bad idea.

    Everyone loves car analogies, so I'll make my point using one. Say you're planning on building a car (web app). Using a good modern web framework is like picking out an engine and drive train from a modern manufacturer, and then building the frame and body around it. In the end, the car is still your your car, with your design and your features and functionality. But, it has a well designed, tested, and high performing engine under the hood.

    Building a web application from scratch means that you're designing your own engine before you can even start work on the car. You're recreating work that others have already done and is available for you (for free!). After you've spent a huge amount of time getting your engine running, you're finally ready to start building the rest of your application. Of course, the engine probably compares poorly to the other engines available, considering it's had less testing, less proving, and less performance tuning.

    If your goal is to learn how to build a web framework, then you have a good reason to not use one. If you are writing a very small web application, then you have a possible reason not to use a web framework. If you're writing a web application and you know that there are no existing web frameworks that will work well with your application, then you have a valid reason not to use an existing one.

    Note, however, all of the above options still require you to do some research and understand what web frameworks are available and what their use cases or functionality are. Beginning a large application without doing your homework is doing a serious disservice to yourself.

    Christopher Cashell

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1029460]
Approved by Corion
Front-paged by vinoth.ree
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (10)
As of 2014-09-20 10:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (158 votes), past polls