• onlinepersona@programming.dev
    link
    fedilink
    English
    arrow-up
    19
    arrow-down
    19
    ·
    2 months ago

    C++ continues to be the dumping ground of paradigms and language features. This proposal just aims to add even more to an overloaded language.

    C++ programmers mocked languages for being dynamically typed then they introduced auto, they mocked JS for callback hell and introduced lambdas, they mocked Rust devs for being lowskill C++ devs who can’t manage their own memory and now they are admitting they can’t manage it themselves either.

    It’s going to be come like the x86 instruction set or windows that is backwards compatible with stuff from 30years ago just accumulating cruft, unable to let go.

    Anti Commercial-AI license

    • GetOffMyLan@programming.dev
      link
      fedilink
      arrow-up
      30
      ·
      edit-2
      2 months ago

      auto isn’t dynamic typing it’s just type inference. It still has a fixed type you just don’t have to write it. Like var in C#.

      Lambdas are just a way of defining methods in place. It has nothing to do with callbacks.

      But you’re spot on for memory safety. Managing it yourself is risky and if it can be managed at zero cost it seems stupid not to.

      • onlinepersona@programming.dev
        link
        fedilink
        English
        arrow-up
        2
        arrow-down
        8
        ·
        edit-2
        2 months ago

        auto isn’t dynamic typing it’s just type inference.

        I’m aware, but one of the big arguments I’ve heard about dynamic typing is “I don’t know which type it has when I read the code”. Well, auto looks just like var in that regard.

        Lambdas are just a way of defining methods in place. It has nothing to do with callbacks.

        Callback definition from wikipedia:

        In computer programming, a callback is a function that is stored as data (a reference) and designed to be called by another function – often back to the original abstraction layer.

        This is exactly what lambdas are often used for in C++.

        Anti Commercial-AI license

        • lysdexic@programming.dev
          link
          fedilink
          English
          arrow-up
          8
          ·
          edit-2
          2 months ago

          Well, auto looks just like var in that regard.

          It really isn’t. Neither in C# nor in Java. They are just syntactic sugar to avoid redundant type specifications. I mean things like Foo foo = new Foo();. Who gets confused with that?

          Why do you think IDEs are able to tell which type a variable is?

          Even C# takes a step further and allows developer to omit the constructor with their target-typed new expressions. No one is whining about dynamic types just because the language let’s you instantiate an object with Foo foo = new();.

        • GetOffMyLan@programming.dev
          link
          fedilink
          arrow-up
          4
          arrow-down
          1
          ·
          2 months ago

          The problem with dynamic typing is you can’t always figure out what the type is even with investigation as it can be lots of things based on what is passed or returned. It also allows incorrect values to be passed.

          People will indeed make that readability argument but if the type is not obvious and important to understanding the code then it likely shouldn’t be used there.

            • GetOffMyLan@programming.dev
              link
              fedilink
              arrow-up
              4
              arrow-down
              1
              ·
              2 months ago

              I wouldn’t call bad readability a loaded gun really. Your dev tools will hopefully make it pretty easy to learn the type. It should be a minor inconvenience at best.

              • lysdexic@programming.dev
                link
                fedilink
                English
                arrow-up
                4
                ·
                2 months ago

                I wouldn’t call bad readability a loaded gun really.

                Bad readability is a problem cause by the developer, not the language. Anyone can crank out unreadable symbol soup in any language, if that’s what they want/can deliver.

                Blaming the programming language for the programmer’s incompetence is very telling, so telling there’s even a saying: A bad workman always blames his tools.

    • lysdexic@programming.dev
      link
      fedilink
      English
      arrow-up
      12
      arrow-down
      2
      ·
      2 months ago

      C++ continues to be the dumping ground of paradigms and language features. This proposal just aims to add even more to an overloaded language.

      I think you could not be more wrong even if you tried, and you clearly did not even read the proposal you’re commenting on.

      This proposal aims to basically create an entirely different programming language aimed at being easy to integrate in extsting codebases. The language just so happens to share some syntax with C++, but you definitely can’t compile it with a C++ compiler because it introduces a series of backwards incompatible changes.

      It’s also absurd how you complain about introducing new features. Can you point out any language that is not absolutely dead that is not introducing new features with each release?

      C++ programmers mocked languages for being dynamically typed then they introduced auto (…)

      I’m sorry, you are clearly confused. The auto keyword is not “dynamically typed”. It is called “auto” because it does automatic type deduction. It is syntactic sugar to avoid having to explicitly specify the type name in places the compiler knows it already. Do you understand what this means?

      Your comment sounds like trolling, frankly.