▲ | AlotOfReading 14 hours ago | |||||||||||||||||||||||||
C++ has lifetime rules just like Rust. They're simply implicit in the code and not enforced by the compiler. Do you prefer the uncertainty of silent miscompilations and undefined behavior to upfront compiler errors? You're already using a language with a strong type system, so it's confusing to me why you would choose to draw the line here. | ||||||||||||||||||||||||||
▲ | bagxrvxpepzn 13 hours ago | parent | next [-] | |||||||||||||||||||||||||
> Do you prefer the uncertainty of silent miscompilations and undefined behavior to upfront compiler errors? Yes because then I don't have to spend hours writing esoteric spaghetti code to prove something to the compiler that is trivially known to be true. Your error is assuming static lifetime checking is free. As an engineer, I use judgement to make context-dependent trade offs. If you like playing the compiler olympics, or your employer forces you to, please use Rust. | ||||||||||||||||||||||||||
| ||||||||||||||||||||||||||
▲ | lelanthran 2 hours ago | parent | prev | next [-] | |||||||||||||||||||||||||
> C++ has lifetime rules just like Rust. They're simply implicit in the code and not enforced by the compiler. The problem is that the rules enforced by Rust is not restricted to lifetime rules, it's a much much larger superset that includes quite a lot of safe, legitimate and valid code. | ||||||||||||||||||||||||||
| ||||||||||||||||||||||||||
▲ | guappa 2 hours ago | parent | prev [-] | |||||||||||||||||||||||||
> You're already using a language with a strong type system I'll have you know I made a variable void* just yesterday, to make my compiler shut up about the incorrect type :D |