Forget Case in Elixir

How to get the case out of the way

Photo by Yung Chang on Unsplash

Case Hides Intent

Snippet below shows how it is hard to untangle the code. You get the response from calling the genserver and handle cases. Simple function can do that, pattern matched to handle each case.

@spec supervise_video_worker(Atom.t, String.t) :: any()
def supervise_video_worker(api_scope, path)…

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store