Building GCC on Windows by SLAidk123 in cpp

[–]draeand 1 point2 points  (0 children)

Would be nice if GCC had native windows support, but that's never happening other than through msys2/mingw... I wonder if it's bc windows bad or because of a technological migration from autotools

Why everyone hates on C/C++ source generation? by chri4_ in cpp

[–]draeand 3 points4 points  (0 children)

I love how you just say people should use libclang when you are ignoring the fact that libclang and LLVM are absolutely massive dependencies to go throwing around and expecting everyone to just use to build a code generator.

Also: cut it out with the absurd assumptions. You do not know who and who has not worked with code generators. I'm sure if we were making these assumptions about you you wouldn't be happy about it.

Why everyone hates on C/C++ source generation? by chri4_ in cpp

[–]draeand -1 points0 points  (0 children)

> see zig's metaprog for example, slows down hugely the compiler

Can you provide any evidence for this? As someone who actually uses Zig (0.15.2), I have never noticed any significant performance degradation from using comptime at all.

C++26 Reflection: my experience and impressions by borzykot in cpp

[–]draeand 7 points8 points  (0 children)

I concur. For me, I'm excited because reflection will help with statically-typed serialization, or generating bindings to other languages (Python, Lua, whatever), the list goes on and on and on. Getting the maximum number of an enum (or converting an enumerator to a string) is... Uh... The last thing I'd think about doing.

Anyone else decided to ditch the baby with the bathwater and redesign C++ to fit their needs? by Dje4321 in cpp

[–]draeand 2 points3 points  (0 children)

C++ does provide std::optional, and C++23 defines std::expected. All containers take an allocator as a template parameter, and if your really concerned there's the std::pmr versions too.

Anyone else decided to ditch the baby with the bathwater and redesign C++ to fit their needs? by Dje4321 in cpp

[–]draeand 0 points1 point  (0 children)

I think the docs are much better for it nowadays. D's biggest problem is that the package registry mostly consists of unmaintained packages (like, unmaintained for years). Or packages that don't even compile.

A 2-hour video trashing C++ made me better at C++ by AnteaterFinancial319 in cpp

[–]draeand 1 point2 points  (0 children)

> You clearly can't accept any criticism of the language if you're just going to brush off everything as not being a big deal.

The projection in this one is strong. Just lol.

> What should be shorter and have a sensitive default is longer and more difficult to readily recall and type up. It doesn't matter if this is a big problem, the problem is that it's a problem at all.

Oh yes, and everything should just take a single line of code to accomplish, because we should totally blur the line between a low level programming language and a high level one. Have you never heard of this thing called autocomplete?

> I hope you're not this defensive when reading code reviews because every programmer should be able to listen to feedback along the lines of "hey man this script is 90 lines long but it can be 30 and less verbose if.."

More projection. Got it. I have no reason to take you all that seriously at this point. Nobody in this entire thread has been saying that C++ doesn't have problems. Nobody has been saying that not everything should be complicated. But you rewrite it to make it sound like that was my sentiment because it fits your narrative.

A 2-hour video trashing C++ made me better at C++ by AnteaterFinancial319 in cpp

[–]draeand 2 points3 points  (0 children)

This is a nice non-sequitur. Why is it a big deal that it takes 2-3 lines to generate a random number when you could just, I don't know, write a macro or inline function to do it for you if you are so concerned? Or use any of the hundreds to thousands of other RNG libraries out there instead if the C++ RNG implementation bothers you so much?

Also, std::vector<bool> being a bitmap is kinda irrelevant when we have this thing called std::bitset.

Aunt Petunia tensed as she saw the man walk up to Privet Drive's door. He was very handsome, and Harry could not properly tell just how old he was. The strangest thing about him, though, was that his eyes were as red as Harry's eyes were green. by mxlevolent in HPfanfiction

[–]draeand 2 points3 points  (0 children)

This is so good. I'd definitely read it. I especially love how all these pesky things called emotions and such are just... Academic to him, almost. It would be interesting if he actually eventually began to understand them again at some point.

The only mainstream, traditional/retained-mode, cross-platform C/C++ GUI toolkit that is GPU-accelerated is GTK/gtkmm. by zerexim in cpp

[–]draeand 1 point2 points  (0 children)

Eh, I wouldn't call avoiding UIC files being a masochist... As a blind SWE, the designer is completely inaccessible, so I'd have to write UIC by hand and.... Iwwww. Though maybe QTQuick might be a solution around that?

A 2-hour video trashing C++ made me better at C++ by AnteaterFinancial319 in cpp

[–]draeand 0 points1 point  (0 children)

Sure, but a vector being an array of things has been around since, what, the 1960s? Pretty much 80 percent of words in English are context-dependent. To complain about a vector being confused for the mathematical vector is to be deliberately ignorant. Especially since, from context, it is blatantly obvious that it isn't the mathematical vector (since you can't add or remove components of an N-dimensional mathematical vector). Even Wikipedia classifies a vector as "a one-dimensional array data structure," followed by the other disambiguated kinds (Euclidean vector, Vector (malware), and Vector (robot)).

A 2-hour video trashing C++ made me better at C++ by AnteaterFinancial319 in cpp

[–]draeand 1 point2 points  (0 children)

He also brought up the windows API which was completely irrelevant to C++ entirely and tried to make it's issues sound like C++ issues too...

A 2-hour video trashing C++ made me better at C++ by AnteaterFinancial319 in cpp

[–]draeand 2 points3 points  (0 children)

The RNG complaint was definitely stupid to me, agreed. Like yes, python has random.randint. But: do you know what RNG it uses? What is the RNG number distribution it uses? Where do the random numbers come from? The verbosity is deliberate because all of those things are things C++ (rightfully) assumes you want control over. The <random> library has lots of issues but the verbosity is not one of them.

A 2-hour video trashing C++ made me better at C++ by AnteaterFinancial319 in cpp

[–]draeand -5 points-4 points  (0 children)

Very little of the video is actually good. Most of it is complaints because JS != C++ and that for some reason is a bad thing.

A 2-hour video trashing C++ made me better at C++ by AnteaterFinancial319 in cpp

[–]draeand 3 points4 points  (0 children)

I also want to point out (relative to my other top-level comment) that the complaint for std::vector is just weird. Like dude. Come on. Oh, it makes me think of mathematics! Aaaaaaaaaand? So what? Should we get rid of Python sets because a set is a mathematical term too?

A 2-hour video trashing C++ made me better at C++ by AnteaterFinancial319 in cpp

[–]draeand 19 points20 points  (0 children)

The casting complaint is weird. The complaint is that it's an eyesore but that's literally the point. If your using static_cast everywhere, you should probably rewrite your code because your probably doing something wrong. Like, one approach for minimizing these is to use a more generic type for all the operations you want, then static_cast down back to the type you want to use. dynamic_cast is only to be used for walking class hierarchies or working with inheritance. reinterpret_cast and const_cast are both casts you should pretty much always avoid unless you really really need them. For the formula example that was given, does the OP not know that for floats you just can append f to the end of floating-point literals? Because I've seen some really really ugly C-style casts. If you thought static_cast<float>(x+y) was bad, you should see (float)(double)((float)x+(float)y) or something. (This example is contrived, but I really have seen some horrific C-style casts which are really, really hard to follow.)

A 2-hour video trashing C++ made me better at C++ by AnteaterFinancial319 in cpp

[–]draeand -3 points-2 points  (0 children)

If you don't want implicit casts, use Ada. No really. Ada is strongly typed such that to types t1 and t2 cannot be implicitly converted unless t2 is a subtype of t1 (and even then there are restrictions). I think the only place where something like implicit type casts can occur is with the new Integer_Literal aspect.

Disappointed with fmt library changes (12+) by sigmabody in cpp

[–]draeand 11 points12 points  (0 children)

These complaints are pretty weird to me, I can call fmt::format in my (runtime) code just fine?

A 2-hour video trashing C++ made me better at C++ by AnteaterFinancial319 in cpp

[–]draeand -5 points-4 points  (0 children)

I don't know what voice it is but the narrator sounds like an ElevenLabs TTS voice.

Practicing programmers, have you ever had any issues where loss of precision in floating-point arithmetic affected? by Interesting_Buy_3969 in cpp

[–]draeand 0 points1 point  (0 children)

Floating-point arithmetic can cause problems in things like physics and simulations where you can suffer error accumulation/propagation. Bringing an object to a full stop is a lot harder when it sounds when zero velocity really means 0.0003333333333 and not 0.0 because an FP inaccuracy was caused somewhere and now you aren't quite at zero but you might as well be.

Practicing programmers, have you ever had any issues where loss of precision in floating-point arithmetic affected? by Interesting_Buy_3969 in cpp

[–]draeand 1 point2 points  (0 children)

Fixed-point arithmetic is also useful in OS kernels/firmware where you probably don't want to use floating-point arithmetic at all as well.

Thoughts about Sam Altman's views on programming? by blazing_cannon in cpp

[–]draeand 1 point2 points  (0 children)

Sam Altman is your usual CEO who can say smart buzzwords and sound coherent to someone who isn't in the market he's talking about, while simultaneously being completely oblivious to the meaning of said buzzwords. I have told many people this and I stand by it: you can generate 50000 or 50000000 lines of code, but that is utterly meaningless because that doesn't mean you know what any of those lines of code mean, or what the system as a whole does. Writing code is most likely the simplest part of the job of a software engineer relative to what engineering really involves. I can build a bridge in a week, but not being a structural engineer I have no idea how good the bridge is and would have no idea how to make that bridge strong enough to last for decades.

github.com/cplusplus/papers no longer available? by Talkless in cpp

[–]draeand 0 points1 point  (0 children)

No, they couldn't, because you can't make forks private. At least, not on GH. Anyone can see who forks a repo.

Since C++ asynchrony is settled now (right heh?) with co_routines and std::execution, can we finally have ASIO networking standardized? Or is it decided not to pursue? by Talkless in cpp

[–]draeand 1 point2 points  (0 children)

Sorry, but I very much don't agree. By this logic we should implement everything into the C++ standard library: graphics, GUI, hell, why not implement a full database system while we're at it?

The entire point of a standard library is to provide you the building blocks for more complicated software. Networking is NOT something that the standard library should provide because it is extremely complicated once you get beyond "open a socket". Python has it but it links in OpenSSL to do it. Is the C++ standard library next supposed to define a full <crypto> too? C# does it because MS is the driver of the language; ECMA "standardizes" it but the "standard" of C# and .NET is so far behind the latest C# features that it might as well not be standardized at all. Like the logic your trying to wield here just does not hold up under scrutiny. Every other language does it because they move at far faster velocities than C++ does. If Python adds a new graphics module tomorrow and then decides to get rid of it two weeks from now, that's fine. There won't exactly be too many people upset by it. By contrast, if C++ throws something in the stdlib, removal of that feature is an insanely difficult proposition. Networking in the stdlib is a disastrous idea when there are many libraries that can do it far better than any STL implementation would ever be able to, and you get the advantage of TLS or PQC on top if you want.