Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
For the sake of learning, I recently built a front-web page access a mySQL web page. The backend ETL part was implemented with Perl. PHP was used to query the front-end. The PHP code passed on JSON structures to my jQuery and Javascript with which my web page was built.

Honestly, I did not see any advantage to using PHP. I have read that PHP has a better interface than CGI but I could not really tell.

There were two reasons for selecting PHP. The first is that being new to mySQL, the book "Head First PHP and mySQL" was an excellent tutorial on mySQL and PHP seems to integrate well. PHP seemed very C-like and Perl so picking up the language was not difficult.

Second, with so much talk about PHP, I felt that learning some PHP could only help my resume.

However, the power or PHP does not compare to Perl. And for Web 2.0 web pages, Javascript and libraries like jQuery are far superior than depending on PHP.

Comparing PHP to Perl, I can state the following: 1. The raw parsing power of Perl is unmatched. 2. The lack of an equivalent STRICT for variable declarations results in numerous debugging headaches. How can one build a robust application without having a strongly typed language? 3. Perl's variable declarations prefixes are so nice as they allow you to spot a scalar from an array from a hash. 4. Hashes are more straightforward. 5. Pointers/References ... No serious programming can be done without pointers, and PHP's roundabout use of pointers is not friendly.

Of course, I am still learning about PHP and it does have a huge libary of functions. But the CPAN library is still unmatched.

Now my backend for the mySQL database was done in Perl Almighty. There was a total of some 4200 NCL lines of code encompassing some 25 modules. The 25 modules were built into a single executable using ActiveState. My application FTP's into some 15 sites collecting information continuously. And Perl does a great job at FTPing! What a breeze to drop my application on multiple machines with none having Perl installed on them.

The Perl DBI is first class. PHP seems to have copied the Perl DBI.

I used caller() for my first time to help point out exactly where errors occured. My error_log_file - thanks to caller() - has been of such enormous help.

My standalone tools in Perl have put many an engineer in shock and awe after seeing how Perl tools have shaved hundreds and hundreds of hours of manual labor from their work. Quite a few engineers around me have purchased Perl books after witnessing the speed with which I relieved them of their headaces. Of course, many give up quickly because without a strong software foundation, you can only do so much.

It would been a nightmare to replicate this effort with PHP.

After working for some 10 years with Perl, I still have to see a language that can match Perl's power. I have looked at Python briefly and did not like it. TCL is archaic. In the past 5 years, I have written over 60,000 lines of NCL code with it. Perl 5.10 has really made this language better. Having a SWITCH statement with SMART_MATCHING is great. But hash references are probably the most powerful thing in this language after regular expressions.

Perl is an easy language to start with but takes time, patience, and opportunities to grow with it. Each new problem that I solve enlightens me more. PHP has grown because for Web Programmers, they can easily embed HTML and PHP. But with AJAX making waves, you are better off using Javascript and Javascript libraries for your HTML.

Even if TIOBE is right as to number of users, that does not make Perl a second class language.


In reply to Perl is the Almighty by abcParsing
in thread Perl is sinking (TIOBE): all time low for Perl by larus

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others cooling their heels in the Monastery: (4)
    As of 2014-10-25 01:58 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      For retirement, I am banking on:










      Results (139 votes), past polls