Does C++ even have a naming convention? Am I just stupid? Should I just follow whatever naming convention std uses?

Does C++ even have a naming convention? Am I just stupid? Should I just follow whatever naming convention std uses?

Mike Stoklasa's Worst Fan Shirt $21.68

DMT Has Friends For Me Shirt $21.68

Mike Stoklasa's Worst Fan Shirt $21.68

  1. 1 month ago
    sage

    troony thread (trannies making threads LARPing as /C/hads to incite controversy and drama).
    Reminder that trannies need the drama and attention, otherwise their language goes unnoticed and forgotten into oblivionfrick.
    Don't argue with the troony.
    Don't reply to the troony thread.
    I won't respond to any reply. Have a good day.
    Out.

    • 1 month ago
      Anonymous

      This is a genuine question

      • 1 month ago
        sage

        /sqt/ or /dpt/

    • 1 month ago
      Anonymous

      No. Like C, people make up their own naming conventions for their projects.

      >Should I just follow whatever naming convention std uses?
      That's always a good bet.

      [...]

  2. 1 month ago
    Anonymous

    It doesn’t, it’s typically dependent on the project. A good baseline is to use Googles coding standards and tweak from there.

  3. 1 month ago
    Anonymous

    Why do you brainlet sk brainlet questions?

  4. 1 month ago
    Anonymous

    There are also formatting conventions you could look into, like the ones included with clang-format.
    This is one of the things I appreciate about Rust. My autistic brain doesn't have to worry about bumping into multiple styles when I include a library or two.

  5. 1 month ago
    Anonymous

    How old are you.
    It's your project, use your own naming convemtuons

    STLs naming conventions are the dumbest things I've seen since Rust's syntax.

  6. 1 month ago
    Anonymous

    >Use snake_case
    >Compiles
    >Use pascalCase
    >Compiles
    >Use CapitalCass
    >Compiles

    I guess not.

  7. 1 month ago
    Anonymous

    >I need a parental figure to tell me what to do
    OP, I...

    • 1 month ago
      Anonymous

      This is called standardization. You know, the thing that happens in white countries

      • 1 month ago
        Anonymous

        in white countries we don't have standards unless you mean those 37 competing ones with 38th on the way that will definitely unify them all, only brownoids have standards, they all are uniformly moronic and worthless, for example romanians follow standard of being beggsrs and thieves attracted by copper, a very big problem in my white country that's diverse and has people who do multiple non-standard jobs

      • 1 month ago
        Anonymous

        Rust doesn't have a specification, let alone a standard, and it doesn't stop it from being used. So it turns out you don't always need standards.

  8. 1 month ago
    Anonymous

    Just pick something and stick with it, C++ doesn't particularly care.

    Ideally don't be a total moron and pick something normal like LLVM or Google's style as a base, avoid changing things unless you're truly seething about a rule. Bonus points that most formatters will support auto-linting if you use something normal.

    • 1 month ago
      Anonymous

      last time I used a formatter it fricked everything up and there wasn't even an option for things I wanted to do so I had to reformat everything by hand, midwit tool for soulless wagies, I format everything by hand and it's still more consistent

      • 1 month ago
        Anonymous

        try again with clang-format

  9. 1 month ago
    Anonymous

    >Does C++ even have a naming convention?
    No. Bjarne (PBUH) recommends snake_case, but you can use something else if you want.

  10. 1 month ago
    Anonymous

    It's on per-project basis. Don't copy STL, especially the __part. For your personal projects consider
    https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#S-naming
    https://google.github.io/styleguide/cppguide.html#Naming

  11. 1 month ago
    Anonymous

    I like Qt's
    ClassName objectName;
    objectName.methodName()

  12. 1 month ago
    Anonymous

    test

  13. 1 month ago
    Anonymous

    test

  14. 1 month ago
    Anonymous

    Whatever you choose, keep it consistent within a project or file(whichever works best for you).
    Keep the names descriptive and the formatting consistent.
    If you cant make a descriptive name, write a comment near the function prototype or function/variable declaration with a description of what it does/what it is.
    Stick to using a single type of case (e.g., camelcase).

    The end goal of naming your variables should be that you can go back to, or share, your code and understand what each named thing, be it an object/var/func, is without having to read the entire implementation.
    Don't get hung up on the names though, if it impedes your ability to just get shit done just keep writing code and come back to that later.

  15. 1 month ago
    Anonymous

    snake_case for everything, including types. I.e. std::unique_ptr.

    Yes it is awful and almost nobody uses it. Use snake_case for functions and variables and PascalCase for types if you are white or camelCase for functions and variables if you believe in magic cow dung.

    • 1 month ago
      Anonymous

      I am the ultimate contrarian, this is my C++ style
      class MyClass {
      public:
      void myFunction(uint32_t my_varriable)
      {
      if (...) {
      }
      else {
      }
      }

      private:
      uint32_t m_some_number { 0 };
      };

      • 1 month ago
        Anonymous

        actually, Ive recently been starting to switch to the new function style, so its more like
        class MyClass {
        public:
        auto myFunction(uint32_t my_varriable) -> void
        {
        if (...) {
        }
        else {
        }
        }

        private:
        uint32_t m_some_number { 0 };
        };

Your email address will not be published. Required fields are marked *