4 ms·
Oh, so if I want to add a simple checkbox boolean field on a model on a proper best practices Clean Code Uncle Bob-approved code base in 2024, I have to: - add
by henning 2y ago
Oh, so if I want to add a simple checkbox boolean field on a model on a proper best practices Clean Code Uncle Bob-approved code base in 2024, I have to:
- add it in the database model
- make a database migration for the field
- add it in the DTO for the API because we don't want to couple our persistence layer to our business logic or something
- add it to gRPC/Protobuf models so other services can call it
- add it to the new TypeSpec model thing
- update tests of all of the above
I love in tech 2024, it's full of people who talk about "DRY" who force you to repeat the same things over and over again, and this is "clean code", and if you don't like it, fuck you, you aren't a "culture fit". Utterly batshit insane.
- outlore 2y agoI understand your frustration, but this is the price paid for schema compliance across systems. One qualification: the TypeSpec model should help generate your API DTOs (OpenAPI, Protobuf) etc. So hopefully that saves a step or two. As an aside, I have tried doing a full stack TypeScript application where database types trickle down to the client, it ended poorly, since the API affordances can and should evolve separately from the database design. Therefore, I do feel that separation of database and API types is necessary.
- miohtama 2y agoNow, let me tell you about microservices... (: