Hacker News new | ask | show | jobs
by alephu5 1712 days ago
With an ORM you can leverage the IDE to get field names, types and descriptions by simply typing out the name of the model. In pure SQL you need to memorise the schema, or continuously switch contexts to refer back to it.

Another advantage is that you type-check your queries, whereas with pure SQL you can accidentally load a number into a string variable and crash the application.

Because of this I prefer very light ORMs that abstract almost nothing. Those that provide model definitions, automatic migrations and a one-one SQL mapping.

2 comments

I guess it's all the standard trouble with DSLs: poor tooling integration, having to work at different layers.

An IDE that understood SQL would probably mitigate almost all opposition and yet nobody came up with one after all these years. So I guess the standard DSL defense doesn't really doesn't work.

All right, point taken, I'll take my downvotes and go home :) I don't use an IDE and most people I work with don't either. But this is a useful reminder that the world can be very different outside of one's bubble.

> Because of this I prefer very light ORMs that abstract almost nothing. Those that provide model definitions, automatic migrations and a one-one SQL mapping.

Any particular recommendations? I tried hibernate in java and was put off by complexity.