I'm learning C++. How was you C++ (hellish) journey?

I'm learning C++. How was you C++ (hellish) journey?

  1. 2 weeks ago
    Anonymous

    I've read C++ Primer Plus when I was in uni some 10 years ago. No idea how it holds up today.

  2. 2 weeks ago
    Anonymous

    >C++
    >2k23
    Give it a rest already holy shit. Learn plain C if needs be but not this meme abomination.

    .t former C++ mainer of 5 years

    • 2 weeks ago
      Anonymous

      Then, what langage more complex than Python should I learn?

      • 2 weeks ago
        Anonymous

        The one with the best job prospects in your area of course. 'Learning' a lang for the sake of it gets you nothing.

  3. 2 weeks ago
    Anonymous

    Learned it on the job.

    Shit’s easier to learn when you have an [good] existing code base to crib off of and actual tasks to do.

  4. 2 weeks ago
    Anonymous

    Easy until I got to auto const std::vector, shared ptr, unique ptr and other garbage they added for more bloat.

    • 2 weeks ago
      Anonymous

      absolutely filtered

  5. 2 weeks ago
    Anonymous

    Learn C, use C++ for objects

  6. 2 weeks ago
    Anonymous

    Can someone explain how this template syntax and use of decltype works? More specifically what t="" does.
    template <typename t="">
    void createVkBuffer(
    T& vkData,
    VkBuffer& buffer,
    VkDeviceMemory& bufferMemory,
    VkBufferUsageFlags usage)

    createVkBuffer<decltype(vkvertices)>(
    vkVertices,
    vkVertexBuffer,
    vkVertexBufferMemory,
    VK_BUFFER_USAGE_VERTEX_BUFFER_BIT
    );
    createVkBuffer<decltype(vkindices)>(
    vkIndices,
    vkIndexBuffer,
    vkIndexBufferMemory,
    VK_BUFFER_USAGE_INDEX_BUFFER_BIT
    );

    • 2 weeks ago
      Anonymous

      Dude, if you wanna learn vulkan I strongly recommend you just use the raw C api and not some C++ wrapper. Eventually you, Go back to the C++ wrapper, but only AFTER you're comfortable with the vulkan API.

      • 2 weeks ago
        Anonymous

        I want to know the template typename syntax which doesn't show up anywhere on cppreference with empty quotes.

    • 2 weeks ago
      Anonymous

      >decltype
      Returns the type of the entity that you pass to it, you'll know when you'll need it when you'll find out it's either impossible to find out or too tedious to write the type of something.
      >what t="" does
      Produces a compilation error, probably meant "template<typename t>". String literal template arguments are done in a different way, and are only possible since C++20.

      • 2 weeks ago
        Anonymous

        ><typename t="">
        Could be the ="" means any string literal will be converted to a type?

        • 2 weeks ago
          Anonymous

          It literally doesn't mean anything, have you tried compiling that code?
          template <typename T=""> void x();
          x.cpp:1:22: error: expected a type
          template <typename T=""> void x();
          ^
          x.cpp:1:22: error: expected ',' or '>' in template-parameter-list

          String literals can't be directly passed as template arguments in general, although it is possible with a workaround.

    • 2 weeks ago
      Anonymous

      That's not valid code.

  7. 2 weeks ago
    Anonymous

    First of all: language doesn't fucking matter. All that matters is what you can create, not what languages you can learn.

    But yeah, there are better alternatives for C++ these days. Be warned that with C++ (or C) you'll be fucking around with build tools,scripts, and compiler flags way more than actually developing your app/library.

    Learn golang,zig or rust. They all have modules AFAIK and have sane solutions for building your code.

    • 2 weeks ago
      Anonymous

      >But yeah, there are better alternatives for C++ these days.
      No there aren't. C and C++ are the peak of all programming languages.

      https://i.imgur.com/ZBQ9re8.jpg

      I'm learning C++. How was you C++ (hellish) journey?

      Personally I had fun. Stop thinking of it as a chore and start having fun with it. Its actually a great language and you can do a lot of things with it.

  8. 2 weeks ago
    Anonymous
  9. 2 weeks ago
    Anonymous

    Not English native speaker, so C++ was hell specially without mentors, language evolving every 4 year is a problem too.

    • 2 weeks ago
      Anonymous

      Not really, do what you know, don’t do what you don’t.

      • 2 weeks ago
        Anonymous

        >t. filtered by C++14.
        Yeah but you need to understand what has changed internally to understand new declarations.

        • 2 weeks ago
          Anonymous

          You don’t. You don’t have to use a new code version just because it exists.

          > t. Maintains code locked in various decades

    • 2 weeks ago
      Anonymous

      >language evolving every 4 year is a problem too.
      Not a cpp programmer but can't you download a linter or code analyser that'll ping you for not using the preferred choice for whichever version of CPP being used?

  10. 2 weeks ago
    Anonymous

    It's alright, I'm 10 years in. Forget about raw pointers, use const& everywhere, don't try to invent your own containers and it'll be fine.

  11. 2 weeks ago
    Anonymous

    If you're already familiar with C and Python, it shouldn't be too bad.

  12. 2 weeks ago
    Anonymous

    I started learning C++ many years ago and I didn't really know what to do, so I pulled up an Indian fellow on YouTube and copied his code letter by letter.
    Then I started making my own crappy programs.
    Then I made slightly more complicated stuff like a chess movegen.
    Then some shit happened.
    Then I started doing max difficulty programming challenges, from which I learnt the art of extreme optimization, among other things.
    And only within the last year I've felt that I mastered the language.
    It was pretty much my first language if you don't count minor dabbling with JS/Python back in the day.

  13. 2 weeks ago
    Anonymous

    C++ is easy what's difficult is building, linking and managing libraries. It's not like other languages where you don't need to think about it.

  14. 2 weeks ago
    Anonymous

    C++ isn't really that hard, it's just a glorified C. It's harder to know what to do with it, there are a lot of little features that can twist your designs into a strange spaghetti of constructs because it allows you to bypass your own flaws like creating an ill thought out object interfaces and compositions. For example at work some colleagues may come up with some interesting classes but end up dynamic_cast-ing everywhere (this is not because of lack of virtual functions but wrong composition), making it more difficult to bend the code to your will later, and eventually refactoring keeps occuring due to this.

  15. 2 weeks ago
    Anonymous

    >How was you C++ (hellish) journey?
    It was fine honestly, started at the age of 14 by just copy pasting others' code and it worked out just fine because I knew exactly what I wanted to get out at the end.

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