php vs python

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

    #31
    Re: php vs python

    Jerry Stuckle wrote:
    Lie wrote:
    On May 22, 12:28 pm, NC <n...@iname.com wrote:
    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?
    >
    Nope, the core functionality of a blogging software could be
    replicated in just a few lines of PHP codes, in the range of tens to
    hundreds of lines. If you're creating your own blogging software, you
    wouldn't seriously think you'd recreate all those things such as
    pingbacks, commenting system, etc, etc, etc. No, you'd start with some
    basic core functionalities : a few simple server side includes only.
    >
    As he said - it's either a two man-year project or your product is going
    to have seriously reduced functionality.  It looks like you are opting
    for the latter.
    >
    Also, you still need to write the server-side includes.  But they won't
    do nearly enough for everything WordPress does.
    If the OP wants to learn the guts of the blog or to implement the blog
    from scratch, Python/Django would be a better choice than PHP. The
    reason is that he can reuse and customize existing high quality
    components for all these auth/auth, admin, comments, etc, etc, etc.
    Another reason is that Python and Django encourage very clean design
    while PHP is too often ends up in "spaghetti SQL wrapped in spaghetti
    PHP wrapped in spaghetti HTML". 2 man/year in PHP == 2 man/week in
    Python/Django.

    And there are Python/Django blog applications that already do almost
    everything (and maybe more) that WordPress does. http://byteflow.su/
    is one of them (IMHO the most promising).

    Ivan

    Comment

    • Jerry Stuckle

      #32
      Re: php vs python

      Ivan Illarionov wrote:
      Jerry Stuckle wrote:
      >Lie wrote:
      >>On May 22, 12:28 pm, NC <n...@iname.com wrote:
      >>>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
      >>>approximatel y 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?
      >>Nope, the core functionality of a blogging software could be
      >>replicated in just a few lines of PHP codes, in the range of tens to
      >>hundreds of lines. If you're creating your own blogging software, you
      >>wouldn't seriously think you'd recreate all those things such as
      >>pingbacks, commenting system, etc, etc, etc. No, you'd start with some
      >>basic core functionalities : a few simple server side includes only.
      >As he said - it's either a two man-year project or your product is going
      >to have seriously reduced functionality. It looks like you are opting
      >for the latter.
      >>
      >Also, you still need to write the server-side includes. But they won't
      >do nearly enough for everything WordPress does.
      >
      If the OP wants to learn the guts of the blog or to implement the blog
      from scratch, Python/Django would be a better choice than PHP. The
      reason is that he can reuse and customize existing high quality
      components for all these auth/auth, admin, comments, etc, etc, etc.
      Another reason is that Python and Django encourage very clean design
      while PHP is too often ends up in "spaghetti SQL wrapped in spaghetti
      PHP wrapped in spaghetti HTML". 2 man/year in PHP == 2 man/week in
      Python/Django.
      >
      You can do the same in PHP. And PHP doesn't create spaghetti code -
      programmers do. Good programmers write good code in any language. Poor
      programmers write lousy code - in any language.

      And I'd love to see you write WordPress in 2 weeks in Python. That's
      about 2K LOC. Can't be done with the same functionality - unless you
      have some 50K lines.

      It's going to be very close to the same 2 man years that PHP takes.
      And there are Python/Django blog applications that already do almost
      everything (and maybe more) that WordPress does. http://byteflow.su/
      is one of them (IMHO the most promising).
      >
      Ivan
      >
      And there are many CMS's written in PHP which do much more than
      WordPress does. Drupal, Joomla and Mambo come to mind.

      --
      =============== ===
      Remove the "x" from my email address
      Jerry Stuckle
      JDS Computer Training Corp.
      jstucklex@attgl obal.net
      =============== ===

      Comment

      • NC

        #33
        Re: php vs python

        On May 25, 11:46 am, Ivan Illarionov <ivan.illario.. .@gmail.com>
        wrote:
        >
        If the OP wants to learn the guts of the blog or to implement
        the blog from scratch, Python/Django would be a better choice
        than PHP. The reason is that he can reuse and customize existing
        high quality components for all these auth/auth, admin, comments,
        etc, etc, etc.
        You are comparing apples to oranges... There are application
        frameworks
        for PHP as well (CakePHP and Symfony come to mind). CakePHP, if
        memory
        serves, actually has a development of a blog described in its
        tutorial...
        Another reason is that Python and Django encourage very clean design
        while PHP is too often ends up in "spaghetti SQL wrapped in spaghetti
        PHP wrapped in spaghetti HTML".
        It's absolutely the same thing with PHP frameworks...
        2 man/year in PHP == 2 man/week in Python/Django.
        This, I daresay, is an exaggeration... Let's take your own example:
        And there are Python/Django blog applications that already do almost
        everything (and maybe more) that WordPress does.http://byteflow.su/
        is one of them (IMHO the most promising).
        A quick look at the revision log:

        Бесплатное размещение объявлений на нашем сайте.


        reveals that the initial commit of 60 or so files has been done on
        08/14/07
        (10 months ago), a second developer came on board 12/01/07 (seven+
        months ago),
        a third one, on 01/04/08 (six+ months ago), a fourth one, on 01/16/08
        (also
        six+ months ago). There are at least nine discernible contributors
        overall.
        Say what you will, but it still looks an awful lot like like two man-
        years,
        Django or no Django...

        Cheers,
        NC

        Comment

        • Ivan Illarionov

          #34
          Re: php vs python

          On Sun, 25 May 2008 13:28:25 -0700, NC wrote:
          [...]
          A quick look at the revision log:
          >
          Бесплатное размещение объявлений на нашем сайте.

          >
          reveals that the initial commit of 60 or so files has been done on
          08/14/07
          (10 months ago), a second developer came on board 12/01/07 (seven+
          months ago),
          a third one, on 01/04/08 (six+ months ago), a fourth one, on 01/16/08
          (also
          six+ months ago). There are at least nine discernible contributors
          overall.
          Say what you will, but it still looks an awful lot like like two man-
          years,
          Django or no Django...
          I bet that if they did this with PHP framework they where far from where
          they are now.

          I didn't say that it's not possible to write good code in PHP, I said
          that Python and Django encourage cleaner code more than PHP and PHP
          frameworks do.

          IMHO Python language is better designed and this influences everything
          written in it.

          Yes, it's possible to write something clean in PHP but it would require a
          lot more work.

          Ivan


          Comment

          • Jerry Stuckle

            #35
            Re: php vs python

            Ivan Illarionov wrote:
            On Sun, 25 May 2008 13:28:25 -0700, NC wrote:
            [...]
            >A quick look at the revision log:
            >>
            >http://byteflow.su/log/
            >>
            >reveals that the initial commit of 60 or so files has been done on
            >08/14/07
            >(10 months ago), a second developer came on board 12/01/07 (seven+
            >months ago),
            >a third one, on 01/04/08 (six+ months ago), a fourth one, on 01/16/08
            >(also
            >six+ months ago). There are at least nine discernible contributors
            >overall.
            >Say what you will, but it still looks an awful lot like like two man-
            >years,
            >Django or no Django...
            >
            I bet that if they did this with PHP framework they where far from where
            they are now.
            >
            Yep, I'd bet they would be much further along.
            I didn't say that it's not possible to write good code in PHP, I said
            that Python and Django encourage cleaner code more than PHP and PHP
            frameworks do.
            >
            I repeat. The language has nothing to do with it. Good programmers
            write good code. Lousy programmers write bad code.
            IMHO Python language is better designed and this influences everything
            written in it.
            >
            A lot of people don't share the opinion that it is "better designed".
            Yes, it's possible to write something clean in PHP but it would require a
            lot more work.
            >
            Not at all. I do it every day.

            And BTW - yes, I write Python, also. But I find I can write better,
            faster code in PHP.

            Do you write PHP?
            Ivan
            >
            >

            --
            =============== ===
            Remove the "x" from my email address
            Jerry Stuckle
            JDS Computer Training Corp.
            jstucklex@attgl obal.net
            =============== ===

            Comment

            • Ivan Illarionov

              #36
              Re: php vs python

              On Sun, 25 May 2008 17:09:43 -0400, Jerry Stuckle wrote:
              Not at all. I do it every day.
              >
              And BTW - yes, I write Python, also. But I find I can write better,
              faster code in PHP.
              I find I can write better code in Python. Maybe it's just a matter of
              personal preference?
              Do you write PHP?
              I did. And I hated it very much. I hated it so much that even I had few
              Python scripts that generated PHP for me when it was possible.

              Comment

              • NC

                #37
                Re: php vs python

                On May 25, 1:55 pm, Ivan Illarionov <ivan.illario.. .@gmail.comwrot e:
                On Sun, 25 May 2008 13:28:25 -0700, NC wrote:
                >
                A quick look at the revision log:
                >>
                reveals that the initial commit of 60 or so files has been done
                on 08/14/07 (10 months ago), a second developer came on board
                12/01/07 (seven+ months ago), a third one, on 01/04/08 (six+
                months ago), a fourth one, on 01/16/08 (also six+ months ago).
                There are at least nine discernible contributors overall. Say
                what you will, but it still looks an awful lot like like two
                man-years, Django or no Django...
                >
                I bet that if they did this with PHP framework they where far
                from where they are now.
                The question is, which way? :) Jerry Stuckle, with whom I
                wholeheartedly argue about half the time we post to the same threads
                and argue bitterly the other half of the time, thinks they would be
                ahead of where they are now... :)
                I didn't say that it's not possible to write good code in PHP,
                Indeed you didn't. You did, however, say that development in Python/
                Django is inherently faster than development in PHP (your exact words
                were, "2 man/year in PHP == 2 man/week in Python/Django", implying a
                50-fold difference). This claim has just been obliterated using the
                example you (not I) provided; my estimate of two man-years for
                developing WordPress turns out to be fairly close to what has actually
                gone into the development of Byteflow. In other words, so far we have
                discovered no evidence of Python's (or PHP's, to be fair) superiority
                in terms of developer's productivity.
                IMHO Python language is better designed
                That is indeed a matter of opinion. You like (among other things)
                immutable strings, the off-side rule, the idea that everything is an
                object, and the fine distinction between mutable lists and immutable
                tuples, and I have no problem with you liking these features, as long
                as you agree that other people may have reasons to like the
                alternatives better.
                Yes, it's possible to write something clean in PHP but it
                would require a lot more work.
                In my opinion, it wouldn't, and in my experience, it doesn't. All you
                need is to actually put a designer in charge of design. Additionally,
                there are situations (rapid prototyping, for example) when
                maintainability (the requirement behind the "clean code") is simply
                not a concern.

                Cheers,
                NC

                Comment

                • Ivan Illarionov

                  #38
                  Re: php vs python

                  On Sun, 25 May 2008 16:23:12 -0700, NC wrote:
                  >I didn't say that it's not possible to write good code in PHP,
                  >
                  Indeed you didn't. You did, however, say that development in Python/
                  Django is inherently faster than development in PHP (your exact words
                  were, "2 man/year in PHP == 2 man/week in Python/Django", implying a
                  50-fold difference). This claim has just been obliterated using the
                  example you (not I) provided; my estimate of two man-years for
                  developing WordPress turns out to be fairly close to what has actually
                  gone into the development of Byteflow. In other words, so far we have
                  discovered no evidence of Python's (or PHP's, to be fair) superiority in
                  terms of developer's productivity.
                  In this case (excellent blogging tool), yes, I agree.
                  >IMHO Python language is better designed
                  >
                  That is indeed a matter of opinion. You like (among other things)
                  immutable strings, the off-side rule, the idea that everything is an
                  object, and the fine distinction between mutable lists and immutable
                  tuples, and I have no problem with you liking these features, as long as
                  you agree that other people may have reasons to like the alternatives
                  better.
                  I agree. We like different things and it's good.
                  >Yes, it's possible to write something clean in PHP but it would require
                  >a lot more work.
                  >
                  In my opinion, it wouldn't, and in my experience, it doesn't. All you
                  need is to actually put a designer in charge of design. Additionally,
                  there are situations (rapid prototyping, for example) when
                  maintainability (the requirement behind the "clean code") is simply not
                  a concern.
                  It's hard to me to write good PHP. I feel happy programming in Python and
                  I felt very unhappy when I had to program in PHP. I'm glad that you have
                  a different experience.

                  Ivan

                  Comment

                  • Jerry Stuckle

                    #39
                    Re: php vs python

                    Ivan Illarionov wrote:
                    On Sun, 25 May 2008 17:09:43 -0400, Jerry Stuckle wrote:
                    >Not at all. I do it every day.
                    >>
                    >And BTW - yes, I write Python, also. But I find I can write better,
                    >faster code in PHP.
                    >
                    I find I can write better code in Python. Maybe it's just a matter of
                    personal preference?
                    >
                    >Do you write PHP?
                    I did. And I hated it very much. I hated it so much that even I had few
                    Python scripts that generated PHP for me when it was possible.
                    >
                    So you really don't write PHP. Enough said.

                    --
                    =============== ===
                    Remove the "x" from my email address
                    Jerry Stuckle
                    JDS Computer Training Corp.
                    jstucklex@attgl obal.net
                    =============== ===

                    Comment

                    • Jerry Stuckle

                      #40
                      Re: php vs python

                      Ivan Illarionov wrote:
                      On Sun, 25 May 2008 16:23:12 -0700, NC wrote:
                      >
                      >>I didn't say that it's not possible to write good code in PHP,
                      >Indeed you didn't. You did, however, say that development in Python/
                      >Django is inherently faster than development in PHP (your exact words
                      >were, "2 man/year in PHP == 2 man/week in Python/Django", implying a
                      >50-fold difference). This claim has just been obliterated using the
                      >example you (not I) provided; my estimate of two man-years for
                      >developing WordPress turns out to be fairly close to what has actually
                      >gone into the development of Byteflow. In other words, so far we have
                      >discovered no evidence of Python's (or PHP's, to be fair) superiority in
                      >terms of developer's productivity.
                      >
                      In this case (excellent blogging tool), yes, I agree.
                      >
                      >>IMHO Python language is better designed
                      >That is indeed a matter of opinion. You like (among other things)
                      >immutable strings, the off-side rule, the idea that everything is an
                      >object, and the fine distinction between mutable lists and immutable
                      >tuples, and I have no problem with you liking these features, as long as
                      >you agree that other people may have reasons to like the alternatives
                      >better.
                      >
                      I agree. We like different things and it's good.
                      >
                      >>Yes, it's possible to write something clean in PHP but it would require
                      >>a lot more work.
                      >In my opinion, it wouldn't, and in my experience, it doesn't. All you
                      >need is to actually put a designer in charge of design. Additionally,
                      >there are situations (rapid prototyping, for example) when
                      >maintainabilit y (the requirement behind the "clean code") is simply not
                      >a concern.
                      >
                      It's hard to me to write good PHP. I feel happy programming in Python and
                      I felt very unhappy when I had to program in PHP. I'm glad that you have
                      a different experience.
                      >
                      Ivan
                      >
                      It's very easy for me to write good code in PHP. I can say the same for
                      a number of other good programmers I know.

                      As I've said before - good programmers can write good code in any language.

                      --
                      =============== ===
                      Remove the "x" from my email address
                      Jerry Stuckle
                      JDS Computer Training Corp.
                      jstucklex@attgl obal.net
                      =============== ===

                      Comment

                      • Ivan Illarionov

                        #41
                        Re: php vs python

                        Jerry Stuckle wrote:
                        As I've said before - good programmers can write good code in any
                        language.
                        Yes, they can. But it may be harder to do for them in one language and
                        easier in another.

                        Ivan

                        Comment

                        • Jerry Stuckle

                          #42
                          Re: php vs python

                          Ivan Illarionov wrote:
                          Jerry Stuckle wrote:
                          >
                          >As I've said before - good programmers can write good code in any
                          >language.
                          >
                          Yes, they can. But it may be harder to do for them in one language and
                          easier in another.
                          >
                          Ivan
                          Not for a good programmer it isn't. I've known a few good programmers
                          in my 40+ years of programming. I've known a lot more poor programmers
                          who think they're good.

                          --
                          =============== ===
                          Remove the "x" from my email address
                          Jerry Stuckle
                          JDS Computer Training Corp.
                          jstucklex@attgl obal.net
                          =============== ===

                          Comment

                          • Ivan Illarionov

                            #43
                            Re: php vs python

                            On Sun, 25 May 2008 20:53:28 -0400, Jerry Stuckle wrote:
                            Ivan Illarionov wrote:
                            >Jerry Stuckle wrote:
                            >>
                            >>As I've said before - good programmers can write good code in any
                            >>language.
                            >>
                            >Yes, they can. But it may be harder to do for them in one language and
                            >easier in another.
                            >>
                            >Ivan
                            >
                            Not for a good programmer it isn't. I've known a few good programmers
                            in my 40+ years of programming. I've known a lot more poor programmers
                            who think they're good.
                            I can't argue with your experience. I don't think that I'm good
                            programmer. I want to be better. And I hope that when I'll have 48+ years
                            experience I won't have to use it as argumentum ad hominem.

                            Comment

                            • Jerry Stuckle

                              #44
                              Re: php vs python

                              Ivan Illarionov wrote:
                              On Sun, 25 May 2008 20:53:28 -0400, Jerry Stuckle wrote:
                              >
                              >Ivan Illarionov wrote:
                              >>Jerry Stuckle wrote:
                              >>>
                              >>>As I've said before - good programmers can write good code in any
                              >>>language.
                              >>Yes, they can. But it may be harder to do for them in one language and
                              >>easier in another.
                              >>>
                              >>Ivan
                              >Not for a good programmer it isn't. I've known a few good programmers
                              >in my 40+ years of programming. I've known a lot more poor programmers
                              >who think they're good.
                              >
                              I can't argue with your experience. I don't think that I'm good
                              programmer. I want to be better. And I hope that when I'll have 48+ years
                              experience I won't have to use it as argumentum ad hominem.
                              No ad hominems on my part. I said nothing about you or your abilities.
                              I spoke only of programmers I have known, both good and poor.

                              The the good programmers are able to adapt to the language and make the
                              most of whatever language they're using. The result is good code.
                              OTOH, poor programmers I have known have found all kinds of excuses -
                              from the language itself to lack of requirements, to anything else they
                              can blame, except the real root of the problem.

                              If you take exception to that, then I'm sorry for you.

                              --
                              =============== ===
                              Remove the "x" from my email address
                              Jerry Stuckle
                              JDS Computer Training Corp.
                              jstucklex@attgl obal.net
                              =============== ===

                              Comment

                              • I V

                                #45
                                Re: php vs python

                                On Sun, 25 May 2008 21:41:09 -0400, Jerry Stuckle wrote:
                                The the good programmers are able to adapt to the language and make the
                                most of whatever language they're using. The result is good code. OTOH,
                                poor programmers I have known have found all kinds of excuses - from the
                                language itself to lack of requirements, to anything else they can
                                blame, except the real root of the problem.
                                That's true - but I wonder if there might not be differences at the
                                margins. Some languages (and, which is not quite the same but not easy to
                                fully distinguish either, the communities around some languages) may
                                encourage mediocre programmers to produce slightly more or less mediocre
                                programs.

                                Some features of Python (the one that really stands out for me is not
                                default-initializing variables on first use; the comparatively clean
                                standard library might be another), and some features of the Python
                                community (which, IME, has more members more explicitly committed to
                                writing clean code) I think do make Python a better environment for us
                                mediocre programmers.

                                But maybe I'm wrong - I've never been paid to write Python programs,
                                whereas I have been paid to write PHP, so I might just be projecting my
                                frustrations with work onto the language. I've also not used PHP5 much in
                                anger, which does look to be a lot nicer than earlier versions.

                                Comment

                                Working...