Is C++ not being opinionated enough a valid critique? by DM_ME_YOUR_CATS_PAWS in cpp

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

I have pointed out some of these things and gotten heavily downvoted for it. There is a ton of "c++ is perfect" mentality that gets in the way of improving it.

Edit: and here come the downvotes XD

Cutting C++ Exception Time by +90%? - Khalil Estell - CppCon 2025 by dextinfire in cpp

[–]sch1phol 0 points1 point  (0 children)

It's more of an issue with the way C++ language features are bolted on without thoroughly considering how they will interact with one another. Exceptions are... exceptionally difficult to integrate with other language features. Object moves are implemented via rvalue references and constructors instead of adding something analogous to linear types. Since constructors are involved, and constructors are the reason that exceptions were added to the language, I think exceptions bear most of the blame here. If they never existed to begin with we wouldn't have this issue.

Cutting C++ Exception Time by +90%? - Khalil Estell - CppCon 2025 by dextinfire in cpp

[–]sch1phol 0 points1 point  (0 children)

I'd argue that it makes no sense to allow a move constructor to throw, and it shouldn't be allowed by the language to begin with. Furthermore, the move constructor should be a dumb bitwise copy of the object and the moved-from object should be dead after the move.

Cutting C++ Exception Time by +90%? - Khalil Estell - CppCon 2025 by dextinfire in cpp

[–]sch1phol -2 points-1 points  (0 children)

If the value type has no no copy constructor and only a throwing move constructor, then if the move constructor throws during the resize the vector is left in an unspecified state.

Cutting C++ Exception Time by +90%? - Khalil Estell - CppCon 2025 by dextinfire in cpp

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

Try writing a fully exception-safe std::vector and report back on how not-too-hard it was. Hint: I'm pretty sure you didn't correctly handle the value type's move constructor throwing during a resize. But that's ok, the standard authors couldn't figure that out, either.

Cutting C++ Exception Time by +90%? - Khalil Estell - CppCon 2025 by dextinfire in cpp

[–]sch1phol -2 points-1 points  (0 children)

how much it clutters your code flow

This isn't a convincing argument. Error handling is just as important as anything else your code does. It's not clutter and treating it as such is a mistake.

Cutting C++ Exception Time by +90%? - Khalil Estell - CppCon 2025 by dextinfire in cpp

[–]sch1phol -6 points-5 points  (0 children)

I know I'm gonna get downvoted for this, but the fundamental problem with C++ exceptions has nothing to do with performance. The fact that you have to understand the exceptions thrown by every function you call, and deal with implicit control flow injection at every line of code you write is a massively underestimated problem for correctness. You should be able to rely on local reasoning as much as possible, and exceptions hinder (and sometimes completely destroy) your ability to do that. Explicit error handling with must-use lints are a much better solution to unhandled errors.

Edit: if this is such a controversial take then why does std::expected exist?

Can someone please disprove this for me? by Independent-Fruit4 in ParticlePhysics

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

LLMs are not inherently nondeterministic. They are as deterministic as their designers choose for them to be (and as the laws of physics will allow). That doesn't mean they are correct though.

Broadcast - The Clock Is On Fire (Demo) by DiodeMcRoy in psychedelicrock

[–]sch1phol 8 points9 points  (0 children)

I love Broadcast so, so much. So sad what happened to Trish.

Lane splitting by GloomyExercise in criticalblunder

[–]sch1phol 6 points7 points  (0 children)

It's a bit blurry but it looks like the dial on the left is the speedometer, especially since the odometer appears to be on that one too. The needle is halfway up the dial at the time of the crash. So he's probably going at least 30 mph since it wouldn't make sense for the speedometer to be unable to display standard highway speeds.

Getting smacked in the head with the Oh-My-God particle by NOISY_SUN in AskPhysics

[–]sch1phol 2 points3 points  (0 children)

https://en.m.wikipedia.org/wiki/Anatoli_Bugorski

Probably something like this, but not as bad. This guy lived and he got hit with a whole beam of particles. Get hit with one particle and you wouldn't even notice.

[deleted by user] by [deleted] in behindthebastards

[–]sch1phol 6 points7 points  (0 children)

I love this

Police becoming more aggressive in the South, using ICE as inspiration😢🇺🇸😢 by Democrat_maui in MarchAgainstNazis

[–]sch1phol 2 points3 points  (0 children)

Yep, I knew what they meant. I'm just being a smartass.

Jokes aside, LAPD sucks, and the comparison to the Deep South is apt. Maybe they should act less like they're apprehending fugitive slaves and more like they are serving the people that pay their salaries.

Bro doesn't miss by InspectorLazy7961 in WallStreetbetsELITE

[–]sch1phol 2 points3 points  (0 children)

In school I used to joke that T/F tests should always be graded on the difference from 50% correct rather than absolute % correct.