php vs python

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • notbob

    php vs python

    I'm not posting this just to initiate some religious flame war, though it's
    the perfect subject to do so. No, I actaully want some serious advice about
    these two languages and since I think usenet is the best arena to find it,
    here ya' go.

    So, here's my delimna: I want to start a blog. Yeah, who doesn't. Yet, I
    want learn the guts of it instead of just booting up some wordwank or
    whatever. I started to learn python, but heard php was easier or faster or
    more like shell scripting or... fill in the blank. Anyway, so I change over
    to learning php. Then I run across that blog, Coding Horror, and start
    reading articles like this:



    Now what? Go back to python. Soldier on with php? What do I know? Not
    much. I can setup mysql and apache,, but don't know how to use 'em, really.
    I use emacs and run slackware and can fumble my way through bash scripts,
    but I can't really write them or do lisp. I've taken basic basic and basic
    C, but am barely literate in html. Sometimes it seems overwhelming, but I
    persevere because it's more fun/challenging than video games, which bore me
    to tears.

    Well, that's my actual question, then. Is php really so bad I'm just
    wasting my time? Or is it really the quickest way to blog functionality?
    Would I be better served in the long run learning python, which claims to be
    easy as pie to learn/program (still looks hard to me). I admit I'm no code
    geek. But, I'm not completely brain dead, either, and I need something to
    keep my geezer brain sparking. What say ye?

    nb
  • Jeffrey Froman

    #2
    Re: php vs python

    notbob wrote:
    I
    persevere because it's more fun/challenging than video games

    This is the crux of the matter from where I'm sitting. If the purpose of
    learning a programming language is fun, then the primary relevant question
    is:

    Is it more fun to code in Python or PHP?

    The answer is a no-brainer for me. It seems to me that Python is designed
    from the ground up with my enjoyment in mind. Your Fun May Vary :-)


    Jeffrey

    Comment

    • Carl Banks

      #3
      Re: php vs python

      On May 21, 4:10 pm, notbob <not...@nothome .comwrote:
      Sometimes it seems overwhelming, but I
      persevere because it's more fun/challenging than video games, which bore me
      to tears.
      Ha, exactly the opposite here.
      Well, that's my actual question, then. Is php really so bad I'm just
      wasting my time? Or is it really the quickest way to blog functionality?
      Would I be better served in the long run learning python, which claims to be
      easy as pie to learn/program (still looks hard to me). I admit I'm no code
      geek. But, I'm not completely brain dead, either, and I need something to
      keep my geezer brain sparking. What say ye?
      If you just want to write a simple blog, PHP is probably good enough.
      It's undeniably easier to jump into web programming with PHP--
      partially because of it's widespread support and straightforward
      usage, partially because Python web solutions tend to aim for
      separability of content and presenation which raises the bar for
      entry--and that could easily outweigh your concerns over quality of
      the language.

      (Incidentally: if you didn't want to start a religious war, it would
      have been better if you had posted it separately to the two groups.
      Lots of flamewars start by one person posting a cutdown not intended
      for the ears of the other group.)


      Carl Banks

      Comment

      • notbob

        #4
        Re: php vs python

        On 2008-05-21, Michael Vilain <vilain@NOspamc op.netwrote:
        your site. They may even have a blogging package you can administer
        entries without any programming.
        >
        What's your end-goal here? If you can't program, you may be better off
        with a package or tool that does all the heavy lifting for you.
        I said I didn't want to do that, but that's not entirely true. I figured
        I'd use one of the CMSs while learning how it works, much like linux. I
        hate doing something without knowing why. Windows and Dreamweaver are good
        examples. Nope. I want to get under the hood.

        nb

        Comment

        • notbob

          #5
          Re: php vs python

          On 2008-05-21, Carl Banks <pavlovevidence @gmail.comwrote :
          If you just want to write a simple blog, PHP is probably good enough.
          It's undeniably easier to jump into web programming with PHP--
          partially because of it's widespread support and straightforward
          usage, partially because Python web solutions tend to aim for
          separability of content and presenation which raises the bar for
          entry--and that could easily outweigh your concerns over quality of
          the language.
          >
          (Incidentally: if you didn't want to start a religious war, it would
          have been better if you had posted it separately to the two groups.
          Lots of flamewars start by one person posting a cutdown not intended
          for the ears of the other group.)
          Yeah, but years of usenet have taught me how to navigate the battlefield.
          Your top paragraph above is the kind of advice I'm looking for. Thank you.

          nb

          Comment

          • notbob

            #6
            Re: php vs python

            On 2008-05-21, Damon Getsman <dgetsman@amire hab.netwrote:
            My suggestion, if you want to keep that gray meat sparking, is to go
            with only html & php. You could have the php dumping your entries
            into date/time named textfiles on there when you're writing, and when
            someone is reading, it just orders them sequentially by the date &
            time in their filenames.
            >
            Then again, you learn the HTML+PHP+MySQL thing and you've got a skill
            that you can market on Craigslist to a bunch of people for $20/hr
            +. :)
            That certainly couldn't hurt. Thank you for your advice.

            nb

            Comment

            • Paul Rubin

              #7
              Re: php vs python

              notbob <notbob@nothome .comwrites:
              Well, that's my actual question, then. Is php really so bad I'm just
              wasting my time? Or is it really the quickest way to blog functionality?
              php is very easy to get started with and some big sites have been
              written in it. There is lots of low cost php hosting available. It
              is not as good a language as Python. However, Python's advantages are
              strongest in more complex projects. For simple stuff, php is frankly
              less hassle just because of its wide deployment and that extensive
              function library that the blog post your quoted described as a bad
              thing. Python's libraries are not bad, but php's are more intensely
              focused on web apps and includes what you need as part of the standard
              build. With Python, if you want a database adapter or web template
              framework, you have to choose between a bunch of different ones and
              download and configure it which often involves head scratching when
              the auto-install stuff hits some quirk of your system. With php, it's
              all right there when you flip the switch.

              Knowing lots of languages is good for you. php is probably your
              quickest route to getting a rudimentary web app running. Python
              is a longer term project. Do both.

              Comment

              • Baris-C

                #8
                Re: php vs python

                On May 21, 11:10 pm, notbob <not...@nothome .comwrote:
                I'm not posting this just to initiate some religious flame war, though it's
                the perfect subject to do so.  No, I actaully want some serious advice about
                these two languages and since I think usenet is the best arena to find it,
                here ya' go.
                >
                So, here's my delimna: I want to start a blog.  Yeah, who doesn't.  Yet, I
                want learn the guts of it instead of just booting up some wordwank or
                whatever.  I started to learn python, but heard php was easier or fasteror
                more like shell scripting or... fill in the blank.  Anyway, so I change over
                to learning php.  Then I run across that blog, Coding Horror, and start
                reading articles like this:
                >

                >
                Now what?  Go back to python.  Soldier on with php?  What do I know? Not
                much.  I can setup mysql and apache,, but don't know how to use 'em, really.
                I use emacs and run slackware and can fumble my way through bash scripts,
                but I can't really write them or do lisp.  I've taken basic basic and basic
                C, but am barely literate in html.  Sometimes it seems overwhelming, butI
                persevere because it's more fun/challenging than video games, which bore me
                to tears.  
                >
                Well, that's my actual question, then.  Is php really so bad I'm just
                wasting my time?  Or is it really the quickest way to blog functionality?
                Would I be better served in the long run learning python, which claims to be
                easy as pie to learn/program (still looks hard to me).  I admit I'm no code
                geek.  But, I'm not completely brain dead, either, and I need something to
                keep my geezer brain sparking.  What say ye?
                >
                nb
                By the way anything goes to you..

                Comment

                • alex23

                  #9
                  Re: php vs python

                  On May 22, 6:10 am, notbob <not...@nothome .comwrote:
                  Well, that's my actual question, then. Is php really so bad I'm just
                  wasting my time? Or is it really the quickest way to blog functionality?
                  Would I be better served in the long run learning python, which claims to be
                  easy as pie to learn/program (still looks hard to me). I admit I'm no code
                  geek. But, I'm not completely brain dead, either, and I need something to
                  keep my geezer brain sparking. What say ye?
                  Python has 71 built in functions (in 2.5). Atwood's list of PHP built
                  ins beginning with 'a' is 124 functions long.

                  There's a clear reason why people say Python "fits your brain" :)

                  Comment

                  • Larry Bates

                    #10
                    Re: php vs python

                    notbob wrote:
                    I'm not posting this just to initiate some religious flame war, though it's
                    the perfect subject to do so. No, I actaully want some serious advice about
                    these two languages and since I think usenet is the best arena to find it,
                    here ya' go.
                    >
                    So, here's my delimna: I want to start a blog. Yeah, who doesn't. Yet, I
                    want learn the guts of it instead of just booting up some wordwank or
                    whatever. I started to learn python, but heard php was easier or faster or
                    more like shell scripting or... fill in the blank. Anyway, so I change over
                    to learning php. Then I run across that blog, Coding Horror, and start
                    reading articles like this:
                    >

                    >
                    Now what? Go back to python. Soldier on with php? What do I know? Not
                    much. I can setup mysql and apache,, but don't know how to use 'em, really.
                    I use emacs and run slackware and can fumble my way through bash scripts,
                    but I can't really write them or do lisp. I've taken basic basic and basic
                    C, but am barely literate in html. Sometimes it seems overwhelming, but I
                    persevere because it's more fun/challenging than video games, which bore me
                    to tears.
                    >
                    Well, that's my actual question, then. Is php really so bad I'm just
                    wasting my time? Or is it really the quickest way to blog functionality?
                    Would I be better served in the long run learning python, which claims to be
                    easy as pie to learn/program (still looks hard to me). I admit I'm no code
                    geek. But, I'm not completely brain dead, either, and I need something to
                    keep my geezer brain sparking. What say ye?
                    >
                    nb
                    Check out the Pylons blog tutorial. You will have a simple blog up and running
                    in less than 30 minutes and have a platform to extend it with as much
                    functionality as you want later on.

                    Larry Bates

                    Pylons blog tutorial:


                    Comment

                    • NC

                      #11
                      Re: php vs python

                      On May 21, 1:10 pm, notbob <not...@nothome .comwrote:
                      >
                      So, here's my delimna: I want to start a blog. Yeah, who doesn't.
                      Yet, I want learn the guts of it instead of just booting up some
                      wordwank or whatever.
                      Here's a simple computation to consider... WordPress' codebase is
                      approximately a megabyte of PHP code and megabyte of JavaScript code.
                      Assuming that the average line of that code is 50 characters long, you
                      are looking at 20,000 lines of code in PHP and as many in JavaScript.
                      Based on the notion that the average developer out there writes 100
                      lines a day, either you're in for a two-year project or your product
                      is going to have seriously reduced functionality compared to something
                      that's been freely available for years. What's your choice?
                      Then I run across that blog, Coding Horror, and start reading
                      articles like this:
                      >
                      http://www.codinghorror.com/blog/archives/001119.html
                      You should read what some computer scientists write about SQL... :)
                      Now what?
                      Nothing. Everyone is entitled to their opinion. You are free to form
                      your own.
                      I've taken basic basic and basic C, but am barely literate
                      in html.
                      Maybe that (and some JavaScript) is something to work on first before
                      delving into server-side programming?
                      Well, that's my actual question, then. Is php really so bad
                      I'm just wasting my time? Or is it really the quickest way
                      to blog functionality?
                      The quickest way to blog functionality is an account on a blogging
                      service... :)
                      Would I be better served in the long run learning python, which
                      claims to be easy as pie to learn/program (still looks hard to
                      me). I admit I'm no code geek. But, I'm not completely brain
                      dead, either, and I need something to keep my geezer brain
                      sparking. What say ye?
                      If the purpose is to keep the brain sparking, it doesn't matter what
                      you learn as long as you're enjoying the process. You might as well
                      take up Japanese while you're at it...

                      Cheers,
                      NC

                      Comment

                      • Nick Craig-Wood

                        #12
                        Re: php vs python

                        Damon Getsman <dgetsman@amire hab.netwrote:
                        PHP has great support for accessing a MySQL database,
                        Actually I'd say PHP's mysql support is lacking a very important
                        feature. mysql_query() doesn't support parameters (or placeholders,
                        usually '?') which means that unless you use
                        mysql_real_esca pe_string() on all user input you are leaving yourself
                        wide open for SQL injection attacks.

                        With all the other non-PHP mysql programming I've done you use
                        parameters for all user input and you don't have to worry.

                        It is not a big deal, but I've had it drummed into me to always use
                        parameters for user input and I was really suprised PHP didn't have
                        them.

                        --
                        Nick Craig-Wood <nick@craig-wood.com-- http://www.craig-wood.com/nick

                        Comment

                        • notbob

                          #13
                          Re: php vs python

                          On 2008-05-22, Larry Bates <larry.bates@we bsafe.com`wrote :
                          Check out the Pylons blog tutorial. You will have a simple blog up and running
                          in less than 30 minutes and have a platform to extend it with as much
                          functionality as you want later on.
                          >
                          Larry Bates
                          >
                          Pylons blog tutorial:
                          >
                          http://wiki.pylonshq.com/display/pyl...+a+Pylons+Blog
                          Thnx, Larry. FYI: the above page doesn't exist:

                          "The page you were trying to reach does not exist. You may want to try a
                          search, or browse the site to find the page you were looking for."

                          .....but, there's a link to a pylons cookbook, which I will explore.

                          nb

                          Comment

                          • notbob

                            #14
                            Re: php vs python

                            On 2008-05-21, Paul Rubin <httpwrote:
                            Knowing lots of languages is good for you. php is probably your
                            quickest route to getting a rudimentary web app running. Python
                            is a longer term project. Do both.
                            Good advice. Thank you.

                            nb

                            Comment

                            • Mike Driscoll

                              #15
                              Re: php vs python

                              On May 21, 3:10 pm, notbob <not...@nothome .comwrote:
                              I'm not posting this just to initiate some religious flame war, though it's
                              the perfect subject to do so.  No, I actaully want some serious advice about
                              these two languages and since I think usenet is the best arena to find it,
                              here ya' go.
                              >
                              So, here's my delimna: I want to start a blog.  Yeah, who doesn't.  Yet, I
                              want learn the guts of it instead of just booting up some wordwank or
                              whatever.  I started to learn python, but heard php was easier or fasteror
                              more like shell scripting or... fill in the blank.  Anyway, so I change over
                              to learning php.  Then I run across that blog, Coding Horror, and start
                              reading articles like this:
                              >

                              >
                              Now what?  Go back to python.  Soldier on with php?  What do I know? Not
                              much.  I can setup mysql and apache,, but don't know how to use 'em, really.
                              I use emacs and run slackware and can fumble my way through bash scripts,
                              but I can't really write them or do lisp.  I've taken basic basic and basic
                              C, but am barely literate in html.  Sometimes it seems overwhelming, butI
                              persevere because it's more fun/challenging than video games, which bore me
                              to tears.  
                              >
                              Well, that's my actual question, then.  Is php really so bad I'm just
                              wasting my time?  Or is it really the quickest way to blog functionality?
                              Would I be better served in the long run learning python, which claims to be
                              easy as pie to learn/program (still looks hard to me).  I admit I'm no code
                              geek.  But, I'm not completely brain dead, either, and I need something to
                              keep my geezer brain sparking.  What say ye?
                              >
                              nb
                              TurboGears and Django are pretty cool Python web application
                              frameworks. I would recommend looking at them too.

                              Mike

                              Comment

                              Working...