Quote Originally Posted by grumpy View Post
Immutability by default is easier to analyse, certainly, but it also makes it harder to write programs with useful effects - since that requires something to be mutable.
No, no it doesn't. The narrow views that you claim i have of C++ seems to be matched to an equal extent by the narrow views you have of Rust. The only thing that _needs_ to be mutable is the state of the stdin/stdout buffers, network sockets etc. and Rust encourages developers to maintain totality when dealing with these interfaces. Everything else can be seen as a series of transformations from one state to the next, rather than a series of mutations. In general you could say that immutability eliminates side-effects, which as you say makes the code easier to analyse and understand since any flaws in the code are made more readily apparent. It also makes code easier to test. You can easily compare different states to each other, which means a memoized version of a piece of code becomes trivial to implement. There is a whole slew of functional programming languages in which immutable variables are the only kind of variables, precisely so referential transparency can be enforced. I don't think many people consider writing programs with useful effects a much harder task in any of those languages than it is in C++, in fact the opposite may be true.

There are plenty of alternatives in C++ (and C) to avoid the existence of dangling pointers, let alone dereferencing them.
While the tools have improved greatly, we can still do better.

In any event, not all forms of useful memory management can be effectively achieved at compile time - memory management, realistically, has aspects both at compile time and run time, with different advantages for different tasks.
Now you're just being intentionally vague - which advantages are there to manually managing memory at runtime?

There is plenty of debate about the advantages and disadvantages of type safety - and not just limited to C/C++. It is certainly possible to identify disadvantages of the C/C++ type system, but it is not a slam-dunk that stronger levels of type safety is desirable.
Nonsense, type safety is the extent to which a programming language discourages or prevents type errors. More type safety is always an improvement. Again, this is contingent on the fact that you place any value on program-correctness.

You're demonstrating your traits in your post
As are you.

Phantomotap:

While i didn't ask you, i kind of had a feeling you would bite when i wrote that, so in a way i _did_ ask you. Let me rephrase it then.

The presence of C discourages new C++ programmers from not writing C.

I'm not going to enter a debate about the merits of OOP.