in reply to Learning PHP

As CountZero points out, "LAMP" just refers to a combination of Linux, Apache, MySQL and a web-dev scripting language which will work with them (PHP, Perl, or Python).

But here's an opinion on PHP anyway, since there could well be many "LAMP" jobs that do require PHP specifically: I had to learn php for a job that required writing a mediawiki extension (since mediawiki is in php). IMO, it is not as nice a language as perl -- regexps are ridiculously awkward by comparison, etc (of course, they are even more awkward in compiled languages). However, I would disagree that "PHP is not a decent language in general". Easy to say, but mostly just ignorance and hyperbole. Such arguments and attitudes are a waste of time, ie, ignore excessive naysayers.*

PHP borrows most of it's syntax from perl and C++. I found it very easy to pick up. Partially this is because the official PHP online documentation is terrific -- one area I would say the community is clearly light years ahead of "us"; perldoc.org, CPAN, & POD stuff are moldy old scrolls by comparison.

Also:

Of course, that can lead to the "Jack of all trades, Master of none". But it takes all kinds. Once you get comfortable, the language takes kind of a backseat to the thinkin' and programmin'. I'm happy to be back doing perl stuff, but I'm sure I'll end up doing php work again in the future. $0.02

* unless they are naysaying MS windows, in which case it is probably all true and worse ;)

Replies are listed 'Best First'.
Re^2: Learning PHP
by steve (Deacon) on Oct 21, 2010 at 16:32 UTC

    I would also disagree with the statement that "PHP is not a decent language in general."

    I believe that a great deal of the disdain and discontentment with PHP as a language among those who use other languages is that a large number of those who write PHP are by nature less familiar with general programming "best practices." In my experience this has been a result of two factors:

    1. PHP has a rather simple syntax and some great documentation
    2. A large number of PHP developers are "self-taught" (generally because of factor 1)
    That being said, I have worked with a number of those preferring PHP who have extensive knowledge regarding programming concepts in general. Some of these are autodidactic, but most have a formal education and are familiar with more languages than PHP. Formal education tends to engender an ability to abstract language-specific items as well as the capacity to critically evaluate programmatic methods/ways to solve a problem.

    I concur that you will likely find PHP syntax very easy to learn, and would add that there are a great number of features that Perl and PHP have in common.

    Though I prefer Perl I have written a number of projects in PHP, and I would submit to you that learning or coding in PHP need not be detrimental to your knowledge and/or love of Perl. Sometimes paying the bills requires something other than Perl. I believe there are a number of monks frequenting here that often code in other languages. It may be of benefit to you during your time working in PHP (or any other language for that matter) to continue to visit perlmonks and learn from as well as contribute to this community.

Re^2: Learning PHP
by raybies (Chaplain) on Oct 21, 2010 at 18:23 UTC

    I second halfcount's opinion. It's a breeze if you know perl/C. Instead of hashes, they call them associative arrays, and once you know that, what else do you really need to know? :) PHP is a bit more integrated with HTML/webmindset, which can make some things easier. (I once found a whole php class for making adobe acrobat files in a webbrowser, which I thought was pretty nifty...)

      they call them associative arrays
      That's the influence of AWK showing.

      I came to perl after I could no longer live with the deficiencies of AWK. (Or GAWK, either).