4 ms·
The Erlang world is obviously full of bright people with cool ideas, but difficult string handling is a deal breaker for me if I intend to use a language in pro
by mkl95 5y ago
The Erlang world is obviously full of bright people with cool ideas, but difficult string handling is a deal breaker for me if I intend to use a language in production grade projects. Is Elixir better at it?
- j03b 5y agoSignificantly better, yes, I've never felt like String methods were missing while using Elixir, they've also got some goodies like Jaro distance right in the stdlib. Docs on Elixir strings are here, plenty of methods: https://hexdocs.pm/elixir/1.12/String.html https://hexdocs.pm/elixir/1.12/String.html This getting started guide also covers some more examples of working with strings (vs. charlists, the erlang string type, which are described at the end): https://elixir-lang.org/getting-started/binaries-strings-and-char-lists.html https://elixir-lang.org/getting-started/binaries-strings-and...
- gamache 5y ago> The Erlang world is obviously full of bright people with cool ideas, but difficult string handling is a deal breaker for me if I intend to use a language in production grade projects. Is Elixir better at it? Yes, the Elixir stdlib uses only binary strings, never charlists. But to be fair Erlang largely got its shit together with binary strings a decade ago.
- dnautics 5y agoIt's still uncomfortable to deal with binary strings in erlang, starting with the very awkward syntax, but also there are also quite a few non-core stdlib functions that refuse anything but charlists, like options for tls (ssl) module, x509 settings, ssh module, etc.
- sergiomattei 5y agoI felt that way (using Elixir) until I truly took some time to dive in and understand Erlang types, especially `binary`. After the confusing terminology was out of the way and I understood the underlying systems, it all felt fine. Has a learning curve though!