Types Are Not Side Flags

Context: Contrarian view to TypesAreSideFlags


Types are not side flags.

In Layman's terms, one may use the word "flag" or "tag" to describe marking off something. For example in HTML we may add a bold flag to mark certain text as bold.

Flags or side flags are not a known or accepted theory in programming. Programmers know of variables, types, values, operators - but none know of "flags" in program theory.

Marking off something does not define what a type is, it just marks off something.

The word "apple" is a label for a fruit, and one could hold up a flag saying "this is an apple". Let's call it the apple flag. The apple flag is just a marker, it isn't a type or a type system. Types are not flags since just marking something or flagging something does not make a type, or a describe what a type is.

Understanding what a "type" is should never be oversimplified into wording such as "types are side flags". Types are not side flags, just as car models are not "flags" either.

Furthermore, implementing a usable type system would require more than just marking things off with flags. If it was that simple, compilers with rich type systems would be as trivial as adding "flags" to things. If developing a compiler, a programmer wouldn't know what a "flag" was or how to use the flag anyway, since flag is an unknown term in programming. this is because the flag theory isn't a theory, and isn't a model - it's some kind of cute metaphor like "types are baskets", even though types are not baskets. Baskets, flags, pylons, or similar words don't help people implement type systems because they are literally unknown meaningless terms to programmers.

Without a clear definition of types, we have nothing to compare it to. Also, the existing term "type tag" was not invented by me. I avoided "tag" to avoid to confusion with markup tags. Perhaps it was a bad choice, but that's another topic. And adding flags/tags may be trivial, but having the compiler/interpreter using them well is another thing. And a "rich type system" perhaps can be built with flags/tags, but first let's define "types". And the issue is not about "understanding" types, but rather defining them in a clear, unambiguous way. --top


EditText of this page (last edited February 3, 2012) or FindPage with title or text search