3 ms·
The whole point of the OP was revealing the structure of the data being matched (like a routing file). This code completely obscures that. And I'm not sure this
by swannodette 14y ago
The whole point of the OP was revealing the structure of the data being matched (like a routing file). This code completely obscures that. And I'm not sure this is more readable as the number of conditions grow.
- jashkenas 14y agoOne programmer's readability is another programmer's "[_ (_ :guard #(< % 3)) _ _]" ;)
- swannodette 14y agoOne programmer's readability is another programmer's o 'PARAM_START ParamList PARAM_END FuncGlyph Block', -> new Code $2, $5, $4 ;)
- mattdeboard 14y agoI agree with swannodette that the CoffeeScript version is not better than the JS implementation but for a different reason. In my experience code brittleness is directly correlated to the number of "else if" conditions in a single block.