Friday, February 15, 2019

Coding without IF statements

Found below linked article that provides tips on how to avoid using IF statements, with one of the benefits being readability. The tips largely are based on the concept of using a map to the result, which is essentially a one-in replacement of a switch statement. If's can be rigged in too as the examples show:
https://edgecoders.com/coding-tip-try-to-code-without-if-statements-d06799eed231

No comments:

Post a Comment