← Back to context

Comment by TZubiri

1 day ago

I'm not hugely experimented, and SQL has always been enough for me, perhaps due to my simple requirements. But so far I hold the opinion that ORM is always a mistake.

I find a lot of programmers don't know how to write an array of floats to disk, if you forced me to choose between an ORM or No DB at all, I would choose no DB all day.

ORM feels like an abstraction on top of an abstraction. I don't trust that those who chose ORMs have studied and exhausted the possibilities of the two underlying layers, I feel more often than not they recourse to higher layers of technology without understanding the lower level.

But I may be wrong, maybe those who use ORMs know all about File systems and Posix and SQL itself.

It also reminds me of the people who ask chatgpt to write a prompt for them, it's as if you had a dishwasher and you were too lazy to load the dishes onto the dishwasher, so you buy a product that loads the dishes to the dishwasher.

I know both and ORMs are fine. They save a lot of time at the cost of some inefficiency. However some of the newer ones are like Entity Framework Core for dotnet are significantly smarter than older models.

  • Is that time saved initially but paid later as tech debt? Or time saved on the long run?

    • often the debt is fine and doesn't need to be paid back. Its only tech debt when its a hotspot. For example all the ORM code that handles admin functions that the vast majority of the user base don't use.

> ORM feels like an abstraction on top of an abstraction. I don't trust that those who chose ORMs have studied and exhausted the possibilities of the two underlying layers, I feel more often than not they recourse to higher layers of technology without understanding the lower level.

I agree with that. However I feel that teams that choose not to use an ORM end up having one somehow reimplemeted by the seniors, and just used as you describe by the juniors.

I'd rather have the seniors master an existing ORM and spend their time elsewhere.

  • Surely it would be an ORM designed specifically for the business domain, instead of a generic ORM.

> I find a lot of programmers don't know how to write an array of floats to disk

what does that have to do with it?

  • I think his point is that ORMs (and maybe DBs in general) are used for data persistence by folks who just don’t know any alternative.

    • Yes that is my contention.

      This Simpson's clip summarizes it in a more poetic style

      https://www.youtube.com/watch?v=2BT7_owW2sU

      I've seen a common problem for auto-didacts is that, since the advanced and modern concepts outnumber the fundamentals, they often find themselves learning advanced concepts before the basics.

      This is especially common in programming with stackoverflow or AIs where the devs look for the quickest and easiest to use solution, pushing the code and complexity beneath the rug under the dependency layer, so that their implementing code looks nice and clean.

      It's hard to figure out as a begginer that the simplest and most basic solution are 10 lines of POSIX function calls, instead of three lines of "import solution" "setup solution" "use solution".