3 ms·
SQL is wildly powerful and important, but it's also got clear deficiencies for data traversal and manipulation. I see it on a spectrum between declerative and
by bonesss 8y ago
SQL is wildly powerful and important, but it's also got clear deficiencies for data traversal and manipulation.
I see it on a spectrum between declerative and imperative data structures, and where I think most people go wrong with it is trying to create a monolithic solution to a broad spectrum of problems. I think you need a graduated approach where each data layer is simplifying and satisfying the next, so you're using Tables, Procs, Views, and in-memory constructs in concert. The database is a powerful tool, and SQL is just part of that bigger puzzle :)
- richpimp 8y agoI can't agree more with this. As with anything we use in our applications, understanding and leveraging the strengths of our different tools is vitally important. If, for example, I needed a cartesian product of two datasets, SQL is the first thing that comes to mind due to how simple it is to write and the speed with which it will be processed in the database. On the flip side, I would never want to intermix frontend code in SQL, which crazy as that sounds, I have seen before. Everything has its place in a logical development flow.
- Ma8ee 8y agoI’ve seen queries returning html and JavaScript
- richpimp 8y agoIt completely blows my mind when I see stuff like this. We're not all perfect programmers, I'm sure, but still. An alarm should go off in your head when the thought occurs to put front-end code into a query. The only exception I've encountered is if I want to inject some HTML formatting into a string for emails sent from SQL Server, but even then it's extremely limited in use, and I still think to myself, there must be a better way..
- Ma8ee 8y agoThe worst thing is that the guilty programmer probably felt very clever when he wrote the code.