• 1 Post
  • 70 Comments
Joined 1 year ago
cake
Cake day: July 28th, 2024

help-circle
  • Languages like Java or C++ have Exceptions, which are errors, that are not explicitly mentioned in the function signature. Meaning, you might need to handle an exception you didn’t even know existed. And if you don’t, your program will just crash when these exceptions occur.

    In Rust all errors are explicitly mentioned and part of the return type. Because of this Rust has a lot of ways to quickly handle an error. One of those ways is “Trust me, bro” (or .unwrap()), which converts the combined error/success return type into just a success type, causing the program to crash if it actually was an error, restoring the more unsafe behavior of other languages.



















  • I was trying to get you to question the believe that lazyness is an evolutionary trait. Like the post you replied to said: Find the root cause of your lazyness.

    Because it’s almost always not an evolutionary trait, it’s avoiding negative emotions. As you said: Doing dishes (bad) -> do nothing (good) But, with boredom, this would result in this: Doing dishes (bad) -> do nothing (good) -> boredom (bad)

    Thus, we get negative emotions again. But we can avoid the final negative emotions by lying on the couch and spending energy looking at a screen. And our chain looks like this: Doing dishes (bad) -> looking at screen (good)

    Because being bored is hard. If you want to see how hard it is, decide to just stare at a blank wall for the next 30min-1h instead and watch your brain fight this decision as hard as it can.

    Thus saying “I’m lazy” and “being lazy is an evolutionary trait” results in “I can’t do anything about me being lazy”. And that is an easy way to avoid having to face and work through those negative emotions.