Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Can anyone point me to what would be regarded as a best-practice PHP codebase? Ideally something that's testable.

I used to do all my work in PHP but moved to Rails and adopted TDD/BDD. I'm just not sure how this would fit back in to the PHP world.



4 of years ago I liked symfony. Haven't really tested it in a while though but later versions look like improvements in everything but learning curve. But I'd say the same goes for rails.


@AlexMuir I second this - Symfony2 has made huge strides forward for BDD. Here's an article that might help: http://docs.behat.org/cookbook/bdd_in_symfony2_with_behat_mi...


Thirded.

I came up to speed with PHP recently and spent a lot of time searching for "best practices" or other variations of that keyword to see what I could build on. The stuff I found was generally quite frighteningly bad, mostly people getting excited about the most absurd micro-"optimisations" (and that's after explicitly discounting anything more than a few years old).

But the ecosystem around symfony 2 seems to be where all the sane (imho) PHP developers are heading. In particular they seem to have drawn a line under old versions of PHP and made good use of the newer features added to the language to build modular components.

For a while I wondered whether everyone who wanted to use these techniques had all been driven out into the arms of Ruby (on Rails) and Python. But the Symfony guys seem to have just re-imported a lot of the best ideas back into PHP from projects like Rack, Sinatra, Django, Rails, Cucumber etc.


Check out the symfony framework version 2.1+ Its the best way to write PHP applications today and i am pretty sure its ahead of the web frameworks in most other popular languages.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: