On Jul 31, 2017, at 12:12 PM, mbsoftwaresolutions@mbsoftwaresolutions.com wrote:
So a static set of data, then? Like USPS zip codes?
Well, not exactly. It could be anything that only makes sense as a complete set. Like parameters to a function, or small data collections. Assume that in your app you pass around simple user information, and this information contains username, role, and an expiration date. So a logged-in user would be represented internally as a 3-tuple of (username, role, expires). You could receive user tuples from another part of the system, and know that there will be those 3 elements in that order. That’s a pretty weak example, but it would show the difference between a tuple and a list/array: it wouldn’t make sense to have something like:
user_info.append(“green”)
to add an additional element, because we’ve defined a user as those 3 values. Likewise, deleting an item wouldn’t make sense, because now you would not have the information that your app would need.
-- Ed Leafe