▲ 153 ▼ Borrow Checker (programming.dev) submitted 3 years ago by dukk@programming.dev to c/programmer_humor@programming.dev 13 comments fedilink hide all child comments
[–] SJ_Zero@lemmy.fbxl.net 12 points 3 years ago (1 child) That's clever. I lol'd permalink fedilink source hideshow 2 child comments replies: [–] snowe@programming.dev 4 points 3 years ago (2 children) I'm definitely missing something here. I'm terrible at rust and c++ permalink fedilink source parent hideshow 4 child comments replies: [–] RustySharp@programming.dev 19 points 3 years ago (1 child) The meme refers to the old adage "C lets you shoot yourself on the foot. C++ lets you shoot both feet and gives you a shotgun to do it" - referring to the how C allows you to perform memory-unsafe operations (causing corruption, or worse, security vulnerabilities), and C++'s complexity, potentially obscuring such unsafetyness. Rust's memory safety tries to save you from doing (un)intentional bad stuff, by giving you compile-time errors. It's also the bane of everyone so used to C/++'s ability to just pass around and modify whatever memory they want. permalink fedilink source parent hideshow 2 child comments replies: [–] dukk@programming.dev [S] 8 points 3 years ago I’ve actually never heard that one before. I was specifically referencing this quote by the language’s creator, but I guess that one works too. permalink fedilink source parent [–] o11c@programming.dev 4 points 3 years ago (1 child) What you are missing, of course, is the Rc<Refcell<T>> that you have to stick everywhere to make a nontrivial Rust program. It's like monads in Haskell, parentheses in lisp, verbosity in Java, or warnings in C - they're the magic words you have to incant correctly to make things work in their weird paradigms. permalink fedilink source parent hideshow 2 child comments replies: [–] lavafroth@programming.dev 2 points 3 years ago* Or an Arc<Mutex<T>> if dealing with threads. permalink fedilink source parent
[–] snowe@programming.dev 4 points 3 years ago (2 children) I'm definitely missing something here. I'm terrible at rust and c++ permalink fedilink source parent hideshow 4 child comments replies: [–] RustySharp@programming.dev 19 points 3 years ago (1 child) The meme refers to the old adage "C lets you shoot yourself on the foot. C++ lets you shoot both feet and gives you a shotgun to do it" - referring to the how C allows you to perform memory-unsafe operations (causing corruption, or worse, security vulnerabilities), and C++'s complexity, potentially obscuring such unsafetyness. Rust's memory safety tries to save you from doing (un)intentional bad stuff, by giving you compile-time errors. It's also the bane of everyone so used to C/++'s ability to just pass around and modify whatever memory they want. permalink fedilink source parent hideshow 2 child comments replies: [–] dukk@programming.dev [S] 8 points 3 years ago I’ve actually never heard that one before. I was specifically referencing this quote by the language’s creator, but I guess that one works too. permalink fedilink source parent [–] o11c@programming.dev 4 points 3 years ago (1 child) What you are missing, of course, is the Rc<Refcell<T>> that you have to stick everywhere to make a nontrivial Rust program. It's like monads in Haskell, parentheses in lisp, verbosity in Java, or warnings in C - they're the magic words you have to incant correctly to make things work in their weird paradigms. permalink fedilink source parent hideshow 2 child comments replies: [–] lavafroth@programming.dev 2 points 3 years ago* Or an Arc<Mutex<T>> if dealing with threads. permalink fedilink source parent
[–] RustySharp@programming.dev 19 points 3 years ago (1 child) The meme refers to the old adage "C lets you shoot yourself on the foot. C++ lets you shoot both feet and gives you a shotgun to do it" - referring to the how C allows you to perform memory-unsafe operations (causing corruption, or worse, security vulnerabilities), and C++'s complexity, potentially obscuring such unsafetyness. Rust's memory safety tries to save you from doing (un)intentional bad stuff, by giving you compile-time errors. It's also the bane of everyone so used to C/++'s ability to just pass around and modify whatever memory they want. permalink fedilink source parent hideshow 2 child comments replies: [–] dukk@programming.dev [S] 8 points 3 years ago I’ve actually never heard that one before. I was specifically referencing this quote by the language’s creator, but I guess that one works too. permalink fedilink source parent
[–] dukk@programming.dev [S] 8 points 3 years ago I’ve actually never heard that one before. I was specifically referencing this quote by the language’s creator, but I guess that one works too. permalink fedilink source parent
[–] o11c@programming.dev 4 points 3 years ago (1 child) What you are missing, of course, is the Rc<Refcell<T>> that you have to stick everywhere to make a nontrivial Rust program. It's like monads in Haskell, parentheses in lisp, verbosity in Java, or warnings in C - they're the magic words you have to incant correctly to make things work in their weird paradigms. permalink fedilink source parent hideshow 2 child comments replies: [–] lavafroth@programming.dev 2 points 3 years ago* Or an Arc<Mutex<T>> if dealing with threads. permalink fedilink source parent
[–] lavafroth@programming.dev 2 points 3 years ago* Or an Arc<Mutex<T>> if dealing with threads. permalink fedilink source parent