News for hackers. Stuff that matters.
Re:Why Elixir? A Rebuttal to Common Misconceptions by conradfr on Thursday July 24, 2025 @06:08AM (#44668964)
Writing typespecs (+ guards) feels really outdated and a drag, especially in a language that wants you to write a lot of functions.

It reminds of the not-missed phpspec, in a worst way because at least with PHP the IDE was mostly writing it itself and you didn't need to add the function name to them (easily missed when copy/pasting).

Re:Why Elixir? A Rebuttal to Common Misconceptions by bevr1337 on Thursday July 24, 2025 @10:47AM (#44671360)
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.

Re:Why Elixir? A Rebuttal to Common Misconceptions by conradfr on Thursday July 24, 2025 @12:01PM (#44672336)
True 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.
Re:Why Elixir? A Rebuttal to Common Misconceptions by bevr1337 on Thursday July 24, 2025 @12:06PM (#44672400)
I'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.