Re:Highland.js
by hamburglar on Thursday April 16, 2015 @02:46PM
(#9389989)
So why do we have this trend of using meaningless and ambiguous identifiers, and in particular, why would you do it in example code? I thought that as an industry, we'd moved past the folly of giving things terse and unhelpful identifiers in order to save a few bytes or keystrokes.
[ Parent
| on HN ]
Re:Highland.js
by killtheliterate on Thursday April 16, 2015 @02:50PM
(#9390015)
I think the example code is written using _ to convey the similarity for those familiar with underscore/lodash. In 2015, that's most JS developers.
Just hazarding a guess.
You notice that all the libraries that do this (underscore, jQuery, Lodash, et al.) offer features that are almost language features. Things so useful but generic that they could almost be integrated into the language syntax.
In this case, there's also the problem that 'Stream' is already used by node.
Re:Highland.js
by hamburglar on Thursday April 16, 2015 @08:55PM
(#9391705)
> In this case, there's also the problem that 'Stream' is already used by node.
Haha, well, your grandparent would like you to know that's no reason to avoid a particular name. Module system! ;)
> var BoringStream = require('stream');
> var Stream = require('highland');
Or if we like special chars, we could get really cute: > var $tream = require('highland');
It's like Stream, but, you know, blingier.