>I think the biggest benefit is that your async programming becomes/or
>looks more sequential/synchroneous which tend to be easier to follow,
>or in other words less spaghetti-ish.


And I definitely beg to differ that.

Take this future-less code from a chat server:

| void rpc_call_muc_join(ReturnCall x, mapping args )
| {
|     [string muc,string who] = get_args(args,
|                                        "muc",stringp,
|                                        "inviter",ornull(stringp));
|
|     Channel channel = get_destination( muc );
|     int when = now();
|
|     channel->when_available()
|     {
|       if( !channel->exists() )
|          client_error(x, "No such channel" );
|
|       channel->joined( user->id, when ) {
|         me->join_channel( channel ) {
|            channel->add_message( msg( "joined",
|                               "user_ids",({format_destination(me)}),
|                             "by",format_destination(me),
|                               "when", now)) {
|                      x(true); // return true.
|            };
|         };
|       };
|    };
| }


Todays quiz: Is it really harder to read, and how many asynchronous levels
do you think there is in it? :)


Also: Could we get rid of the trailing ';' somehow in the grammar?
  • ... Marcus Agehall (nu med K-märkt fastighet och ny elcentral) @ Pike (-) developers forum
    • ... Pontus Östlund
    • ... Martin Karlgren
      • ... Martin Karlgren
      • ... Marcus Agehall (nu med K-märkt fastighet och ny elcentral) @ Pike (-) developers forum
        • ... Martin Karlgren
    • ... Per Hedbor () @ Pike (-) developers forum
      • ... Pontus Östlund
        • ... Per Hedbor () @ Pike (-) developers forum
          • ... Marcus Comstedt (ACROSS) (Hail Ilpalazzo!) @ Pike (-) developers forum
            • ... Per Hedbor () @ Pike (-) developers forum
              • ... Stephen R. van den Berg
                • ... Stephen R. van den Berg
                • ... Stephen R. van den Berg
        • ... Chris Angelico
    • ... Per Hedbor () @ Pike (-) developers forum
      • ... Marcus Comstedt (ACROSS) (Hail Ilpalazzo!) @ Pike (-) developers forum

Reply via email to