3 ms·
After starting with about 10 years of Perl, then 6 years of Ruby on Rails, and finally entering the world of Django I see the following problems: ++Lack of Con
by whatnotests 9y ago
After starting with about 10 years of Perl, then 6 years of Ruby on Rails, and finally entering the world of Django I see the following problems:
++Lack of Consistency in Project Structure:++
* The Django way of "several applications are in your application" creates many folders, each with either a models/ folder or models.py.
++Django ORM:++
* Writing a model which generates a migration, prefixes table names based on the "sub-application" name in my application is just awful. The default names for these tables is just another layer of cognitive load to bear.
* Implicit relationships between tables, vs allowing me to specify has_one/has_many/belongs_to/has_many_through/etc relationships.
* I miss FactoryGirl. Specifically I miss FactoryGirl's feature of allowing me to declare associations between my factories, then creating upstream objects in the proper order. Without this feature, I get a lot of repeated 'setup' code in my unit tests, which makes my tests brittle, and lowers their value.
++Django Testing:++
* Writing unit tests without the describe/context/it style feels like I just took a bus back to 1998. Combined with the lack of FactoryGirl, I see test suites that barely test the "happy path", let alone any "sad path" cases.
* Due to the brittle boilerplate setup code in unit tests, minor changes to the code tend to break tests badly, further slowing down the pace of development.
* The alternative to constantly fixing broken tests is to have fewer tests (or no tests) which is even worse IMO, since only your customers will test code code.
* The Rails way of writing a migration, making factories, making model specs, then controller specs (and finally features for end-user acceptance tests) seems to have gone completely off into an unknown future from the perspective of Django, who was left behind, frozen in time at the end of Bill Clinton's last term in office.
- satyanash 9y ago> I miss FactoryGirl ... I get a lot of repeated 'setup' code in my unit tests, Recently discovered these two projects, thought I'd mention them: * Model Mommy (https://github.com/vandersonmota/model_mommy https://github.com/vandersonmota/model_mommy) * Factory Boy (https://github.com/FactoryBoy/factory_boy https://github.com/FactoryBoy/factory_boy)
- whatnotests 9y agoOh wow. FactoryBoy doesn't appear to handle relationships but ModelMommy does. Thanks for sharing!