Re:New In Postgres 12: Generated Columns
by AmericanChopper on Wednesday October 02, 2019 @06:42AM
(#21134985)
I would agree. SQL is absolutely beautiful in its simplicity imo. I learned SQL along side my first imperative programming language, so I guess I’m significantly biased, but I think it’s the easiest language I’ve ever learned. The best part is, if you spend enough time writing SQL, you end up learning quite a bit about how databases, data structures, and the time complexity of query execution all works. Which is all incredibly valuable for just about any programmer.
I also love ORMs. But perhaps my knowledge of SQL has enhanced my ability to use them well. Without them you end up with numerous other problems which I’d consider worse than the occasional compromises ORMs require. Ideally you want all your business logic in one place, or at least in discrete units, so the fragmentation of stored procedures is a major downside. Embedding SQL directly into other business logic is like and uglier version of an FFI, and serializing SQL statements is even more of a security concern than marshalling FFIs (something that can already be a bit of a footgun).
I’d recommend any engineer to learn SQL, but for people who use ORMs a lot already, I’d suggest to start with understanding explain plans first.
Re:New In Postgres 12: Generated Columns
by Kihashi on Wednesday October 02, 2019 @10:32AM
(#21136852)
IME knowing SQL is a prerequisite to using an ORM efficiently.
Re:New In Postgres 12: Generated Columns
by Someone on Wednesday October 02, 2019 @06:10PM
(#21141302)
IMO, a disadvantage of SQL is that it was designed for batch processing, not for modern editors. If you type
select foo, bar from baz
auto-complete cannot help you type the field names because it doesn’t know what table(s) you’ll be querying. On the other hand, LinQ’s from baz select foo, bar
allows your editor to auto-complete the field names for you.
We have so many ORMs and most often they look more ugly than pure SQL to me, especially when it comes to more complex queries.
You could write a translator (something like coffeescript -> JS but X -> SQL), but can you really come up with a syntax that's enough of an improvement that it would be worth using it?