Hacker News new | ask | show | jobs
by allendoerfer 600 days ago
Type hints are were the whole Python ecosystem is going, so using them is more integration at a deeper level than using an integrated framework, which is not relying on them.

SQLAlchemy was historically a much better ORM than Django's. It's layered architecture combined with Alembic does make a difference.

I still agree that using the integrated thing anyway is probably the right way to do it if you are working in a team. I also think Django should just adopt these components and we would not have the discussion in the first place.

2 comments

> Type hints are were the whole Python ecosystem is going

I see what you’re saying, but a lot of Python users, especially those who have been using it pre-3, would say that this is unfortunate.

> I also think Django should just adopt these components and we would not have the discussion in the first place.

Oof, such a monoculture sounds terrible to me!

I think SQLAlchemy vs Django ORM was a 2007 blogging topic: https://www.b-list.org/weblog/2007/sep/04/orm-wars/
While it is not Django's responsibility to unite the Python ecosystem, continuing to rely on a tool a sizeable share of the community deems inferior to a popular alternative will keep these discussions open and results in the fragmentation OP is talking about.

Now of course it is not Django's responsibility to unite the Python ecosystem in the first place and they can value other factors and arguments as they see fit.

Although this very thread shows that there might have been something to it.

A corollary is the debate itself leads to a waste of effort that multiplies across all users. I use Rails only in anger, but to see literally nobody bike shed on the ORM is pretty amazing. Seems like you use Active Record or you write SQL and either way move on with life.
In ruby, the sequel database toolkit is vastly superior to activerecord, and that is a subject of discussion here and there. The difference is that rails is what most rubyists use at work, unlike in python, where choices are more diverse.
Why would Django move away from an ORM that works, at scale, in millions of deployed websites? They'd have to support both for many years in any case.

> a sizeable share of the community deems inferior

Well, yeah, SQLAlchemy is standalone, you can use it in a lot more situations than Django's ORM in practice, because you're not tied to using it in a Django site. But that doesn't mean it's "better"