C bros we won

c++2023 hello world looks like this
come home, CMan

Mike Stoklasa's Worst Fan Shirt $21.68

CRIME Shirt $21.68

Mike Stoklasa's Worst Fan Shirt $21.68

  1. 3 weeks ago
    Anonymous

    If you use MSVC maybe. Clang and GCC don't support modules yet, and honestly, headers worked fine.

    • 3 weeks ago
      Anonymous

      >headers worked fine
      but handling headers in big projects feels unwieldy, and they're not very fast to compile.

      I wish they had been introduced much earlier for support and libraries to be ready.

    • 3 weeks ago
      Anonymous

      nothing support modules yet, not even msvc, the whole concept behind modules is ruined anyway rendering it with no true benefits over headers

    • 3 weeks ago
      Anonymous

      it's possible to use import std; on macos, but you cannot import your own modules yet

      • 3 weeks ago
        Anonymous

        How did they botch this so hard.. is it the true purpose of the committee?

    • 3 weeks ago
      Anonymous

      headers are the worst feature of C

      • 3 weeks ago
        Anonymous

        Headers are actually pretty great, in every language I have tried, modules suck. As for C++ trying to refrofit modules was as mistake. Instead of modules, headers should have been tweaked to make multiple precompiled headers possible.

        • 3 weeks ago
          Anonymous

          Modules work great in Go, Rust, Hare, C# and Java.

      • 3 weeks ago
        Anonymous

        headers are a preprocessor feature, not a C one

        • 3 weeks ago
          Anonymous

          so practically nothing ever written is technically C code because it requires a preprocessor.

        • 3 weeks ago
          Anonymous

          The C preprocessor is a standard-mandated part of the C language.

    • 3 weeks ago
      Anonymous

      >You have to write function signatures twice in two different files because uh... YOU JUST DO OKAY??

      • 3 weeks ago
        Anonymous

        you don't have to, you can just declare everything in correct order in your src file so the declaration is always above the invocation

  2. 3 weeks ago
    Anonymous

    >a function is added to the standard
    >its just formatted print, but prints additional character
    why

    • 3 weeks ago
      Anonymous

      Because the C++ committee is a bunch of cucks that can't say no to anything. All C++ gets is more bloat.

      • 3 weeks ago
        Anonymous

        /C++

    • 3 weeks ago
      Anonymous

      endl is slow, printf parse argument at runtime

      • 3 weeks ago
        Anonymous

        or you can just include 'n' in the format string

        • 3 weeks ago
          Anonymous

          Why n? some OSes use rn. And herein lies the issue

          • 3 weeks ago
            Anonymous

            n is a newline not a linefeed/carriage return.
            "endl" has never been necessary to get a proper newline. It's just cargo-culting. But then again if someone is telling you iostream is a good idea for doing I/O you're already in cargo cult city. Or you're taking advice from bjarne.

          • 3 weeks ago
            Anonymous

            troons FEAR bjarne

          • 3 weeks ago
            Anonymous

            Look bjarne, iostream is a shit API. Despite C++ being one of the most popular languages nobody has ever looked at iostream and thought "hmm that's a good way to do I/O, I'll steal it for my programming language". Meanwhile printf style I/O is everywhere.

          • 3 weeks ago
            Anonymous

            okay, but people still use C++

          • 3 weeks ago
            Anonymous

            They do and I do as well, I dread touching ioshit (Bjarne's pet library) and prefer using C stdio despite its own setbacks. I'm very glad about the new formatting libraries.

    • 3 weeks ago
      Anonymous

      they need an entire paper just to print a blank line
      https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3142r0.pdf

  3. 3 weeks ago
    Anonymous

    very sexy

  4. 3 weeks ago
    Anonymous

    It should have been like this since the beginning.
    Overloading << to print text is awkward as hell.

    • 3 weeks ago
      Anonymous

      If Bjarne was serious about the craft he would have made a new operator, like, for example, <<--%

      • 3 weeks ago
        Anonymous

        perhaps even 8=D~ (Squidward with boogers operator)

    • 3 weeks ago
      Anonymous

      printf is in C++ Standard since its literal beginning

      • 3 weeks ago
        Anonymous

        printf is unsafe.

        • 3 weeks ago
          Anonymous

          It's not if you pass to it literals like in OP's example

          • 3 weeks ago
            Anonymous

            It doesn't work with custom types

          • 3 weeks ago
            Anonymous

            volatile?

          • 3 weeks ago
            Anonymous

            wrong tread lol

            Why n? some OSes use rn. And herein lies the issue

            true, but 'n' flushes and jumps to new line either way, despite slightly different behavior

          • 3 weeks ago
            Anonymous

            Implying println does lol.

          • 3 weeks ago
            Anonymous

            It does. You can write you own formatter with custom flags and everything.

          • 3 weeks ago
            Anonymous

            At that point can't I just do
            printf("my cool type: %s", myType.toString())

    • 3 weeks ago
      Anonymous

      Agreed. Overloaded operators are cancer, should be member functions.

  5. 3 weeks ago
    Anonymous

    In shaa Allah, there is only one hello world program in C++ and it is as it was written:
    #include <iostream>

    using namespace std;

    int main() {
    cout<<"Hello World!"<<endl;
    return 0;
    }

    • 3 weeks ago
      Anonymous

      How is that any better than
      #include <cstdio>
      int main() { std::puts("Hello, world!"); }

      it should be
      import std;

      auto main() -> int
      {
      std::println("Hello, world");
      }

      Code monkeys are so fricking wear, I swear, too god.
      Why cannot be simply like "Print: Hello world"

      in Nim this is just
      echo "hello world!

      This man gets it.

  6. 3 weeks ago
    Anonymous

    frick off

  7. 3 weeks ago
    Anonymous

    in Nim this is just
    echo "hello world!

    • 3 weeks ago
      Anonymous

      literally never heard of it and who asked?

      • 3 weeks ago
        Anonymous

        >literally never heard
        Lurk moar, Zoomie

  8. 3 weeks ago
    Anonymous

    It's over, even C++ is becoming troony like rust

    • 3 weeks ago
      Anonymous

      Preprocessor and << abuse were always shit.

  9. 3 weeks ago
    Anonymous

    i still prefer printf

  10. 3 weeks ago
    Anonymous

    Why doesnt the int function have to return int too? is it just returning zero by default?

    • 3 weeks ago
      Anonymous

      >is it just returning zero by default?
      Yes.

  11. 3 weeks ago
    Anonymous

    How is that any better than
    #include <cstdio>
    int main() { std::puts("Hello, world!"); }

    • 3 weeks ago
      Anonymous

      At least in msvc's case, imports are faster to compile than #includes.
      IIRC puts flushes immediately, which will be slower than println which is likely buffered.

    • 3 weeks ago
      Anonymous

      formatting, duh

  12. 3 weeks ago
    Anonymous

    >C++ becomes safe and usable when it resembles Java

  13. 3 weeks ago
    Anonymous

    just use rust, unironically

  14. 3 weeks ago
    Anonymous

    it should be
    import std;

    auto main() -> int
    {
    std::println("Hello, world");
    }

    • 3 weeks ago
      Anonymous

      >import std
      you don't need to do this in C++2

  15. 3 weeks ago
    Anonymous

    Please tell me you're a moron without telling me you're a moron.

  16. 3 weeks ago
    Anonymous

    I used to think iostream was the most clever thing when I first started programming. Now I think that Bjarne was just moronic.
    String interpolation is the way to go. Printf style formatting is second.

    • 3 weeks ago
      Anonymous

      >Printf style formatting is second.
      No, there's an overhead in passing and recovering arguments to a variadic function in x64, besides that you need to parse the format string, so that is the Black person way to go.

  17. 3 weeks ago
    Anonymous

    Black personlicious, pls kys.

    Atomic formatting functions is the way to go.
    int
    main(int argc, char* argv[])
    {
    const int32 times = 2005;
    const char* color = "brown";
    TOBuffer* buffer;

    if ((buffer = absbffr_create(4096, flushcallback)) == NULL) {
    return -1;
    }

    cctnln(cctstr(cctstr(buffer, "Hello "), "sir."));
    cctnln(cctstr(ccti32(cctstr(cctstr(cctstr(buffer, "The quick "), color), " fox jumps over the lazy dog "), times), " times."));

    cctstr(cctstr(buffer, "The quick "), color);
    ccti32(cctstr(buffer, " fox jumps over the lazy dog "), times);
    cctnln(cctstr(buffer, " times."));
    absbffr_flush(buffer);

    absbffr_destroy(buffer);
    return 0;
    }

  18. 3 weeks ago
    Anonymous

    >in 2024 c++ is what java was in 2000
    based and redpilled

  19. 3 weeks ago
    Anonymous

    Does C++ have implicit returns?
    Otherwise why is main not returning an int?

    • 3 weeks ago
      Anonymous

      Main is special.

  20. 3 weeks ago
    Anonymous

    Get it from your favorite compiler in 2036

  21. 3 weeks ago
    Anonymous

    > import std

  22. 3 weeks ago
    Anonymous

    Looks like Python.
    Thumbs up.

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