[docs and wiki] How many data-types do we emphasize?
- Posted by _tom (admin) Jan 29, 2021
- 1273 views
- How many data-types do we want to emphasize?
- What is the best graphic to illustrate?
one
object does everything
kind of like those languages that do not declare the data-type of a variable
(Fancy graphics can come later.)
┌ object ┠└────────┘
two
I like the concept of two distinct data-types
atom|integer|(number) == one number
sequence|(string) == a list of values
Ultimately, a lot of design choices in programming come down to choosing between two fundamental choices.
┌───── object───────┠| number | sequence | └───────────────────┘ object ---------------- | | number sequence object /\ / \ number sequence
three
Classic object|atom|sequence
just to realize that the object data-type comes in handy
five
object|number|integer|sequence|string
Phix has five.
┌───── object───────┠│ number │ sequence │ │ │ │ │ │ │ integer│ string │ └───────────────────┘ object ---------------- | | number sequence | | integer string object /\ / \ number sequence | | integer string
Go has many
- 4 categories
- 8 kinds of integer
- 4 kinds of float
- 5 misc numeric types
- 9 derived types
be well
_tom