Re:C++ is faster and safer than Rust (2020)
by AnimaLibera on Thursday October 07, 2021 @03:44PM
(#28791171)
Don't get me wrong, C++ is interesting to work with ^^, but what I said is true (just go ahead and test it, `#include <cstdint>`, then initialize a variable of type `int8_t` and `std::cout` it, I just tried it on godbolt.org with the `x86-64 gcc 11.2` compiler and it printed the value as a character rather than as a number (unlike an `int32_t`)).
I never miss an opportunity to mock C++ and its many layers of features that don't always interact well with each others. Maybe take it as a fun fact and not as an attack..
Re:C++ is faster and safer than Rust (2020)
by cordenr on Friday October 08, 2021 @03:44AM
(#28796719)
You're right! That's the thing with C++ - you learn something new everyday.
I had misread your original post. I thought the example was something like "std::cout << 97".
This is unfortunate. I imagine it came about when "cstdint" was introduced. Fixing it would require a break in compatibility with any existing code that "expected" that all char types printed a character, rather than value.
Re:C++ is faster and safer than Rust (2020)
by AnimaLibera on Friday October 08, 2021 @02:19PM
(#28802363)
Actually when I said that in comparison Rust is boring, I was only half joking. C++ is way more fun in the sense that it feels like a patchwork with surprising interactions that can get even C++ masters. C++ dev sounds like a fun job ^^
What is scary is, I don't doubt that some people will read your comment and think it could be true!