Remix.run Logo
▲ kllrnohj 2 hours ago

Does the existence of PEP 572 not similarly result in being paralyzed and overwhelmed at the number of ways to do something being greater than 1?

C++ definitely has complexity, but I'm surprised by the two examples specifically chosen. Which pointer? C++ only has 2: unique_ptr and shared_ptr (or 2.5 if you want to include weak_ptr but that necessarily means you already chose strong_ptr first). While this might be a complicated choice if you're just comparing to Python, but it shouldn't be if you're familiar with Rust since Rust has you make the same choice.

And then "how should I iterate" is similarly the same as any other language? Either a for or a for-each loop?

There's definitely baggage from 38 years of lessons learned, to be sure, just those examples are odd choices

▲TheOtherHobbes an hour ago | parent | next [-]

You've already mentioned four pointer types which are separate to the original plain vanilla pointer concept.

https://en.cppreference.com/cpp/language/pointer

When I started C++ nearly 15 years ago this was already a huge problem. I bought some books and looked up online references and after a while I discovered that both were already out of date.

C++ is a chimera. And it hasn't improved since.

Other languages are far more stable, conceptually. New features rarely undermine or reinvent the older ones.

C++ is unique in the way it keeps modifying its own core. There is no formal deprecation or EOL process, so the language is more like an archaeological dig than a living standard.

▲kllrnohj an hour ago | parent [-]

> There is no formal deprecation or EOL process

Yes there is or we'd have been talking about std::auto_ptr as well.

> New features rarely undermine or reinvent the older ones.

Many languages have mistakes they've later tried to sweep under the rug. JavaScript arrow functions trying to convince everyone that bind(this) wasn't ever a thing, for example.

C++, for whatever reason, is consistently the only language where people are determined to always dig up the skeletons and pretend they are at all still relevant. It's not unique in having skeletons. It's not unique in having language spec mistakes that can't realistically be changed, just ammended with a newer, better alternative.

But like the saying goes, there are only two kinds of languages: the ones people complain about and the ones nobody uses

▲StilesCrisis 2 hours ago | parent | prev [-]

Don't forget * (true pointer) and & (called a reference, more honestly a pointer that can't be repointed, except with UB it can _totally_ get repointed).

▲senthil_rajasek an hour ago | parent [-]

Made me LOL