My point of view is that a node is equivalent to a method or function
in a classical language. Therefore the behaviour of a node should be
entirely determined by the messages passed to it (plus data from any
external interfaces if it interfaces to hardware or some other
external system). This makes it easier to understand the function of
a node. In addition it means the node can be tested in relative
isolation. Using flow or global context means that the behaviour of
a node is determined by other parts of the node-red flows in ways that
are not obvious from looking at the flow. It can make the whole flow
difficult to debug when something is not behaving as expected as an
error in one node or in flow logic can have the side effect of causing
errors in parts of the flow not apparently related to where the bug
actually is. Apologies to anyone who is offended by that long and
rambling sentence, my English teacher would have had a fit over it.
I know many will consider my ideas over-zealous but I really do think
that beginners in particular should be discouraged from dropping into
casual use of flow and context variables, the use of which may often
seem to be the the easiest way to achieve an end. Often it will bite
them in the long run.
Colin
>
https://groups.google.com/d/msgid/node-red/113dbfb0-ee0d-4f6d-9014-4a6b549da51a%40googlegroups.com.