Sponsored by Rockstar Games
Grand Theft Auto: Episodes from Liberty City view!
rockstargames.com - Out Now on Disc for Xbox 360. Includes The Lost and Damned plus the all-new The Ballad of Gay Tony.
33 Comments
- shakin, on 10/12/2007, -1/+17Well, you know how you need to code the same stuff for each project? Like, for instance, a database layer, controllers, etc. A framework takes care of the things you re-write for all your projects. Different frameworks may make different program design choices, so you must choose one that matches how you like to design your programs.
If you've been programming for a long tme chances are you already have a sort of ad-hoc framework. You may have a database class and a template class that you re-use for all your projects, for example.
A good framework will go beyond that. Rails does Active Record really well and has CRUD generation. Lots of frameworks do CRUD. They may also give you a Javascript and AJAX library, templating system and more.
The idea is to let the programmer get down to creating business logic without messing around so much with backend stuff. With a good framework your productivity can increase a lot, but there is a learning curve you must get around first. - francois, on 10/12/2007, -0/+7You don't have to use the command line, symfony offers a web-based alternative for those who know how to configure their web server...
http://www.symfony-project.com/content/book/page/control_panel.html - genotrance, on 10/12/2007, -5/+9Symphony looks decent. Here's my mini-review:
I like:
- The database initialization. You create a schema.yml and it automatically populates your database. That's a nice feature.
- The form validation seems nice. However, the schema itself can specify required vs. optional fields using the NULL field. Ya, their implementation does a bit more but all the same...
I don't like:
- Too many scattered files to edit. This is why I created Phpfw.
- The templating system is ugly as hell. Perhaps it could be done cleaner. The tutorial claims shortage of time but being an intro, it would have helped to make things more readable.
My take home is that I can incorporate the database initialization routines in Phpfw. As for the other items, I'm still glad I wrote Phpfw for my use.
Some links:
Phpfw : http://www.genotrance.com/pmwiki.php/Programming/Phpfw
Why I like PHP : http://blog.genotrance.com/2006/06/14/php-is-easy/
Why I don't use Rails (yet) : http://blog.genotrance.com/2006/06/20/wheres-ruby-and-rails/ - gann, on 10/12/2007, -2/+5sourceforge?
- kitsonk, on 10/12/2007, -1/+4That is great, very well written. I am going to have to check it out. Seems to be quite powerful for those ad-hoc type of projects that you sometimes need to do.
- bitt3n, on 10/12/2007, -1/+4I've coded some PHP but I'm not sure what a framework is for.. what is a good nutshell description?
- nife, on 10/12/2007, -1/+4If you want a great tutorial look at the askeet tutorial on the same site. Much more information and being actively changed.
I liked symfony however I think I will stay with rails. - bmabey, on 10/12/2007, -1/+4"A programmer relying on a series of command line commands to be productive is bad."?? I think that a programmer that is dependent on a "wizard interface" is a lot worst off than a programmer who is "relying" on command line. Command line is a lot closer to the machine and I so I think it is more natural. From what it sounds like pongx you might want to stick to .NET and VS.
- erestar, on 10/12/2007, -0/+3I've put 6 projects into production with Symfony and am using it for several more that are in the works. The documentation is excellent, and the community support is fantastic.
I'm not going to comment on whether it's better than CakePHP, but I seriously suggest watching some of the numerous videos or reading the Advent Calendar or other tutorials on www.symfony-project.com before believing digg comments that give no actual reasoning as to why Cake is better. - Jicksta, on 10/12/2007, -0/+2Guys, people are moderating the parent comment *down*? C'mon, I don't know this guy, but it makes me cringe when intellectual points are pushed down beneath the floorboards. I'm a RoR developer and should have every right to harness a grudge, but this is the kind of intelligent dialog the community needs to clarify differences in technologies and communicate perks and pitfalls.
Genotrance, I read your blog about Ruby on Rails and would like write a response to yours on my blog. I found your email address on your Clump page, so check your inbox tonight or tomorrow afternoon. - akinas, on 10/12/2007, -2/+4Symfony is likely the ONLY framework that took i18n seriously from the start. This might seem trivial, but look at Zooomr - part of it's success is that it "speaks your language".
- brujahRg, on 10/12/2007, -0/+1I've used both CakePHP and symfony. And CakePHP is fine, but symfony rocks!
- ankitind, on 10/12/2007, -0/+1Symphony official site has got some real nice tutorials who any beginners to dive in addition to the basic tutorial too.
- thetasine, on 10/12/2007, -2/+2This is a good tutorial, but I have serious reservations on frameworks that rely too much on command line interfaces to do a lot of the dirty work. While Ruby-On-Rails has had moderate success, I can't help but think that many PHP frameworks want to copy this method (aside from the MVC paradigm) to make themselves "successful".
I'd rather have a PHP MVC framework that works using just PHP files and maybe some text files for configuration, and zero command line interaction. - digg753, on 10/10/2007, -0/+0
symfony provides you with many choices while abiding by the principals touted by Rails, CafePHP, and other frameworks. Like Rails and CafePHP, you can run a symfony app out of the box with the few and necessary configuration changes for your environment, those that are required for any framework. It incorporates DRY principals and 'convention' over 'configuration', overused cliches that basically mean everything need only be defined once, and everything has a proper default configuration somewhere, in the code or an external file. Webapps require configuration. Frameworks must provide defaults. No rocket science here. symfony is designed with granularity in mind since 1)I have yet to repeat code or configuration in my projects, and 2) you can keep it simple and accept the defaults or get down to increasing levels of granularity to suit your requirements. It can be comforting to know you have the choice if it becomes necessary.
symfony has extensive and extendable functionality which stays out of the way until *you* bring it into play. This means 'possibilities', not 'heaviness'. You can keep it as 'lite' as you want it. A well organized, mature, extensible, and efficient api is there if you want to use it for the purpose. Build a serious system and you will find symfony's extensive functionality necessary. For example ...
apps, environments, i18n, i10n, protoype and scriptaculous integration, integrated ajax viewer for logging/debug/profiler/config/sql execution traces (bring up a web page and get immediate information about the transaction), xhtml integration, templates/layouts/partials/components/slots/fillins, helpers, filters, validators, utilities, tools, cache optimization, opcode cache interface, plugin interface, library bridges, cli, testing, yaml, security, performance tweakability, outstanding docs, scaffolding/crud/admin generators, tools, batch processing, and so on.
... you need this kind of functionality to build any serious state-of-the-art 'Web N.N' webapp, no matter which framework you use. If your framework of choice gives you what you need stay with it. symfony, Rails, CafePHP, etc. can all help you work equally fast. symfony or Rails in 3 seconds is less important than 'what is possible after they can do it in 3 seconds, what is next?'. It is the amount of functionality available and the quality of documentation which tells you how to use it. If you don't know how, an api is useless. With symfony you don't have to buy the book. The entire book is online at http://symfony-project.com, together with the api. symfony is very well documented.
It takes time to learn how to do anything serious in software development, no matter which framework you use. A webapp will not spare you the task. The framework will, if it can. - MrTufty, on 10/12/2007, -0/+0I agree. Fjleon - Symfony does automate a lot more, but CakePHP's requirement to hand-code so much can partly be offset by the "bake.php" script included with it, and is really simple anyway, just using standard PHP syntax.
- strictnein, on 10/12/2007, -4/+4Where's the framework where I no longer have to write any code at all?
- digg753, on 10/10/2007, -0/+0symfony gives you lots of options. You don't have to use a command line. Instead, create the standard folder structure for a symfony project manually by copying and altering the symfony sandbox/askeet project or typing it in (heck no!!). Repeating these tasks manually could introduce errors. The scripts are repeatable, and therefore failsafe. As francois points out, symfony also has a control panel plugin which provides a web interface.
Serious systems tend to require some lengthy processing which can timeout a web transaction. (Re)building the entire model for a large database will naturally take time. My souped up machine maxes out cpu for several minutes. For this task I cannot use the symfony control panel unless the web server transaction timeout is increased to 6 minutes. It doesn't matter which framework I use, the task remains the same, time-consuming. This means a need for scripts run ad-hoc through a CLI or regularly through a scheduler, *without* any layers of software in between which could fail.
A script does the grunt work for you. Wrap the symfony command line with your own scripts. Mine prompt for the required parameters or use defaults for my projects. Instead of pointing and clicking a web interface and waiting for responses, I can run a single script to accomplish what needs to be done, *immediately*. Once you have a script library you rarely need to lookup symfony CLI docs. Having spent a little time up-front, the CLI has made my development work 'sustainably efficient'. - smedrick, on 10/12/2007, -3/+3Not to take anything away from the article (looks like a great tutorial that I want try out), but this does not look as attractive as Code Igniter (another great PHP framework).
- weaz, on 10/12/2007, -3/+2Code Igniter rocks. Lightweight, fast, and well documented. It doesn't have an exhaustive set of features, but it has all of the essentials and you can be up and coding within 10 minutes or so. Plus, the tutorial movies on their site are very well done.
- pongx, on 10/12/2007, -4/+3Relying on a command line to do the setup of the db and lots of other little things annoys the bejezus out of me. I want to be able to run a php install script and for it to just freeking work, especially for a sandbox type app. If I have to run a bunch of little commands to get everything up and running, I have some serious reservations about portability and backups using this system. Relying on a framework is one thing if it works slick, but I don't want to have to learn a bunch of command line crap just to be "more productive". I'd be more productive if they cut out some of those steps so I can get down to the coding without jumping through hoops. They could do it via a php wizard interface or something cool like that or maybe a text file. I dunno. A programmer relying on a series of command line commands to be productive is bad.
- Zerfram, on 10/12/2007, -1/+0What would be a good framework for a php/mysql web accessed database?
- CapnBob, on 10/12/2007, -1/+0Symfony's codebase is way too heavy, the API is needlessly complex and overblown, and rather than being about convention over configuration they seem to be about convention *and* configuration; lots and lots of configuration.
Also, since much of the framework is just a mashup of other peoples' projects, not only do they not have clean IP (so that ruled it out for any of my business projects), but if you have a problem with a component they didn't build (i.e. Propel), all they can tell you is "go talk to the Propel guys". - wonderbud, on 10/12/2007, -6/+5creating applications.
checkout www.cakephp.org ... its much better. - thetasine, on 10/12/2007, -2/+0francois: thats good information to know.
- MrTufty, on 10/12/2007, -2/+0Then look at CakePHP - although Cake does have a "bake" script that automates the creation of some things for you, it's perfectly possible and even recommended that you create them yourself. It uses standard PHP code throughout, and is compatible with both PHP4 and PHP5. The only actual config file you'll probably need to edit is the database config, and possibly (for certain hosts) changing a few variables setting the location of your directories in a single file. Trust me, it's easy.
The documentation could be better, but it's improving all the time. Symfony does have better docs, but is significantly slower and harder to build bigger projects (I'm sure some Symfony experts will argue that point, but in my 4 weeks I spent with Symfony I found myself fighting against the framework more than it helping me). - fjleon, on 10/12/2007, -3/+1cakephp is simpler, but you need a lot more of hand coding. just check the video samples on both projects.
the symfony guy gets the blog done in less than 15 minutes, the cake guy in about 30, although some of the delay was because the cake guy was using only the command line and vim, where the symfony guy used a editor with nice shortcuts - aaronshaf, on 10/12/2007, -5/+3*cough* CakePHP *cough*
Way easier to learn and use! - GORby, on 10/12/2007, -5/+2I can't compare the frameworks that were mentioned here earlier, but I got some good experiences with another one: QCodo (http://www.qcodo.com).
You should check it out if you regularly need to create CRUD apps, because it generates a lot of code based on your database's structure. - Splizxer, on 10/12/2007, -9/+4VB.net?
- cptcomic, on 10/12/2007, -9/+3News? The first comment to this tutorial dates back to 2005-11-16.
- nilobject, on 10/12/2007, -7/+1Why pour salt in your eyes with PHP when you can instead drink the sweet, sweet elixir that is Django? (http://www.djangoproject.com/)
- mutant, on 10/12/2007, -8/+1Symfony? Gak.. Get a real framework.. CakePHP


What is Digg?