Balanced Brackets

  • + 1 comment

    Which is more performant depends on the language, compiler and input type.

    For example, in V8 (nodejs, chrome javascript), I believe switches are turned into hash maps if you have 5 or more cases. Anything less than that would be identical to chained if/else.

    However, imho it's not worth trying to understand that level of arcanity. Use what is most readable & makes semantic sense given context. #collaboration