News for hackers. Stuff that matters.
Re:Why We Stick With PHP (and don't move to Ruby or Python) by AffableSpatula on Thursday February 24, 2011 @04:49AM (#2257441)
I have yet to come across a compelling web framework written in php.

If re-use between projects was really of concern for their community, they would've pushed for a standard http interface like rack - which they haven't, aside from a couple of brief (largely ignored) experiments.

php is a necessary evil in some instances simply because some useful apps have been built with it.. but if I'm writing a web application from the ground up there's no way I would opt for php.

Re:Why We Stick With PHP (and don't move to Ruby or Python) by harisenbon on Thursday February 24, 2011 @05:21AM (#2257477)
I rather like CakePHP (it's like ruby on rails, in PHP!(tm)).

While it maybe doesn't live up to it's RoR hype, it is a really solid framework, and has cut down on my development time by more than I can possibly express..

I find it alot easier to use than Symphony, and you can generally get a CRUD up and running in about 10-20 minutes right out of the box.

Re:Why We Stick With PHP (and don't move to Ruby or Python) by morganpyne on Thursday February 24, 2011 @08:20AM (#2257776)
Just a quick note - Symphony (the CMS) is different to Symfony (the Framework) - I presume you meant the latter? These two seem to get confused all the time.
Re:Why We Stick With PHP (and don't move to Ruby or Python) by harisenbon on Friday February 25, 2011 @12:06AM (#2261143)
Sorry, I did mean Symfony (the Framework), not the CMS.
Re:Why We Stick With PHP (and don't move to Ruby or Python) by kaylarose on Thursday February 24, 2011 @09:14AM (#2257957)
IMO Symfony (especially Symfony2) is much more Rails-ish than CakePHP. Cake PHP is Railsish in that it an MVC with psuedo-scaffolding, but Symfony2 is much closer to the real thing.
Re:Why We Stick With PHP (and don't move to Ruby or Python) by Seldaek on Thursday February 24, 2011 @05:12AM (#2257461)
Feel free to check Symfony2 at http://docs.symfony-reloaded.org/master/ - it does not have much to do with symfony1 by the way, in case you'd decide to dismiss it due to past experience.
Re:Why We Stick With PHP (and don't move to Ruby or Python) by xd on Thursday February 24, 2011 @07:35AM (#2257674)
Explain why you think it is a "necessary evil", really, I'd love to know what insights you have that I somehow missed over the last 10years of developing successful large scale projects with PHP.

You may also want to email the likes of Facebook, Yahoo, YouTube, Digg etc etc and let them know of the evil that lurks within.

Re:Why We Stick With PHP (and don't move to Ruby or Python) by rick888 on Thursday February 24, 2011 @12:34PM (#2258887)
I feel like many developers are using RoR and Python simply because it's 'cool'. The old, reliable languages are boring. I also don't like the fact that many frameworks out there abstract layers away and make it so you don't really know what's going on underneath. This makes it easy to say you are a developer (because you can make something) when you are just mashing frameworks together.

I've also been using PHP for the last 10 years and have never had problems scaling or writing good code.

Re:Why We Stick With PHP (and don't move to Ruby or Python) by xd on Thursday February 24, 2011 @01:31PM (#2259175)
I couldn't agree more.

I choose PHP, all that time ago, because back then I was a C developer. I fell in love with the fact you could create your own C extensions and that the PHP syntax was similar to C syntax, so it was easy to pick up and make it do what I wanted it to do.

I've only every toyed with frameworks, never used one as such, because I built my own library up over the years that is suited to my needs.

Re:Why We Stick With PHP (and don't move to Ruby or Python) by AffableSpatula on Thursday February 24, 2011 @02:45PM (#2259513)
Cmon man, I didn't say it is impossible to build scalable web apps with it. The php landscape's lack of an equivalent to rack is an insane situation for a 'web' language, and a good example of why it's a bad choice of platform if you have the option.

Yes, you can write scalable web apps with php.. you can also walk everywhere on your hands; but it's unnecessarily painful and awkward, so most sensible people avoid doing it on a regular basis.

Re:Why We Stick With PHP (and don't move to Ruby or Python) by xd on Friday February 25, 2011 @03:50AM (#2261565)
You've heard of the PHP SAPI, right?
Re:Why We Stick With PHP (and don't move to Ruby or Python) by AffableSpatula on Friday February 25, 2011 @04:27AM (#2261642)
yes, what's your point?
Re:Why We Stick With PHP (and don't move to Ruby or Python) by xd on Friday February 25, 2011 @05:01AM (#2261707)
Rack is the PHP SAPI equivalent ..
Re:Why We Stick With PHP (and don't move to Ruby or Python) by AffableSpatula on Friday February 25, 2011 @05:27AM (#2261755)
It's not. Rack's a framework for composing applications of middleware/intermediary components by specifying conventions for delegating requests and responses.
Re:Why We Stick With PHP (and don't move to Ruby or Python) by xd on Friday February 25, 2011 @05:39AM (#2261770)
From the blog on the rack website: "Rack aims to provide a minimal API for connecting web servers and web frameworks."

The PHP SAPI handles the HTTP request and dissolves it into super globals for the environment to consume. This is all you need to handle a HTTP request. It just doesn't get any more minimal than that.

You can, if you want, take it a step further and add request routing, i.e. http://framework.zend.com/manual/en/zend.controller.router.h...

Re:Why We Stick With PHP (and don't move to Ruby or Python) by AffableSpatula on Friday February 25, 2011 @05:50AM (#2261793)
Rack is about composition and modularity of the request handling components, not just providing programmatic access to properties of an http request.
Re:Why We Stick With PHP (and don't move to Ruby or Python) by Joeri on Thursday February 24, 2011 @03:48PM (#2259770)
I would have agreed a few years back, but these days the amount of PHP code I write relative to the project size is small enough that there's no ROI to switch platforms, even for new projects. Most of the code I write is static javascript, and PHP exists only to load and save the business data.

That's also why all of those frameworks aren't very relevant to me. I have no use for server-side MVC because the server isn't involved in the application UI. I have no use for ORM, because building up an object structure in memory only to deflate it again into a web service response is often overkill. I do use Zend Framework, but I use it to simplify my transactional DB logic and to assist in bootstrapping the web services.

Re:Why We Stick With PHP (and don't move to Ruby or Python) by OstiaAntica on Thursday February 24, 2011 @06:23AM (#2257548)
Re:Why We Stick With PHP (and don't move to Ruby or Python) by damncabbage on Thursday February 24, 2011 @07:03AM (#2257605)
I'm a big fan of Yii, and I use it a lot in my own projects. (The fact that it has an nigh-direct clone of Rail's ActiveRecord helps.)

It does, however, have the same problem that a lot of other PHP frameworks have in that, unless you're really careful, your components are "trapped" because of the Yii idioms and base classes.

I think Mr Spatula's point stands. Code reusability in PHP is nothing like what it is in the Ruby world.

Re:Why We Stick With PHP (and don't move to Ruby or Python) by Supermighty on Thursday February 24, 2011 @07:29AM (#2257662)
I find it interesting that the positive things I hear about PHP frameworks are in reference to features influenced by RoR.
Re:Why We Stick With PHP (and don't move to Ruby or Python) by asnyder on Thursday February 24, 2011 @11:59AM (#2258720)
That's probably only true because you hear about it here, which is a very self-selective group, who tend to lean towards Ruby, Python and the "popular" trends. In the PHP community being like ruby, or rails is not necessarily a plus and can in fact may be a negative depending on what you're trying to accomplish.

Frankly I'm sick of articles such as these, as if the author is pleading with this selective community that it's OK to use PHP. Somewhat sickening. They should feel confident in the tools they use without having to justify it to anybody.

Re:Why We Stick With PHP (and don't move to Ruby or Python) by xd on Thursday February 24, 2011 @08:02AM (#2257731)
Active Record (http://en.wikipedia.org/wiki/Active_record_pattern) is an architectural pattern and not something born in RoR. The parent just happened to mention an implementation (for which there are many in PHP) copied from RoR.

I'm curious, what other RoR influenced PHP framework features have you heard of?

Re:Why We Stick With PHP (and don't move to Ruby or Python) by damncabbage on Thursday February 24, 2011 @08:46AM (#2257834)
The pattern is good. It's the extras on top of what the pattern proscribes, though, that makes Rails' implementation great, eg. composition via behaviors, easy validation and relations, and scoping for bundling sets of common query criteria.

PHP implementations run the gamut from basic low-hanging-fruit-grabbing attempts (like CodeIgniter's frankly, well, weird implementation) to fully-featured ones like Yii. I do agree that they goes as far as doing most of RoR's implementation and then just... stop.

> ... what other RoR influenced PHP framework features have you heard of?

RoR-like routing shows up frequently as well, and in Yii's case, Views templates have the same access to both directly-assigned template variables, and variables belonging to the controller instance itself.

Re:Why We Stick With PHP (and don't move to Ruby or Python) by bergie on Thursday February 24, 2011 @05:53AM (#2257514)
It looks like there is some hope for code sharing and consolidation through the Apache Zeta Components project: http://bergie.iki.fi/blog/php-finally_getting_an_ecosystem/
Re:Why We Stick With PHP (and don't move to Ruby or Python) by rick888 on Thursday February 24, 2011 @12:29PM (#2258855)
I just started using the CodeIgniter framework. It has a small footprint and doesn't try to include the kitchen sink (which is one of the reasons I stayed away from frameworks for so long).
Re:Why We Stick With PHP (and don't move to Ruby or Python) by FreebytesSector on Thursday February 24, 2011 @01:17PM (#2259098)
You should consider taking a look at the Yii framework. It is an alternative to CakePHP, it is new, and it is fun.