No, it literally returns you the first one. If you have a keyword list and use get your not going to be getting the benefit of duplicate keys.
> These all feel like personal judgements about tradeoffs rather than actual hard rules. I'm glad it came across this way. These are all ideas that I believe have helped me build more maintainable systems. But that's…
I didn't make a very strong case for it. Overall, my experience has been that calling the side-effecting function in the case statement directly tends to be easier to maintain and easier to read. But, I think piping…
> General consensus is that there's a lot of things pointed out here that are good to think about and consider, but don't treat them all as gospel. Definitely not gospel. These are patterns that I tend to use and…
My general feeling is that if the errors matter, `with` probably isn't the right construct. In those situations I prefer to use case. That's been helpful in my experience.
I agree on the performance characteristics. But if your using `get` then it doesn't matter that keyword lists have non-unique keys. You just get the first one.
Sorry, "invent" had the wrong connotations there. I just meant that there are scenarios where crashing wouldn't be acceptable. And in that case, sure, you should prefer to handle the error directly. But, allowing the…
Your talking about errors in the context of a web request or RPC. In those situations then sure, return an `{error, exception`} (that's the pattern I advocate for as well). But, I've found a lot of benefit from…
Calling it "good and bad elixir" was probably overly charged. Its a little late to change it now, but something I'll consider in the future.
You can certainly invent a scenario where using `Jason.decode!` wouldn't be appropriate. In that scenario, absolutely, handling the error and backing off is more appropriate. I'd also argue you shouldn't be doing…
Interestingly enough, my advice to not use `Map.get` is the most contentious point in the entire post. I didn't suspect that would be the case. I'm certainly not against using those functions and the additional checking…
Thanks! I'm glad you enjoyed the article and it could provide some useful insights.
No, it literally returns you the first one. If you have a keyword list and use get your not going to be getting the benefit of duplicate keys.
> These all feel like personal judgements about tradeoffs rather than actual hard rules. I'm glad it came across this way. These are all ideas that I believe have helped me build more maintainable systems. But that's…
I didn't make a very strong case for it. Overall, my experience has been that calling the side-effecting function in the case statement directly tends to be easier to maintain and easier to read. But, I think piping…
> General consensus is that there's a lot of things pointed out here that are good to think about and consider, but don't treat them all as gospel. Definitely not gospel. These are patterns that I tend to use and…
My general feeling is that if the errors matter, `with` probably isn't the right construct. In those situations I prefer to use case. That's been helpful in my experience.
I agree on the performance characteristics. But if your using `get` then it doesn't matter that keyword lists have non-unique keys. You just get the first one.
Sorry, "invent" had the wrong connotations there. I just meant that there are scenarios where crashing wouldn't be acceptable. And in that case, sure, you should prefer to handle the error directly. But, allowing the…
Your talking about errors in the context of a web request or RPC. In those situations then sure, return an `{error, exception`} (that's the pattern I advocate for as well). But, I've found a lot of benefit from…
Calling it "good and bad elixir" was probably overly charged. Its a little late to change it now, but something I'll consider in the future.
You can certainly invent a scenario where using `Jason.decode!` wouldn't be appropriate. In that scenario, absolutely, handling the error and backing off is more appropriate. I'd also argue you shouldn't be doing…
Interestingly enough, my advice to not use `Map.get` is the most contentious point in the entire post. I didn't suspect that would be the case. I'm certainly not against using those functions and the additional checking…
Thanks! I'm glad you enjoyed the article and it could provide some useful insights.