Today I've been little over a year on the Robotics team. I've learned a lot of new things and I had a plan for an advent calendar in 2010 focusing on some tips and tricks for CCR that I've learned as a new member on the Microsoft robotics team. Since I didn't have 24 good things back then I did not do an advent calendar. Today I have a little more material and could probably stretch it to 24 parts but then why wait since I've already broken my tradition of advent calendars... Instead I'll give you the material spread out over the next few months.
But even before we start looking at some good CCR examples there are a few non-code things I've learned while working with CCR:
- Being familiar with Erlang and Prolog seems to aid in learning to write programs using CCR.
- There is no guaranteed ordering of handlers. While receivers on the same port are typically used in the order they were registered you should not rely on this fact in your code. Some receivers deviate from this behaviour.
- If there is a listener waiting for a message on a port, the message will never be stored in the port. Instead the handler is immediately scheduled for execution without the message ever be stored in the port.
- The PortSet type is just a convenient collection for a number or ports. There is no ordering of handlers or anything special with a PortSet. It's only a useful way of passing more than one port around.
More on why these things matter in future posts that also include code.