News for hackers. Stuff that matters.
Re:How Hibernate Almost Ruined My Career by jpgvm on Thursday February 16, 2017 @08:17PM (#13665140)
I used to think I needed to learn an ORM to be able to write maintainable software.

However time taught me writing maintainable SQL with good migration story is way better. ORMs make porting queries to another project that needs to use the same database difficult. It's less obvious what is really happening and the performance usually isn't as good as hand written SQL. Hand written SQL also means fine grained control over prepared queries, access to vendor specific features (advisory locks, LISTEN/NOTIFY, triggers), materialised views etc.

You could argue these should be domain of DBA but in my opinion all devs should atleast know SQL at this level.

Re:How Hibernate Almost Ruined My Career by mb_72 on Friday February 17, 2017 @12:23AM (#13666149)
> ORMs make porting queries to another project that needs to use the same database difficult.

Wouldn't you have written a shared library through which both projects access the same database?

I know SQL pretty well (20+ years experience), but still use ORMs with nary a reason to hand-code any SQL any more. As a small-business-focused consultant using Microsoft technologies I do realise this puts me in a different bracket than others using larger-scale datasets and so forth, however for me using an ORM makes my life easier, makes me more productive, and with a little attention to detail doesn't result in performance issues for clients.

Re:How Hibernate Almost Ruined My Career by al2o3cr on Friday February 17, 2017 @07:55AM (#13667928)
"ORMs make porting queries to another project that needs to use the same database difficult."

Are you arguing that that's a bug or a feature? Because literally every system I've worked with that's gone down this road has been a maintainability disaster, with the entire database schema treated as an API...

Re:How Hibernate Almost Ruined My Career by specialist on Thursday February 16, 2017 @10:48PM (#13665765)
ORMs also increase the cost of change, thwarting code evolution / refactoring.
Re:How Hibernate Almost Ruined My Career by flukus on Friday February 17, 2017 @02:18AM (#13666568)
I'd definitely disagree there. It's a lot easier to refactor code than to refactor a multitude of sql statements.
Re:How Hibernate Almost Ruined My Career by specialist on Friday February 17, 2017 @09:40AM (#13668505)
How about when refactoring your database? How does that impact your mappings, DAOs, testing regiment?