• RoyaltyInTraining@lemmy.world
    link
    fedilink
    arrow-up
    10
    ·
    2 days ago

    Programming in C++ is downright horrifying to me after trying other languages. The way it does generics is fucked up on so many levels…

    • UnderpantsWeevil@lemmy.world
      link
      fedilink
      English
      arrow-up
      9
      ·
      2 days ago

      Feels a bit like being told to do brain surgery and getting handed a hatchet, especially in the modern era.

      Like, its a great learning language precisely because it does force you to think about what’s actually under the hood of your objects and attributes. You actually have to learn what a pointer is. You actually have to think about memory usage and system states. Its like Bio 1 when they have you dissect a rat.

      But without a ton of library support, you’re doing so much heavy lifting. And with a bunch of library support… why not just use C#?

  • FilthyShrooms@lemmy.world
    link
    fedilink
    arrow-up
    25
    ·
    3 days ago

    MatLab user

    I like how it doesn’t say “coder” because everyone knows MatLab isn’t a real programming language

    • Meron35@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      2 days ago

      Scientists too busy writing grant proposals to realise that the developers of RStudio have made Positron, which is VS Code based and generally better

  • saltesc@lemmy.world
    link
    fedilink
    arrow-up
    18
    ·
    edit-2
    3 days ago

    SQL enjoyer?

    Every time I use it I feels like I’m going back to the 90s. No variables, no functions; Oh but you can do a CTE or subquery…👍

    UNION ALL, UNION ALL, UNION ALL… “There’s got to be a better way, surely…”

    looks up better way

    “Oh, what the fuck?!.. Nope, this will just be quicker…” UNION ALL, UNION ALL, UNION ALL…

    Join in a table sharing column names… Everything breaks. You gotta put the new prefixes in front of all the headers you called in now. In every select, in every where, etc… Which is weird because that kinda works like a variable and it’s fine…

    “When you see this little piece of text, it means all this, got it?”

    “Okay. Yep. Easy.”

    “So why can’t you do that with expressions?”

    SQL SCREAMS MANICALLY

    “Okay, okay, okay!.. Jesus…”

    And then you try put a MAX in a where and it won’t let you because you gotta pull all the maxes out in their own query, make a table, join them in, and use them like a filter…

    I hate it. It has speed, when you can finally run the script, but everything up to that is so…ugh.

    • marcos@lemmy.world
      link
      fedilink
      arrow-up
      6
      ·
      3 days ago

      It seems that you need to get better. There are plenty of valid complaints against SQL, but your problems seem to be all due to lack of familiarity.

      No variables, no functions; Oh but you can do a CTE

      Yeah, CTEs are more expressive than variables. And as somebody pointed, every database out there supports functions, you may want to look how they work.

      UNION ALL, UNION ALL, UNION ALL… “There’s got to be a better way, surely…”

      What do you mean by a “better way”? Union all is a perfectly valid operation.

      And then you try put a MAX in a where and it won’t let you because you gotta pull all the maxes out in their own query, make a table, join them in, and use them like a filter…

      Window functions exist.

    • expr@programming.dev
      link
      fedilink
      arrow-up
      6
      ·
      3 days ago

      No variables, no functions

      Every major SQL implementation includes both of those things. Of course, it’s rarely needed or desirable if you know how to properly write SQL.

      “So why can’t you do that with expressions?”

      You can alias expressions.

      And then you try put a MAX in a where and it won’t let you because you gotta pull all the maxes out in their own query, make a table, join them in, and use them like a filter…

      Wtf are you talking about? For one, filtering by the output of an aggregate is what the HAVING clause is for. But even if that didn’t exist, you could just use a subquery instead. You don’t need to make table…

      Tbh it just sounds like you don’t know SQL very well. Which is fine, but doesn’t make for a very compelling criticism. SQL does have warts (even though it’s great overall), but none of what you described are real problems.

    • Valmond@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      3 days ago

      LEFT JOIN

      Includes empty entries, doubles others.

      It sure is long due for an overhaul.

          • expr@programming.dev
            link
            fedilink
            arrow-up
            3
            ·
            3 days ago

            It doesn’t arbitrarily double rows or something. For each row in the relation on the left of the join, it will produce 1 or more rows depending on how many rows in the relation on the right of the join match the join condition. The output relation of the join may have duplicate rows depending on the contents of each joined relation as well as what columns you are projecting from each.

            If you want to remove duplicates, that’s what DISTINCT is for.

            • Valmond@lemmy.world
              link
              fedilink
              arrow-up
              1
              ·
              edit-2
              3 days ago

              Thanks, I will kot forget that the next time I have to do SQL!

              Still wild there are no simpler language that have grown in popilarity for databases though.

              • expr@programming.dev
                link
                fedilink
                arrow-up
                3
                ·
                3 days ago

                To be honest, it’s remarkably simple for what it’s doing. There’s a ton of details that are abstracted away. Databases are massively complex things, yet we can write simple queries to interact with them, with semantics that are well-understood and documented. I think, like anything else, it requires a bit of effort to learn (not a lot, though). Once you do, it’s pretty easy to use. I’ve seen many non-technical people learn enough to write one-off queries for their own purposes, which I think is a testament to its simplicity.

                • Valmond@lemmy.world
                  link
                  fedilink
                  arrow-up
                  1
                  ·
                  3 days ago

                  Oneliners are simple I give that to you, but then you have those incomplete tables and whatnot. Like take all entries from A and join B on A.id and B.id, set the result to some default if B doesn’t exist.

                  You are surely going to whip up a perfect string of SQL but I’d struggle.