

Coalesce – Communication framework for distributed JavaScript - marknadal
https://github.com/amark/coalesce

======
goblin89
The first example is a little hacky in using one function as both keyup event
handler _and_ message receiver.

This and some other quirks together make things harder to understand. The idea
seems really cool, but a clearer (even if not as fun to read) README would
help. :)

If I were the maintainer, I'd reduce the amount of text (by moving extensive
API docs somewhere else? cutting some of the stuff that is just-for-lulz?),
and think of adding an overview—how coalesce fits among existing solutions.
Yeah, dry and boring, but practical.

------
comex

            m && m.what? document.hello.to.value = m.what :
            a.com.send({what: document.hello.to.value, where: 'magic' });
    

Urgh.

------
logotype
is it just me? or is the source written in such a horrible way that it is very
difficult to understand how it works. i don't like it.

~~~
ap22213
I didn't look at the source yet, but from watching the video, I understand
your view, completely.

------
natch
Kudos for great instructions in the readme.

However, bummer that despite the clear instructions, they never state what
this does or why it might be helpful, for what problem.

So many developers take the attitude of "if you don't know why you need it,
you shouldn't be learning about it" but I don't see why they do that. You
should always assume that some outsiders will come along, and some of them
will have use cases that could benefit from your solution, if only you would
explain what the hell it is.

~~~
zimbatm
I think it's not fair to assume that the author is elitist about his tool.
It's actually hard to remove enough context from one-selves to write
documentation for new-comers. The author already wrote the tool and knows what
it's about so it's easy for him to forget that not everyone does. That's my
experience as a project writer at least.

------
grannyg00se
"When Is a hyper precise millisecond timestamp of when the message was
created.

It is 17 digits long, which is 4 digits longer than the normal new
Date().getTime()"

Is this serious? I can't find any assignment of "when" in the code. And why
would you expect hyper precise timing from js? And if it has four more digits
wouldn't it no longer be milliseconds?

~~~
gingerrr
HAHAHAHAHA he appends a 4-character string of random numbers to "new
Date().getTime()", hides it behind several terribly-named and terribly-
namespaced function calls and tries to call it hyper precise:

[https://github.com/amark/theory/blob/master/theory.js#L449](https://github.com/amark/theory/blob/master/theory.js#L449)

look at 'time.now()', called by when, and 'time.is()'.

~~~
jamesrom
I think that the comment about it being "hyper precise" is a joke.

The likely reason for the extra 4 digits is to prevent collisions in timing.

The probability of messages having the same timestamp is already pretty low,
this just divides that probability by ten thousand.

~~~
stingraycharles
Isn't this the reason UUIDs were invented?

~~~
lostcolony
Not exactly.

UUIDs are for uniqueness, but don't imply order.

Timestamps imply order, but not necessarily uniqueness.

Sometimes you want both. Some languages give you mechanisms to guarantee an
increasing timestamp (Erlang's erlang:now(), for instance) for that purpose.

Now, if this is actually appending just random data, rather than an
incrementing counter, you still are guaranteeing uniqueness (well, a
reasonable guarantee of probably uniqueness), and have order to a specific
coarseness, but beyond that all bets are off. My guess is that it's to imply
an absolute ordering, but once you're sub-millisecond assume that it doesn't
really matter if the order is accurate.

------
egeozcan
I've been writing node apps since before it was popular ( =) ) and still had
hard time getting the examples. Some clearer examples maybe?

------
nzonbi
Excellent, congratulations to the creator. This looks like a good js
communication foundation for practically anything.

------
jamesrom
This is scary. Not in a bad way.

