23 karma · joined December 17, 2013
All it does is JSON.parse, execute your series of functions then JSON.stringify.
Unless I'm missing something there is no advantage over ad-hoc javascript. If you want to load a file from disk, deserialize and do some processing in javascript then node is absolutely the right tool (and this isn't).
I can build a pipeline of functions and view the output just as conveniently in a plain node or browser environment and I would have much more flexibility.
Has anyone got a use case?
Anyone?
Breaking with this sort of practice is exactly why agile development and it's ilk were born.
While writing a formal specification can be useful, it is rarely as useful as defining the problem and placing your solution in the context of other possible solutions.
When I'm faced with a design problem I write a "white paper" setting out the problem, framing the desired properties of any solution then as systematically as possible setting out the alternatives and justifying why a particular solution has been chosen.
I usually find that in going through this process I am forced to change my initial design decisions, often ones that seemed obviously, even trivially, correct to begin with.
For a much further-reaching solution to this problem look at C++ user-defined literals, combined with what Bjarne Stroustrup calls "type rich programming".
now() + 3days + 21s + 102ms
This is not to say that c++ is the only language that can do this (although it does do it very well).
See the following video for a simple overview (apologies for toe-curling introduction): http://channel9.msdn.com/Events/GoingNative/GoingNative-2012...
...also the video above is worth watching just for the vector vs. list comparison.