42
Railway Oriented Programming
(fsharpforfunandprofit.com)
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Follow the wormhole through a path of communities !webdev@programming.dev
Because the reality is that people don't document errors (what exceptions can be raised by a method), don't explicitly handle all the cases (how many times have you returned a 500 in a Flask app from missing an error type in your
except
block/missing an errorhandler), or don't even think to put a try...except around fallible code (I see this a lot, anecdotally). TheEither
monad (or Rust'sResult
, which I'm more familiar with) force you to do something with the error explicitly.Exceptional cases are just as normal a part of a program as any other flow, including the success flows. If you have 20 happy paths and 80 exception paths, and only cover those 20 happy paths, you've covered 20% of the cases.