Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

(OT) PHP Learning experiences

by aartist (Pilgrim)
on Nov 16, 2011 at 22:03 UTC ( [id://938474]=perlquestion: print w/replies, xml ) Need Help??

aartist has asked for the wisdom of the Perl Monks concerning the following question:

If you have learned PHP after learning a good amount of Perl, you might want to put some thoughts here. I need to learn PHP and I like to know what valueable insight I can get from esteemed monks. I like to know which are the easy areas and which are the difficult areas. How did you do your setup and which are good places that you hang out. I like to know what are the tricks of the trade here.

Thank you.

Replies are listed 'Best First'.
Re: (OT) PHP Learning experiences
by johnny_carlos (Scribe) on Nov 17, 2011 at 00:15 UTC
    The good news is PHP looks a lot like Perl, the bad news is PHP looks a lot like Perl.

    It's a snap to learn if you know Perl. You won't even need to read any books or anything, you can work with it right now. I do find it annoying that they're so similar you start to get things messed up in your head. Things start blending and you can get confused. The major pitfal is the lack of "use strict". (judging from a lot of questions asked here on PM people aren't using strict, but anyways...)

    I don't hang out anywhere for PHP, you don't really need to. You'll find everything you need by Google it when you need it. Everything will be on, and anything else on stackoverflow.

    As much as I love Perl and get annoyed with PHP, after working with it a while I do to admit it PHP has some nice features that make basic web development pretty quick. Having the webserver keep track of session data is really nice, and it plays well with mysql.

      Thank you all. PHP is not too difficult. I am able to pickup it up relatively easily. I found PHP Exercises very helpful for beginning. I will see how it goes.

        PHP isn't difficult in the sense that it makes you think hard, like a more terse language like Lisp or something lower-level like assembler. It's difficult in the sense of being annoying and causing extra work, like when you have to look up a function you can't remember because there are way too many and no consistent naming convention. Or when you forget that you have to quote the key in a hash, like $hash['key'] -- except when you don't, like when it's being interpolated in a string between double quotes. Or when you wish you could use Perl's natural-sounding backwards syntax, like next unless $count;

        Unpleasant and time-consuming, but not really difficult. If you're capable of programming in Perl, you're certainly capable of using PHP. It has C-style syntax, and it even borrowed Perl's regular expressions (although not every feature of them), so many things will be familiar. Just don't expect it to be as flexible or fun to write in.

        Aaron B.
        My Woefully Neglected Blog, where I occasionally mention Perl.

Re: (OT) PHP Learning experiences
by eyepopslikeamosquito (Archbishop) on Nov 17, 2011 at 01:30 UTC

    See PHP in contrast to Perl. As described at this link, you might find PHP a huge step backwards after mastering Perl (I did).

Re: (OT) PHP Learning experiences
by luis.roca (Deacon) on Nov 17, 2011 at 00:32 UTC

    I came from the other direction. I fumbled my way through a lot of php (mostly CMS' like Wordpress), got the programming bug and came to Perl. One of the things I felt was that php has A LOT of built-in functions (seemingly more than Perl) for some things that I now don't find difficult to do. I think that's one of the reasons some beginners/web designers may find it easy to jump in to php; you can hack your way through it by plugging in built in functions rather than learning to actually program in it. *(Well, I'll just speak for myself there :) ) I don't know if that's good or bad to you, I simply feel now like it sometimes can be a little bit overkill and inelegant.

    If you want to learn php, I would suggest subscribing for a month to and particularly go through the course taught by Kevin Skoglund who IMO is an excellent instructor. (His course on Unix command line for Mac OSX users is fantastic.)

    Weekday, 16.Nov.2011 :: 8:02 PM :: Expanded on the appeal of php for beginners/web designers.

    "...the adversities born of well-placed thoughts should be considered mercies rather than misfortunes." Don Quixote
Re: (OT) PHP Learning experiences
by Plankton (Vicar) on Nov 17, 2011 at 00:31 UTC
    I am currently having to learn php myself. In particular I was looking into a frameworks to use that, hopefully, would make things easier for me. I tried Zend and found it complicated and that tutorials beyond 'hello world' didn't work. I am currently looking to and so far so good.
Re: (OT) PHP Learning experiences
by Anonymous Monk on Nov 17, 2011 at 20:35 UTC

    PHP functions are case-insensitive. That's just sick.

    function abc () { print "oh noes\n"; } Abc(); aBC(); AbC();

    ...prints out exactly what you would most fear.

Re: (OT) PHP Learning experiences
by ciderpunx (Vicar) on Nov 19, 2011 at 12:06 UTC
    I use both PHP and perl, mostly perl. The main things that I struggle with aren't so much the multitude of functions (that's no different than using CPAN modules), but really basic syntactic things. I can't tell you the number of times I've typed my $var='X'; in php when I've meant to say $var='X';. Another gotcha is the documentation. PHP is documented fairly well, but often the most useful bits of the documentation are often in the comments thread. Finally, the error messages can be a bit terse sometimes, you get used to that just like with any other language.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://938474]
Approved by planetscape
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2024-07-22 14:43 GMT
Find Nodes?
    Voting Booth?

    No recent polls found

    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.