We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22303 MODX Staff
    • 10,725 Posts
    Sorry about the subject line; blame all the recent Star Wars episodes by my favorite animated shows...

    Anyway, this interesting article was pointed out to me last night, about returning to PHP after venturing into the Ruby/Rails world.
      • 3749
      • 24,544 Posts
      Quote from: OpenGeek at Sep 24, 2007, 10:46 AM

      Sorry about the subject line; blame all the recent Star Wars episodes by my favorite animated shows...

      Anyway, this interesting article was pointed out to me last night, about returning to PHP after venturing into the Ruby/Rails world.


      "… and much more. In only 12,000 lines of code, including HTML templates. (Down from 90,000, before.)"

      Did you look at the author’s site? (http://cdbaby.com). Only 12,000 lines of code??!!

      I wonder how many lines of code it would be in MODx. Looking at the site, I’d say an experienced MODx programmer could do it in < 500 lines of code over a three-day weekend. wink

      Man, that is one ugly site (IMHO).

      I really enjoyed the discussion of platforms -- even from the various evangelists. I had hoped that Ruby would be a real OOP solution for web programming, but it looks like maybe not.

      So now I’m pinning my hopes on xPDO., MODx, and PHP5 ...

      Bob
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 33372
        • 1,611 Posts
        I’ve thought about learning Ruby on Rails a few times, and every time I stopped and said, "what would I get out of this other than the major headache of starting all over from scratch?" For most websites and apps, PHP seems to be a really good fit. If I were rewriting the Amazon.com code I don’t think I would consider PHP to be up to the task, but it’s more than powerful and flexible enough for any project that I’m likely to actually take on. And it’s not as if it hasn’t been getting better over time either. I’m just starting to realize all of the advances in PHP5, and object-oriented database modeling will certainly be another big leap forward in my coding universe.
          "Things are not what they appear to be; nor are they otherwise." - Buddha

          "Well, gee, Buddha - that wasn&#39;t very helpful..." - ZAP

          Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
          • 27708 MODX Staff
          • 2,502 Posts
          Quote from: BobRay at Sep 24, 2007, 11:54 AM



          Did you look at the author’s site? (http://cdbaby.com). Only 12,000 lines of code??!!...

          ...Man, that is one ugly site (IMHO).

          The funny thing is that I think Derek Sivers also learned web design from Rails. It isn’t a design. All his views look like the generated rails views with no modifications to the stylesheets. If you look at the generated views in any rails screencast or have played with rails at all, you know what I mean.

          I do agree though about rails helping me get to understand OOP. I had toyed with the idea of building a couple of large applications on it but am considering not as I already sorta know PHP and now that I had a few clicks with OOP and writing classes I think that PHP5 will be a fine way to go. What I did like was the Rapid Application idea but in practice I think for RAD to work you need to have a good foundation in real application development and I do not. I need to learn to build applications first before I can learn how to take shortcuts. How else will I know where it broke when it breaks. RAD without the basics is just foolhearty.

          Cheers,

          Jay
            Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub
            • 7231
            • 4,205 Posts
            I took a dip into the ROR pool a while back and came back home to php in no time. I must say that it was too easy to get cought up in the hype, but I too was quick to see that I would better spend my time getting better with php rather than starting from scratch.
              [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

              Something is happening here, but you don&#39;t know what it is.
              Do you, Mr. Jones? - [bob dylan]
              • 3749
              • 24,544 Posts
              Quote from: smashingred at Sep 24, 2007, 02:05 PM


              The funny thing is that I think Derek Sivers also learned web design from Rails. It isn’t a design. All his views look like the generated rails views with no modifications to the stylesheets. If you look at the generated views in any rails screencast or have played with rails at all, you know what I mean.

              I think one of the comments indicated that Derek knows no languages other than PHP, HTML, CSS, and SQL so I’m sure that whatever he knows about OOP, he learned from Rails. You’re clearly right about the design too. I notice the same thing about 95% of all Drupal pages. They all look just like the sample site in Drupal (ugly as sin).

              Having come from C++, I always feel as if I have one hand tied behind my back when I’m doing php, or web programming in general. Having a form page that submits to ITSELF and then detects whether the page access is the first, second, or nth, drives me crazy.

              Separating presentation from code and designing for easy maintenance sometimes means that presentation has to occur on separate pages. It takes some odd moves to make sure that stuff from one page is available on another page and that code on one page knows what has happened in the user interface on another page. Creating PHP objects that are stored as SESSION variables seems like such a kludge to me that I avoid it when possible.

              I’ve seen some creative solutions to this in the MODx snippet code but none is really satisfying (to me anyway), but I have great hopes for future releases of MODx. Jason and others are clearly working in this direction and I can’t wait to see what’s coming.

              I think Rails solves some of these problems but it ties BOTH hands behind your back. I’ve also learned to avoid like the plague any language or platform that mentions Smalltalk or Ada in its description. It almost always means that it was originally created by a student with no real-world programming experience as a Masters or Ph.D. thesis.

              As an example, see Alice (http://www.ps.uni-sb.de/alice/), which is being touted as a language to use to teach OO programming that won’t scare women away from computer science. Putting aside the incredible insult to women, one look at it will tell you that it will never hack it in the real world (see Pascal). Does anyone besides me remember Turtle Graphics? It too was was supposed introduce OOP in a non-threatening way and to bring women into computer science. I once actually taught a class in it to fourth graders. No useful program was ever written in it.

              But I digress . . .

              Once MODx lets us have objects that automatically persist with the usual OOP bells and whistles (and a solid code editor that has syntax highlighting, autocompletion of HTML and PHP constructs, and lets us use the Tab key as God intended), it will rule the world. grin

              Bob
                Did I help you? Buy me a beer
                Get my Book: MODX:The Official Guide
                MODX info for everyone: http://bobsguides.com/modx.html
                My MODX Extras
                Bob's Guides is now hosted at A2 MODX Hosting
                • 27697
                • 11 Posts
                Quote from: BobRay at Sep 24, 2007, 11:54 AM


                "… and much more. In only 12,000 lines of code, including HTML templates. (Down from 90,000, before.)"

                Did you look at the author’s site? (http://cdbaby.com). Only 12,000 lines of code??!!

                Derek addresses this in the comments. To paraphrase: the 12k lines of code are not just the website, but lots of backend stuff and other web apps, including accounting and inventory systems.