3 ms·
Many gophers hate magic. ORMs are specifically magic, and therefore not very popular with many gophers. Many gophers have a lot of experience in other languag
by NateDad 13y ago
Many gophers hate magic. ORMs are specifically magic, and therefore not very popular with many gophers.
Many gophers have a lot of experience in other languages with ORMs and have been burned by them on many occasions.
I like to say - ORMs make the easy stuff easier, and the hard stuff harder. If you're only doing really simple object storage and your data model easily fits with the model the ORM expects, then it's not too bad. If you EVER want to deviate from that model (and you'll ALWAYS end up wanting to deviate from that model), then you are gonna have a bad time.
There actually are plenty of Go ORMs: https://code.google.com/p/go-wiki/wiki/Projects#ORM https://code.google.com/p/go-wiki/wiki/Projects#ORM (there's probably many that aren't on this list)
Many gophers prefer their code to be more obvious and more under their control. Writing a little SQL never hurt anyone, and Go's SQL package is pretty good. Personally, I like http://github.com/jmoiron/sqlx http://github.com/jmoiron/sqlx - you have to write SQL statements still (I consider that a good thing), but it removes the boilerplate of getting data in and out of structs.
- tptacek 13y agoI'm not sure I see the "magic" in trivial compilers.
- pdq 13y agoWell said. My biggest problem with ORMs in the past boils down to them being "leaky abstractions". They work fine for simple create/update/deletes, but get into trouble with foreign keys, indexes, "group by", advanced queries, etc.