I’m trying to understand clearly the difference between a source and a sink, and I’m getting confused by something in the documentation.
Under the Graph component, there is a sink and a source listed called “number.” Both examples are the exact same code. So is it a source or a sink? According to my understanding, “number” sets a variable in the calculator, so it should be a sink, right? So why is it also called a source?
I think I answered my own question. I think this is a case of poor documentation. Number can indeed be both a source and sink for a graph. However, the example chosen for this in the documentation for a source is not actually a use of a graph number source, it’s an example of a sink.
Can anyone confirm this as correct?
My underlying issue is trying to map the programming paradigm of Computation Layer onto something I know and understand. The best model I have so far is object orientation, with sources being like “get” methods and sinks being like “set” methods. I’d be interested in hearing how others (or even better, the language designers) think of it.
If it’s any help, i’ve never understood this either.
The documentation needs a re-write from the bottom up imo. Either the layer is faulty or, more likely, the documentation is.
Doesn’t stop me from using it, but it does stop me from exposing it all that widely to my colleagues as there appear to be incongruous relationships I can’t adequately explain.
I think you’re right that the documentation is wrong, and your definitions are accurate. So, the number sink looks fine, but the source example should be something more like:
We have an incorrectly linked sample there, we’ll get it fixed up right away.