Hacker News .hnnew | past | comments | ask | show | jobs | submit | Davidbrcz's commentslogin

The best way to learn a new language is to follow a proper structured resource which would cover syntax, semantic, tooling & ecosystem and best practices.

I think that's only proper when you have basic understanding of the language. I don't think it is proper to read full c++ doc if you don't even know what is ptr

No it's not.

The language keeps growing, with

- new features overlapping old features from previous standards without replacing them or deprecating them (function::copyable_function vs std::function, std::less<> key for transparent lookup in maps)

- new features not usable by the layman (coroutines ...)

- Cryptic syntax (reflection...)

- Stuff you are told not to use because of performance reason and that cant be fixed because of ABI (regex)

- Compile errors that are 1km long (no, concepts are not helping here, the 'nicer' message is still buried into a hot pile of template instantiation callstack).


I wonder how many programming languages would be able to devoid of all or some of these problems when they are 40 years old.

It's easy to compare new and old languages, and saying older languages are wrinkly. Let's see how other shiny programming languages look like when they are 40 years old.


Python, Java, Lua, Ruby are ~30 years old, Ada being as old as C++.

Sure, none is perfect and they have cruft and warts, but they are not such a mess as C++ is.


There are two kinds of programming languages: the kind everyone complains about and the kind nobody uses.

So a bit like Python or any other language of similar age.

Working occasionally with modern Python helped me love and respect C++ even more.

Python3 is what, 15 years old?

I start counting from Python 1.

Well if c++ had the liberty of scrapping the language twice in the last 30 years I'm sure it would look better too.

Python 2 to 3 mess is exactly why all languages think twice about breaking backwards compatibility.

That is probably what they should have done ..l

Except the language keeps growing, with

- new features overlapping old features previous standards without replacing them or deprecating them. - new features not usable by the layman - ...

See function::copyable_function vs std::function, modules, coroutines, Reflection syntax is cryptic at best, ...


You don't have to use them. There's a handful of nice to haves in modern releases but its totally fine and sane to just ignore whatever the committee is distracted by at the moment.

Hell, if you wait long enough, they'll just deprecate it before you can care to bother.


And that's the usual fallacy (just ignore the bad stuff).

But if you work with C++ in professional context, you will encounter it somewhere (library, teamate's PR, legacy code, LLM output, book / blog / conference ...). |

You actually need to know the bad stuff to be able to judge it and discard it.


We're talking about different things.

Im talking about your own personal coding. You dont have to use the new things. You dont have to know them to decide to discard them. In fact, the criteria to discard something is to not know it. You generally shouldn't be using things you dont know anyway.

The fact that other people use things you do not know is not a reason to stress out about the dumb pace and direction c++ is moving in. It is possible to enjoy a life free from fomo about the c++ standards goalposts.


I was an intern at CERN in mid 2010s and worked on this !

Concepts have been disappointing for me: what they tell you is still buried in 1000 lines of errors.


Concepts support (like traits I'm Rust) is necessary for good diagnostics, but not sufficient. It gives you the architecture and metadata that you require to infer what the user wants, but a lot of additional analysis on the decision chain that was followed in order to figure out what is relevant and what isn't.


Also the C++ 20 "Concepts Lite" isn't a nominal system like Rust's traits (or like the C++ 0x Concepts proposal which Bjarne had ripped out), it's Duck typing again and so it's harder even if the work was done.

Rust can say hey, this code treats Mallard as if it's a Duck, did you mean for this Mallard to implement Duck? If so, try writing #[derive(Duck)]

But for Concepts Lite the compiler needs to guess that you wanted Mallard to match this requirement that Ducks can quack, and observe that Mallard's quack has a slightly wrong signature so it doesn't match and so that's probably the mistake.


concepts have been excellent for me for overload resolution in complex template code (good riddance SFINAE) and for documentation.

To improve error messages, not so much.


We are more likely to have water and food shortages because of resource exhaustion and climate change. Maybe goods shortages because of war or economic depression.


Data is proving otherwise. While locally shortages do happen, in general there more resources available than ever: http://awealthofcommonsense.com/2023/04/50-ways-the-world-is...



More climate disasters, more wars (water's war), more refugees.


> Dissimilar redundancy eliminates that risk. A completely different OS, different codebase, different development team.

Not entirely true. I've heard during my uni years of a case were two independent teams used the same textbook for implementing a feature, which had an error, and thus resulting in the same failure mode.


Ha, very curious what the issue was and what textbook


They are all the regular software, but with new bugs in it !


I use asio at work for coroutine. It's one of the most opaque library I've ever used. The doc is awful and impenetrable.

The most helpful resource about it is a guy on stackoverflow (sehe). No idea how to get help once SO will have closed


Ask Claude Code to write a manual for it.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: