3 ms·
It wasn't easy, and I was quite toxic towards Rust posts before that - simply because everything at the time was saturated with Rust news, and a lot of very sil
by lionkor 2y ago
It wasn't easy, and I was quite toxic towards Rust posts before that - simply because everything at the time was saturated with Rust news, and a lot of very silly "rewrite it in Rust" posts. There are only three things that annoyed me this much in the last 10 years: Crypto (which was largely a hype-bubble), Rust (which turned out to be very cool), and AI (we'll see where that goes).
> You did the right thing, you ignored the emotional responses and went to check for yourself, factually and objectively.
I'm currently talking to lots of other C and C++ developers I know, and trying to convince them to give it an honest shot. The first thing I say is pretty much "Hey, I know this thing is overhyped and you're probably fed up, I thought so, too, but ...", and then follow that up with tagged unions, pattern matching and showing the toolchain. That sells most of them on it. Error handling also is a huge plus if they're also big error-handling nerds.
Also note how I never mention memory safety -- the reality is barely anyone gets really excited about that. We'd all use @safe Dlang[0] if it was that exciting to us all.
[0]: https://dlang.org/spec/memory-safe-d.html https://dlang.org/spec/memory-safe-d.html
- pdimitar 2y ago> Also note how I never mention memory safety -- the reality is barely anyone gets really excited about that. We'd all use @safe Dlang[0] if it was that exciting to us all. That's a different approach, thanks for describing it. I've tried it as well but apparently I spoke with some very bone-headed people because they hand-waved it away immediately with "meh, C unions are fine, you're a noob if you need Rust to hold your hand". :( I'll remember to bring those up next time, because I found myself caring about exhaustive pattern matching / enums more lately, compared to memory safety (which I do care about a lot still).
- lionkor 2y agoC unions dont work in C++ in most cases, because you can only have trivially constructible members in a union. So literally everything except primitives is out. "std::variant and the 12 ways to implement the visitor pattern" sounds like a book title, but is actually just the reality of writing C++