3 ms·
> two different string types, two different throws (catch vs rescue), two different versions of each function (exception throwing vs error returning) I have ne
by sph 5y ago
> two different string types, two different throws (catch vs rescue), two different versions of each function (exception throwing vs error returning)
I have never used charlists at work. You have to know about them if interfacing with erlang, but it's never been a problem.
Same with exceptions: they are so niche in Elixir you practically never encounter them. Errors as values are idiomatic, not exceptions.
I don't want to assume, but it sounds like your project was handled by a team that didn't know idiomatic Elixir very much.
- mstipetic 5y agoSounds like they were using elixir like Java or go. I’ve never even used exceptions
- georgia_peach 5y agoJava and Go never did this to me on a point release: warning: System.cwd/0 is deprecated. Use File.cwd/0 instead warning: String.strip/1 is deprecated. Use String.trim/1 instead warning: Integer.to_char_list/2 is deprecated. Use Integer.to_charlist/2 instead I'm sure that underscore was just killing them.
- mstipetic 5y agoIt didn’t break, it gives a timely deprecation warning, you can probably fix it in an hour or two with basic grep, where is the problem?
- georgia_peach 5y agoProblem being that this happened on every point release. It would be a non-issue if it only happened before a major release. Spending "an hour or two" to update source and dependencies every time the runtime is upgraded is an expense I have only encountered in elixir. It didn't help that, circa 2018, many of the dependencies had been abandoned by their original developers, so even more work for us...
- smackeyacky 5y agoAndroid development is kinda this stupid too, just for the record. I mean, they slowed down the breaking function names but quadrupled down on syntax warnings where handler style got deprecated and whatnot. Super annoying to do a simple upgrade only to see a sea of yellow warnings in Android Studio. .NET is no better.
- georgia_peach 5y agoCan't speak to .NET, but even the worst server-side languages feel like a reprieve compared to the hellscape of native mobile development.
- georgia_peach 5y agoWhen a 3rd-party dependency requires a charlist, or throws an exception, I'm not going to diverge from upstream and roll a new one just to be idiomatic. Nobody chooses the charlist over binary.