4 ms·
models/ORM Doctrine does better job. - abstract model definition via yml file - multiple connections/databases/environments easily managed - Cool API (shortcuts
by hassenben 16y ago
models/ORM
Doctrine does better job.
- abstract model definition via yml file
- multiple connections/databases/environments easily managed
- Cool API (shortcuts, relations, custom tables etc.) + DQL for queries + support for multiple DB engines
admin interface / CRUD interface
- they are easy to generate but easier to customize under symfony.
- you can do 90% of the stuff via a config file generator.yml.
The rest is extending the generated code and customizing queries to the model
configuration
- you can do more via the config files in Symfony and control your project/applications vs Django.
forms system
- the abstract forms system comes with generated forms based on your model, widgets with validations, binding with your model, customizable renderers.
You can have a custom CRUD interface up and running and linked to your tables in less than a few minutes.
routing
- routing.yml and sfPatternRouting does a much better job without using complex regex patterns
- Also, all routes are abstract, understandable and well located.
testing
- Unit testing and functional testing is very well done. You can launch specific tests, launch failed tests only, call your model/forms easily because they are all objects, simulate a browser session etc.
You can do all that stuff with Django but will a lot more code.
framework vs API
- symfony abstracts anything useless as a plugin where Django tends to integrate some of it in their Framework (CSV, PDF generators etc.). That's a lack of vision.
Anyway, just a couple of points, I could go on and on ;-)
- jonknee 16y agoSo Django has a lot to learn by not having a lot of YAML config files? Its lack of YAML is actually a design goal.
- rbanffy 16y agoHaving read your careful answer, I have to ask: Have you ever used Django? Because all the things you say are either wrong (multiple db engines, forms for CRUD) or a matter of taste (the use of YAML, regexes for routing, including batteries). And, for the language thing, PHP is plain horrible.
- scorpioxy 16y agoAgreed. Seems to me his answer is mostly taste rather than actual use. The thing about "complex regex" struck me as odd. Why are his routing regexes complex? If they're that hard to write, then I'd suggest he'd revisit the routing scheme. I haven't used Symfony before because I rather not develop in PHP unless I really have to. Having said that, If i ever have to, I'd like to give Symfony a try.
- rbanffy 16y ago> I rather not develop in PHP unless I really have to One would have to hold me at gunpoint to convince me to use PHP for anything serious.
- stevenwei 16y agoThat's why I'm sticking with Python even if Django isn't a perfect fit for me. call_user_func_array(array($object,'method_name'),array($arg1,$arg2,$arg3)); is literally the most retarded syntax I've ever seen for invoking an object callback, and is indicative of PHP's roots as a non object oriented scripting language.
- code_duck 16y agoNo doubt, the way PHP deals with functions is one of the worst parts about the language. create_function and the rest have been made a bit better, though, with the introduction of anonymous functions in PHP 5.3.
- deleted 16y ago[deleted]
- stevenwei 16y agomodels/ORM Doctrine does better job - Agreed. admin interface / CRUD interface - Agreed. configuration - Agreed. forms system - Disagree, Django forms and generic views let you do the exact same thing. routing - Disagree. I've used several routing systems across web frameworks and it mostly comes down to a matter of taste. Django's system could probably be a little simpler (most of the time you don't need the full power of regexes to match simple numbers or string) but it gets the job done and stays out of my way. testing - Disagree. Why did they write their own testing framework (lime) when SimpleTest and PHPUnit already existed? framework vs API - Agreed. The added downside is that once a third party app makes it into Django core, it evolves much more slowly due to backwards compatibility issues.
- kingkilr 16y ago> Django tends to integrate some of it in their Framework (CSV, PDF generators etc.). That's a lack of vision. Beg pardon?