What? is that a string. Aw hell no, I cannot comprehend it and I'm losing my mind.

What? is that a string.
Aw hell no, I cannot comprehend it and I'm losing my mind.

Mike Stoklasa's Worst Fan Shirt $21.68

Yakub: World's Greatest Dad Shirt $21.68

Mike Stoklasa's Worst Fan Shirt $21.68

  1. 1 month ago
    Anonymous

    C is not a good fit for string processing. Which is why C compilers are now written in C++.

    • 1 month ago
      Anonymous

      Why are you still spamming your bait OP?
      People have been telling you about struct { char *p; size_t len }; since you started.

      • 1 month ago
        Anonymous

        He was also told that his baby language runtime was written in C, and then given examples of high level language runtimes/string processing libraries written in C. Why? Because C is the best there is for fast string processing unless you're going to write assembler. His immutable/opaque strings are ideal for stopping pajeets from crashing.

        • 1 month ago
          Anime is for trannies

          And what's OP's baby language?

          • 1 month ago
            Anonymous

            i got 10 bucks on javascript

          • 1 month ago
            Anonymous

            JS runtime is written in C++ THOUGH

        • 1 month ago
          Anonymous

          That sounds horrible. Which languages created in this century use a runtime written in C?

        • 1 month ago
          Anonymous

          Rust doesn't have this problem
          Counted, transparent, mutable when needed, sliceable, safe

      • 1 month ago
        Anonymous

        Yeah, and now you have to write all the string functions you need from scratch because the standard library is built around null-terminated strings.

        • 1 month ago
          Anonymous

          No matter what shitty language you're using, you're either going to have to deal with interop-ing with C libraries or, inevitably, having to do a syscall like open, which expects a null-terminated string.

          It's just easier to keep the length AND a terminating null byte at the end of the day.

          • 1 month ago
            Anonymous

            >you're either going to have to deal with interop-ing with C libraries or, inevitably, having to do a syscall like open, which expects a null-terminated string.
            >It's just easier to keep the length AND a terminating null byte at the end of the day.
            You don't have to use C for your operating system and strings in real languages can contain nulls so there's no point in a "terminating" null byte.

          • 1 month ago
            Anonymous

            if your OS is not POSIX compatible I won't program for it.
            It really is that simple.

          • 1 month ago
            Anonymous

            If your OS is not POSIX compatible nobody is using it anyway.

    • 1 month ago
      Anonymous

      C compilers are written in C++ for two reasons:
      >We built a C++ compiler in C, that's cool. Why not use it?
      >C++ meta-programming / template mess is actually useful for compilers

      • 1 month ago
        Anonymous

        Meta is not a mess if your IQ is above pajeet level

        • 1 month ago
          Anonymous

          It's a mess and it has nothing to do with IQ and everything to do with the resulting spaghetti mess of code. It does work though.

          • 1 month ago
            Anonymous

            Metaprogramming is pretty good nowadays, it used to be a mess when we had to use the type system to wrangle values at compile time.
            With consteval/constexpr for value processing and templates/concepts for type processing, metaprogramming is actually in a pretty good state right now.

          • 1 month ago
            Anonymous

            It still sucks. They add all these overcomplex features that are barely useful instead of adding simple and powerful features. Like it is still not possible to pass an identifier to a template, ideally it should be possible to pass full expressions to templates. Also we should have gotten static_if, it would have been far more useful than most of the crap they added.

          • 1 month ago
            Anonymous

            >static_if
            Literally if constexpr
            >Pass an identifier to a template
            No idea what that means

            I also have a lot of gripes with it, like why isn't every variable in a consteval context implicitly constexpr, it's just better than it was, but it can be a lot better than it is too.

          • 1 month ago
            Anonymous

            if constexpr is almost completly worthless, its barely more capable than a normal if statement. static_if on the other hand is powerful, it can be used to conditionally define anything.

            Pass an identifier
            Passsing a variable name to a template, or ideally passing an entire chunk of code. Basically, this would give templates the power of macros, whilst being fully type safe and properly scoped.

          • 1 month ago
            Anonymous

            >if constexpr is almost completely worthless
            I'm now going to disregard this entire conversation, goodbye.

          • 1 month ago
            Anonymous

            if constexpr requires all code paths to be fully valid. Also, can't use it to conditionally declare stuff.

      • 1 month ago
        Anonymous

        C++ is like hard drugs, its great at first in moderation, but its almost impossible to keep it in moderation. C++ is a mistake, and its going to ruin GCC eventually. You only need to look at the incomprehensible mess that is clang/llvm to see what I mean.

        • 1 month ago
          Anonymous

          LLVM constantly gets contributions from new people. Wouldn't be happening if it was a mess.

          • 1 month ago
            Anonymous

            Just because people can suffer through, does not mean its not an incomprehensible mess. I have found that GCC is far easier to understand and quickly make changes, clang/llvms overuse of objects with getters and setters and small helper objects that don't do anything makes it difficult to actually find the code which does the real work.

          • 1 month ago
            Anonymous

            >I have found that GCC is far easier to understand and quickly make changes,
            And yet that's not what's happening.
            >oh no, getters and setters
            Filtered hard by baby's first OOP.
            Maybe learn to use a LSP?

          • 1 month ago
            Anonymous

            >Just because people can suffer through, does not mean its not an incomprehensible mess.
            Yes it does. New people wouldn't comprehend it if it was incomprehensible. Capice?

      • 1 month ago
        Anonymous

        C++ templates are extremely useful in general, and their absence is one of the main reasons I don't use C.

    • 1 month ago
      Anonymous

      String processing is only a tiny fraction of what a compiler does. Also, at least in the case of GCC, its not using std::string or any kind of string class. Its just using naked char* pointers.

  2. 1 month ago
    Anonymous

    Why would you use C outside of systems programming? Are you fricking insane or do you have too much free time on your hands?

  3. 1 month ago
    Anonymous

    If it's not C++, it doesn't have ++

  4. 1 month ago
    Anonymous

    >can't write her own string type

    • 1 month ago
      Anonymous

      >chink parasitic prostitute gets what she deserves
      Based horse

    • 1 month ago
      Anonymous

      >wrote your own string type
      >you have to memcpy it anyway because everything expects null terminated strings

      • 1 month ago
        Anonymous

        >writes idiomatic C
        im curious now, do you use putc to output your chars too then?

  5. 1 month ago
    Anonymous

    char *x is better than std::string, faster

    • 1 month ago
      Anonymous

      std::string is one of the worst string classes every created, certainly on this planet, but maybe even throughout the multiverse.

      • 1 month ago
        Anonymous
      • 1 month ago
        Anonymous

        nah its fine
        char arrays are just better if you need those 17 nanoseconds of performance

  6. 1 month ago
    Anonymous

    jokes on you, there are more string libraries in C than in any other language.

    • 1 month ago
      Anonymous

      And none of them are good

  7. 1 month ago
    Anonymous

    Works fine on a microcontroller 😉

    • 1 month ago
      Anonymous

      >microcontroller
      >C
      Blasphemy. For microcontrollers it's either Assembly or nothing 😀

  8. 1 month ago
    Anonymous

    >your brain on oop
    its pretty straightforward tho
    you got memory fields (your data) and their respective addresses (pointers)
    ignore the whole type thing. its a convention to allow the compiler to check for your inattention mistakes

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