9

Gah! (Totally guilty of it too but...)

That feeling when you ask a question like "how do I make SQL less intolerable for my team?" And you get answer like "just don't use SQL lol. Use this other thing!"

I appreciate suggestions, but why would I possibly use SQL if I had the choice to use literally anything else. I play by other people's rules and on their deadlines.

Comments
  • 1
    Well SQL is the most versatile database. Others excel in specific situations but often you find you need to use multiple different databases for different parts of information or resort to very cumbersome solutions.
  • 3
    @Voxera I agree. It's so very painful to write complex queries, but I'll be damned if it isn't amazing at what it does, and fast as hell.
  • 3
    Name a better database language than SQL. Go ahead, I'll wait.
  • 1
    Be thankful you can use SQL. Our main solution runs on isam files powered by Cobol dlls.
  • 0
    @orseji ISAM files? How about I go hug and kiss some poisonous snakes instead.
  • 1
    The two main problems with SQL are that it is the only really wide spread 4th generation language, meaning it is hard to learn it from doing non-SQL because there is no other language like it, and it doesn't play well with the rest of the lower generation languages. Also often ppl will try to translate the relational model of their data into an object oriented one, and that just does not work very well.
  • 0
    @orseji idk. I don't maintain the cobol dlls. I think it's dynamic record size and multiple keys over different fields.
  • 0
    @Npstr well. Microsoft has moved the same syntax into C# with Linq.

    First time I saw it I thought why?

    Today I use it so much that you often cannot find a function without at least some linq in it.

    Ex:

    var activeIssueIds =
    from i in issues
    where !i.Disabled
    select i.Id;

    Its a very simple example but issues in this case could be an Orm table, a list or any number of item implementing the right interfaces.

    Its extremely powerful and expressive :)

    There is a fluent form to for this kind of simple queries.
  • 0
    @Voxera I've heard only good things about LINQ.

    Personally, since I hail from the Java world, I'm giving jOOQ a try currently and so far it's awesome.
    It generates code from the database schema which is then used to build the queries. No more sql strings. This gives you great peace of mind when migrating the database schema as you will get (most of the time) compile time errors if you made a change that breaks a query.
  • 0
    @Npstr that sounds a lot like it.

    The real beauty with linq thou is that its not only database but any enumerable that can he queried the same way:)

    And as a bonus, you can turn the query into an expression tree that you can use to dissect the query, for example to serialize it or make changes.

    It tends to pop in everywhere. :)
Add Comment