Marco Bravo

Logo

Marco Bravo's DEV Profile If you don’t know, ask – if you know, share! ~ opensource mindset Baseball ball image


➠ "We may not have control over our circumstances, but we do have control over our minds"
➠ What do I want to do next?
Cloud and rainbow image

View My GitHub Profile

16 February 2020

Three Types of Data

by Marco Bravo

Programming image

Three different categories of data in software:

By “data” I generally mean “variables in code”, but the same principles could be applied to files on a disk, or tables in a database, or whatever else.

These three categories are disjoint: that is, if a piece of data falls into one of them, it should not also be treated like one of the others. Different languages will vary in their ability to express this constraint via the type system or otherwise, so it’s better to think of it as a convention or a frame of mind (though if you can actually enforce it, that is of course all the better).

A Constant, in this context, is information that doesn’t change during the course of running the program.

State is information that naturally changes during the course of running the program.

Cached values are information that is derived directly from Constants and/or State.

To summarize:

Full article

tags: programming - developer - data - types