Matches.js
Languages and libraries
javascript library
SHOW HN2012
How HN took it
4 positive, 3 neutral or asking, 1 mixed, 2 critical, out of 10 comments about the project. Thread score +0.24.
Idea: 3 for, 0 againstDesign: 1 for, 2 against
The thread, comment by comment
Each row is a top-level comment and its replies, in HN's order. Select a cell to open that comment on HN.
positive neutral or mixed critical about another commenter or something else the maker
What HN said
What people liked
Makes overloading declarative and cleaner for maintenance
From 1 comment
I didn't know I needed this until I saw it and had that A-HA moment when I realized how much cleaner this would make a lot of code. Instead of hiding away the logic in a bunch of…
OmarIsmail on HN
Useful addition to JavaScript
From 2 comments
i want this in js for a long time
elliotlai on HNAwesome! This is so useful!
dreamdu5t on HN
Objections
Relies on object key order, which ECMAScript does not guarantee
From 1 comment
Cool! Sucks that it has to be so stringly typed, but I can't see another alternative. One concern: "Each pattern will be tried in order until a match is found." As far as I know,…
jpolitz on HN
Readability concerns in large JavaScript codebases
From 2 comments
I've come across aspects of this functionality before in a couple of languages now, even psql, however looking at this JavaScript way of doing it, I have to question whether it…
se85 on HNThanks, I misread the first time, made sense the second time! My mistake! I still have my doubts as to how readable such an approach like this would be in large JavaScript…
se85 on HN
String-based patterns feel stringly typed
From 1 comment
Cool! Sucks that it has to be so stringly typed, but I can't see another alternative. One concern: "Each pattern will be tried in order until a match is found." As far as I know,…
jpolitz on HN
Requests
Support for CoffeeScript-style pattern matching
From 1 comment
Something like this would make a great addition to CoffeeScript.
danh on HN
Questions
What are applications of pattern matching?
From 1 comment
What are some applications of pattern matching?
username3 on HN
Alternatives named
Multimethods via bilby.js
From 1 comment
Sucks that it has to be so stringly typed, but I can't see another alternative. Multimethods would be an alternative to this type of ad-hoc polymorphism. I've encoded immutable…
pufuwozu on HN
LiveScript implicit switch
From 1 comment
Check out LiveScript's implicit switch syntax: http://gkz.github.com/LiveScript/#switch
oscilloscope on HN
XRegExp
From 1 comment
For those interested: XRegExp (http://xregexp.com) is also relevant. (Not a direct competitor to Matches.js, but has some nice features)
pooriaazimi on HN