4 ms·
I wrote my company’s giant backend in Django, and while I don’t regret it, five years in the ORM still makes no sense to me for more complex cases and really, r
by etaioinshrdlu 5y ago
I wrote my company’s giant backend in Django, and while I don’t regret it, five years in the ORM still makes no sense to me for more complex cases and really, really miss languages with better type checking. The current options are not good enough or have no library adoption.
- divs1210 5y ago> The current options are not good enough or have no library adoption. What about SQLAlchemy?
- etaioinshrdlu 5y agoI meant that the current options for type checking are not good enough.
- tgv 5y ago> the ORM still makes no sense to me for more complex cases IMO, it also doesn't make sense for simpler cases where nearly everything can run in a browser.
- one2three4 5y ago> miss languages with better type checking. What about python type hints?
- da39a3ee 5y agoThat's why he said "better". Have you used both A. python with type hints and B. Typescript, or a statically typed language such as Rust/Java ? I'm guessing not.
- tomwojcik 5y agoIt's hard to static type with DRF, even with drf-stubs package. Good luck with static typing your managers, it's impossible due to circular imports. It's easier if you add services layer but not many people like it. There's also a lib which allows you to convert db entities into dataclasses so it's easier to throw around types but it's not a "Djangoese" approach so I'd be very careful with that. With microframeworks it's easier as you can structure your project as you like add more layers of abstraction so it's not that tightly coupled. Fe. sqlalchemy -> pydantic schema.
- cies 5y agoThe article makes a lot of sense to me. My main gripe is with the choice of Django (which is a given, I understand that). Anno 2021 I'd never choose a lang+FW that does not bring strong types, and type safety over several system barriers. Like using Kotlin+jOOQ for the backend. Or use no backend at all and use Hasura with a generated client lib in Elm. Or Rust with Yew. I know these are not as much used as Django/Rails/Express/Spring+Hibernate, but I'm just not ready to walk into the no-type-safety swamp again out of my free will.