Echo JS 0.11.0

<~>
badsyntax 3568 days ago. link 2 points
Here are the problems the author is trying to solve:

* "you need to keep adding the aforementioned break; statement."
* " you'll have likely forgotten to add it (break; statement) because it's not very "JavaScripty"
* "it's syntax is rather... ugly to say the least."

I disagree with this article. There's nothing wrong with the switch-case statement (or, the author could do a better job at explaining the real issues, if any). There's also nothing wrong with using object literals "lookups", but substituting a simple switch-case statement with a complex object literal + function approach just to replicate the features of a switch-case statement is just silly, imo. The fall-through code is a lot more complicated for me to understand than a traditional switch-case statement. Each to their own.

Replies