3 ms·
I used to feel like I was fluent in C++ but over time I realized that I was using just like 40-50% of the language because the rest of it was so complicated tha
by ArchOversight 4y ago
I used to feel like I was fluent in C++ but over time I realized that I was using just like 40-50% of the language because the rest of it was so complicated that it made it difficult to work with others who may not have had as deep of a knowledge.
With Rust I've found that even though sometimes it feels like it is harder to write code with, I am finding it far more likely that it is correct when the compiler is happy with it, and I find myself worrying much less about move semantics/correctness/pointers and all that stuff like I was with C++, it has allowed me to move faster and not spend as much mental time on trying to make sure/understand if what I am doing is ACTUALLY safe.
I am using C++ as an example, because the other language I use regularly is Python and there are still pieces of Python code that make me scratch my head with "how does THAT work?!"
- wwalexander 4y agoAbsolutely agree with you. Rust lets me offload all the boring, inscrutable memory management checking to the compiler. Sure, I can’t get away with undefined behavior, but I spend my Rust programming time thinking about the business logic and letting the compiler tell me when the books are off.
- jcelerier 4y ago> I am finding it far more likely that it is correct when the compiler is happy with it, it's pretty interesting though - surely you would have flagged the equivalent C++ code to what is discussed in https://github.com/rust-lang/rust/issues/93740 https://github.com/rust-lang/rust/issues/93740, if my understanding is correct - akin to std::unique_ptr<pthread_mutex_t>, as obviously wrong ? It's a pattern that was apparently commonplace in rust until now yet I would definitely not let my first year comp. sci. interns get away with something like this during code review.
- tialaramex 4y agoWhat about it is "obviously wrong" ? Did you mean here, "Not performing as well as I'd like" ?
- staticassertion 4y agoI think I would really enjoy reading you explain what's obviously wrong about that.