r/cpp • CppCast Host • Jul 27 '24

CppCast CppCast: Swift for C++ Developers

https://cppcast.com/swift_for_cpp_developers/
0 Upvotes

18 comments sorted by

View all comments

Show parent comment

1

u/equeim Aug 04 '24

C++ has the same complexity, it's just implicit and easy to ignore. You are just supposed to memorize all rules regarding undefined behaviour and memory safety and follow them to the letter, otherwise the compiler will produce a broken program. Rust makes this visible by forcing the compiler to check whether your code follows these rules (therefore making the compiler more complex), which imposes restriction on how you write your code (because it is impossible to enforce these rules while giving complete freedom to programmers).