Hacker News new | ask | show | jobs
by beryilma 707 days ago
But, in a way, OO modeling and design was invented to solve the mess that "banging out" procedural code created in the first place.

You have to model your business domain in software one way or another anyway. Why should it be bad to try to be more methodical about it using OO methods? We do it with relational databases all the time where tables are pretty similar to objects.

2 comments

OO and Relational databases really don't mix well, so much that there are wikipedia articles on the subject [0].

ORMs create some of the worst SQL table layouts that I've ever seen, not to mention they generally cause tons of N+1 query problems.

[0] https://en.wikipedia.org/wiki/Object%E2%80%93relational_impe...

I actually have nothing against objects and methods, but that’s a very limited subset of OO. I prefer to use algebraic data types for domain modeling, and giving them methods is totally fine too. But I do prefer them to be immutable in most cases, which is also quite counterintuitive from an OO perspective.