3 ms·
> And, to be honest, thinking that pointers are "obsolete" suggests lack of understanding. Who has lack of understanding? Rust proves that pointers are not act
by progman 11y ago
> And, to be honest, thinking that pointers are "obsolete" suggests lack of understanding.
Who has lack of understanding? Rust proves that pointers are not actually necessary anymore.
> You know what, all your points seem to be against C++. A typical language evangelist.
What is wrong about C++ criticism? I was a professional C++ developer for a long time but now I am really glad that I don't need to maintain any C++ anymore. At the beginning C++ was real joy of programming but now it has grown to something which I don't like anymore.
There are other really modern languages much more clean and almost as performant as C++. Rust and Nim for instance. In Nim I am much more productive than in C++.
- kevinnk 11y agoRust has pointers all over the place - one of the core features is memory safety with pointers.
- arcticbull 11y agoPointers aren't the problem, null pointers are. Nullity (or the guaranteed lack thereof) should be baked into your type and you should be forced to handle as necessary when accessing a resource. That said, C++ is moving in that direction, too. For me the difficulty is that to maintain backwards compatibility the compiler can't force you to go with the language, and you can defeat the protections simply by not using them or by casting them away. It's the accrued years of cruft and never telling people to stop doing things they way they have been that encumber C++. IMO I'd favor a clean break. C++next should just drop support for all the old, un-safe ways of doing things and provide clean break. If you want to keep doing things the old way, stick to C++17. Moving forward there should only be one way to do things -- the safe way.
- slavik81 11y agoIf C++ dropped C compatibility, I'm not sure there'd be any reason to use it. You might as well just switch to Rust at that point.
- humanrebar 11y ago> Pointers aren't the problem, null pointers are. There is also aliasing, nonobvious shared state, and ambiguous object ownership. Getting rid of pointers is a no-go if you're interested in writing systems software. You need pointers just like you need goto and inline assembler. You do want to make doing unsafe things possible, but it needs to be contained and more obnoxious than doing the right thing. Rust has one approach to this. Not many other modern languages actually want to let you point to arbitrary memory and start flipping bits, which is exactly what you need to be able to do to write a driver.