3 ms·
I read the article and I am not convinced by the author arguments. He is talking about edge cases. I've been using C and C++ for over 20 years now, for both lo
by stephc_int13 6y ago
I read the article and I am not convinced by the author arguments.
He is talking about edge cases.
I've been using C and C++ for over 20 years now, for both low level and high level stuff, and I never needed to know about those edge cases.
And I think you don't want to know about them, you don't need to know about them to write good code.
Nitpicking about edge cases tradeoffs made by compiler designers and language standards decades ago is like attacking under the belt, in my opinion.
- pwdisswordfish4 6y agoThe point isn’t that anyone would want to write code like this. It’s to define rules that establish what the language implementation is allowed to assume about pointers when performing optimisations, and consequently, what operations code is allowed to perform without running into UB. The best way to study such rules is with edge cases like this. It’s like a trolley problem in a way. The situation may be unlikely, but better have an answer for it ready instead of replying ‘how dare you ask such questions’.
- SubjectToChange 6y agoCan you clarify what you disagree with in the article? The author wasn't saying programmers need to understand all the complexities of pointers to write good code, nor was he saying anything about the quality of those languages. Also, it is incredibility defensive to accuse the author of "attacking under the belt" when his observation wasn't aimed at any specific language.
- stephc_int13 6y agoFrom my opinion, this is a way to try and push the adoption of Rust by shading an unpleasant light on the current contender : C/C++ An other way to say is that this is propaganda.
- steveklabnik 6y agoThat doesn’t make sense, given: > Both parts of this statement are false, at least in languages with unsafe features like Rust or C: The two languages share these features, which is the whole reason this is being written in the first place.
- stephc_int13 6y agoUnsafe as a language feature is something that was invented by the Rust design team. And I don't think there is much value to this concept. This is like calling code "ugly" and saying that's a feature. Pointers are not unsafe.
- Sharlin 6y agoIt might not matter to your average programmer, but the author, ralfj, is writing from the point of view of RustBelt, a project to establish a formal foundation and soundness proofs for Rust's type system and memory model. He recently defended his PhD thesis on the topic [1]. [1] https://people.mpi-sws.org/~jung/thesis.html https://people.mpi-sws.org/~jung/thesis.html