3 ms·
I wouldn't lump guards and typespecs together. Guards are a runtime feature of erlang/elixir's excellent pattern matching. Typespec is an opt-in type hint for
by bevr1337 1y ago
I wouldn't lump guards and typespecs together. Guards are a runtime feature of erlang/elixir's excellent pattern matching.
Typespec is an opt-in type hint for develop and build time.
- conradfr 1y agoTrue but by using guards + pattern matching structs you can approximate type hinting, but it feels cumbersome and more of a workaround than a real solution.
- bevr1337 1y agoI'm of the opinion that Erlang/Elixir are terrible for repeat tasks like a standard CRUD server over a SQL database. Because yes, it IS cumbersome! Behaviors and type hints only get so far, and it is exhaustingly slow to sit with epgsql in the REPL to figure out what a query actually returns. I find them much better suited for specific tasks where there is little overlap or repetition.