I like the approach of coalescing a huge nest of if statements into a map lookup - it makes the code easier to read and understand! Like anything, though, you can overdo it - it doesn't help much for a 2-choice branch, and may use more resources than a simple if/else would have. Thanks for sharing!
Hi Eric! I’m glad you liked it, I like it a lot too! I’m in need of feedback for this other pattern, if you could take a look I’d really appreciate hearing your thoughts 😃
I like the approach of coalescing a huge nest of
if
statements into a map lookup - it makes the code easier to read and understand! Like anything, though, you can overdo it - it doesn't help much for a 2-choice branch, and may use more resources than a simple if/else would have. Thanks for sharing!Hi Eric! I’m glad you liked it, I like it a lot too! I’m in need of feedback for this other pattern, if you could take a look I’d really appreciate hearing your thoughts 😃
dev.to/tomazlemos/implementing-a-s...
Thanks for your kind reply, and Happy New Year!
Done, glad to know it's useful.
Super useful Eric, thank you very much!
I decided to rewrite that post based on your and other fellow DEV's feedback, if you'd care to read the new version I'd really appreciate!
dev.to/tomazlemos/let-s-talk-trade...
Done. This is why DEV is great - we help each other get better!
Thanks a lot Eric!