• 0 Posts
  • 11 Comments
Joined 1 year ago
cake
Cake day: August 5th, 2023

help-circle


  • I would say it’s very useful when you are looking for one specific pattern, which happens a lot with Option<T>. Plus, being able to chain it in if / else if / else chains helps with organizing the code. It generally doesn’t grow as deep as with match.

    That said, match is fantastic and it’s totally fine to prefer using it. if let and let else are there for those cases when you tend to discard or not need to use the other values than the matched one. How often that happens depends on what you are doing.








  • Also the Swedish classic “glida in på en räkmacka” ((to) slide in on a shrimp sandwich), which basically means to end up somewhere (location, career, situation) without any difficulties. The shrimp sandwich symbolizes a life without difficulties or in some luxury.

    Then there’s also “halka in på ett bananskal” ((to) slip in on a banana peel), which is similar to the above, but not always favorable and you don’t have any plan or preparation. You just winged it or it just happened by accident.