Slashdot Mirror


Which PHP5 Framework is Your Favorite?

matt_j_99 asks: "With all the talk about Ruby on Rails, I've been thinking about PHP frameworks. Ruby on Rails looks pretty cool, but frankly, I don't want to learn a new language. It seems that with all the slashdot discussion about RoR, somebody always makes the valid point that PHP is not a framework. But with PHP5's, Object Oriented features, a standard framework might emerge. Prado, Carthag, BlueShoes, and PHITE all seem like interesting frameworks. What PHP frameworks have you used in your applications? What were the pros and cons of each? Which framework do you think will have the best chance of long-term viability and maintenance?"

1 of 138 comments (clear)

  1. Re:Which PHP App? by ttfkam · · Score: 1, Flamebait

    I moves away from ASP several years ago into PHP.

    Sounds conspicuously similar to "I was coding in Prolog when I discovered BASIC."

    For very simple pages, pages that amount to slightly more code than a server-side include, PHP is a perfect fit. This is obvious because PHP was originally made to be a page-embedded version of Perl -- originally written in Perl. Back in the days of CGI scripts, mostly in Perl, when you only had a little bit of code and a lot of markup, PHP (and ASP, ColdFusion, etc.) were a breath of fresh air.

    However...

    Embedding logic in your presentation layer is a bad idea. It ties your code to how your presenting it. Want to change how your site looks? Gotta change code. Want to change from HTML tables to CSS? Looks like it'll be a fundamental rewrite.

    This is the problem that PHP -- and most mod_perl-based frameworks for that matter, like Slashdot -- have. It's a write-once language that you simply pile more and more code on until it breaks. Then you start over again.

    I would have made the switch earlier, but I had the same preconceived notions that you have -- that it was a language for amatures. Before ASP, I did straight C CGIs as well as dabbling in perl and AppleScript (I'm not sure which was less up to the task at the time...I still can't stand Perl for anything more than shell scripting and never understood how it took off for the web...but some people are very capable programmers even with a crappy language).

    We do not have the same preconceptions. We are coming from completely different points of view.

    You: PHP is just as valid a programming environment -- if not more so -- as ASP, JSP, ColdFusion, and all the others for writing logic in web pages.

    Me: Writing logic in your presentation layer (your web pages) is a bad idea no matter what language you use.

    See the difference?

    But since the time I moved over to PHP, my programming has gotted a LOT better. I stopped reinventing the wheel each and everytime I had a problem.

    Of course you have. Usually the more you do something, the better you get at it. But I'm not suggesting that you drop PHP for something like JSP. I'm suggesting that they both suck as web development models. PHP is simply the newest kid on the block to support this crappy development model.

    Everything is class oriented now instead of using pseudoclasses under ASP (dictionary objects and other hacks...and yeah, I know asp.net can deal with these, but I switched at a time that this wasn't an option nor was the lock in).

    But ASP had CreateObject to instantiate any scriptable COM object registered with the system. ASP was meant to be a logic linking framework, not the logic itself. In other words, the code that did the heavy lifting was not supposed to be the Visual Basic Script; it was supposed to be your COM objects -- written in a more powerful language.

    People are writing the "heavy lifting" code in PHP. This design pattern is known as "Big Ball of Mud." You may be getting better at giving it form, but it's still a ball of mud.

    For once, I have the same ability to program that I did back in the C(++) days of compiled CGI apps without having to do 10x the programming (the speed was nice once, especially if the server allowed for caching the app).

    So in other words, you are doing today what you did ten years ago, only faster -- neither cleaner nor more secure.

    Incidentally, speeds for process invocation and forking on many platforms has increased dramatically. Those old CGI scripts in C and C++ would run faster even on the same hardware, eg. running the same code on Linux 2.0.x versus 2.6.x.

    And I'm still only using PHP4...5? I haven't seen anything in 5 thats got be thinking of switching yet. All the problems you complain about are things that ANY language has...a

    --

    - I don't need to go outside, my CRT tan'll do me just fine.