8 ms·
First of all I implement abstraction using language features and there for I take advantage of it. - I favor maintainability over performance, also keep in
by gozala 14y ago
First of all I implement abstraction using language features and there for I take advantage of it.
- I favor maintainability over performance, also keep in
mind that promised function take promises as arguments
and can't do much until they're fulfilled (associated IO
is done) so that small performance hit is insignificant
in most of the cases.
- You can write your own decorators to wrap constructors
and their methods if you need to. That being said, I'd
recommend against, mixing mutable state with logic does
no good in long run. You'll be better of with functional.
- As for map / reduce, promises represent eventual values,
not sequences of them. For that there are streams and I
have explored that area as well:
https://github.com/Gozala/streamer/wiki/stream
I have not wrote about it because I don't think it was
good idea to dump everything in one post.
I'm happy async did that for you.