• OpenStars@startrek.website
    link
    fedilink
    English
    arrow-up
    13
    ·
    9 months ago

    This right here - C++ iirc is used mostly for microprocessor code in an industry setting, where EXTENSIVE testing is done so that bloated code doesn’t need to constantly check for programmer errors every single time, i.e. where execution speed is prioritized over programmer development time. And whenever that is not the case, well, as OP pointed out, other higher-level languages also exist (implication: to choose from).

    • Backslash@feddit.de
      link
      fedilink
      arrow-up
      35
      ·
      9 months ago

      C++ iirc is used mostly for microprocessor code

      lol no, it’s used almost everywhere where performance is important and people want(ed) OOP, from tiny projects to web browsers (Chrome, Firefox) to game engines (Unreal, CryEngine). Many of these are hugely complex and do encounter segfaults on a somewhat frequent basis.

      Saying C++ is mostly used for embedded applications is like saying C# is mostly used for scripting games, i.e. it doesn’t nearly cover all the use cases.

      higher-level languages also exist

      This depends on your definition of “higher-level”, but many people would argue that C++ is on a similar level to Java or C# in terms of abstraction. The latter two do, however, have a garbage collector, which vastly simplifies memory management for the programmer(generally anyway).

      • tool@lemmy.world
        link
        fedilink
        English
        arrow-up
        2
        ·
        9 months ago

        Lots of those in C# now, especially with Unity coming along like it did.

    • scrion@lemmy.world
      link
      fedilink
      arrow-up
      6
      ·
      9 months ago

      I also currently use it for a new project since all needed 3rd party libraries are from a very specific domain and the project has a deadline, so writing and testing wrappers for Rust that would provide me with any meaningful advantages down the road are too costly to budget for before the deadline.

      That could become part of a future refactoring, though.