Understanding xref's "source" and "sink" terms

It drives me nuts when I don’t fully understand terminology. I’ve been using mix xref graph --sink some/file/that/causes_lots_of_recompilations.ex for a few years at this point and while I know what I get from it, I’ve never being able to explain out loud what --sink does. I know it’s the opposite of source and I believe they are electrical engineering terms—is this correct? And a “sink” is literally like a kitchen or bathroom sink, so everything in the sink shares a common source? Am I on the right track here?

Thanks!

The terminology comes from talking about graphs:

In a Directed acyclic graph, a source node is a node (also known as a vertex) with no incoming connections from other nodes, while a sink node is a node without outgoing connections.

https://en.wikipedia.org/wiki/Sink_(computing)

2 Likes

Ha! I’m always telling people with these problems they need to re-design their module hierarchy as a DAG. I clearly have not done enough studying of DAGs myself. Thank you!