Conversation
Notices
-
Embed this notice
Sexy Moon (moon@shitposter.club)'s status on Monday, 18-Sep-2023 21:45:07 JST Sexy Moon The only thing elegant about Elixir is the pattern matching, everything else feels really clunky. -
Embed this notice
Sexy Moon (moon@shitposter.club)'s status on Monday, 18-Sep-2023 22:23:15 JST Sexy Moon @mar77i patterns can only be done on terms not other patterns so they can't be recursive but you can make highly nested patterns to match against.
My impression of pattern matching is that it's a tradeoff. I can make super elegant patterns that make sure bad data doesn't enter a code pathway but now like a dozen functions have to be named "handle_json" each with slightly different matching gunk instead of a set of functions each with clear, self-documenting names saying exactly what they're handling in the json.
This might be a function of my inexperience with the language and not a real problem, I don't know yet.
I frequently am also running into situations where I write some code; when code that interfaces with external systems have an error, it shuts down the whole application because this is the Elixir/Erlang way of doing things; so I read about how to handle that and find a couple patterns you can implement; I implement the pattern and then run into some problem the trivial example doesn't address and it seems like I'm back to trying to solve the same or similar problem. This is almost certainly due to my inexperience but the language just isn't intuitive at all and its design purity makes doing some simple things in other languages laborious.
I'm complaining a lot but I'm not giving up and this is how I learn: I do my due diligence and try as hard as I can; then I complain loudly and then an expert shows up and tells me I'm an idiot and here's exactly what I'm doing wrong, and then I learn something non-trivial far faster. -
Embed this notice
Martti (mar77i@gleasonator.com)'s status on Monday, 18-Sep-2023 22:23:16 JST Martti @Moon I always wonder, as reguiar oo languages are sometimes too flexible, is pattern matching sound, and can pattern-matching pattern objects match more patterns during the matching of patterns? -
Embed this notice
Sir Agent Provocateur Arwalk (arwalk@noagendasocial.com)'s status on Monday, 18-Sep-2023 22:23:28 JST Sir Agent Provocateur Arwalk @Moon
Pipeline operator is pretty cool too.Sexy Moon likes this. -
Embed this notice
opal hart (opal@ap.maladaptive.art)'s status on Monday, 18-Sep-2023 22:23:32 JST opal hart @Moon join prolog everythings a pattern match Sexy Moon likes this. -
Embed this notice
Martti (mar77i@gleasonator.com)'s status on Monday, 18-Sep-2023 22:43:52 JST Martti @Moon Naming things is an exercise in self-discipline, like managing your file system and stuff like that, so that's a you problem, I believe.
And then, error handling is one of the most important things a programming language should be doing well. I like the try/catch blocks in "modern" high level languages, but I also like C for the weird reason that it does error handling in the same half-assed way it seems to be doing anything else outside of translating to as little machine code as possible. I was unaware of Elixir's apparent shortcomings in that area, though, so thanks for the cruising altitude overview.Sexy Moon likes this. -
Embed this notice
Sexy Moon (moon@shitposter.club)'s status on Monday, 18-Sep-2023 22:43:52 JST Sexy Moon @mar77i the issue is that if you want to take advantage of pattern matching then every function has to have the same name but with a different pattern to match against so you end up having to make a generic name. if you are in a different language you might for example instead of pattern matching write some if-statements that tease out what exactly the data is in each case and then send it to an appropriately-named function. You can do the same thing in Elixir where every version of the function calls a different function with a clear name but then you either duplicate the pattern match in the new function or you leave it out and someone accidentally could pass the wrong data to it and so you either are duplicating code everywhere or not making your code actually-safer. -
Embed this notice
Sexy Moon (moon@shitposter.club)'s status on Monday, 18-Sep-2023 22:46:08 JST Sexy Moon @mar77i again to be clear I think the language is very good, I am rewriting a big TypeScript project in Elixir and it's already just crazy better but it does feel like it has shortcomings.
-
Embed this notice