User:Average/Communicate and coordinate

From HackerspaceWiki
Jump to: navigation, search

There are two main idioms to communicate between your different conceptual units: MessagePassing or VariableStorage. VariableStorage is preferred up to the point that you are constrained by your language mechanisms (like within a function definition). Otherwise, global variables are sometimes used to communicate between conceptual units (i.e. different functions). MessagePassing is generally how you send data in and out of your machine (collecting or sending characters/bytes in and out). Unix, for example, uses it with the pipe (|) symbol. A language like Assembly doesn't have lexical structure, so variable storage is about all you use within a program. Otherwise, MessagePassing is suggested as more modular and scalable.

By way of definition: Vertical data structures go towards greater meaning (like a Person being composed of name, department, eat function, etc.), horizontal data structures are more like collection data types, holding meaningful bits of even the slightest bit of vertical data (like a numerical quantity).