4 ms·
Am I the only person who sometimes makes an exception for "two" ?
by Kim_Bruning 4y ago
Am I the only person who sometimes makes an exception for "two" ?
- jerf 4y agoNo. But I have the decency to feel bad and leave an apologetic comment.
- adhesive_wombat 4y agoA ping-pong buffer certainly seems like generalising to a ping-pong-pang-peng-pung-p(infinity)ng buffer would be overkill.
- hprotagonist 4y agoi fairly regularly want pairwise, yep.
- grensley 4y agoTwo is quite relevant for relationships
- ChickeNES 4y agoWell, if you ignore polyamory and polygamy...
- layer8 4y agoYou can have n-ary relationships. Relational databases are built on that.
- grensley 4y agoWhat are the columns in a relational table like that?
- layer8 4y agoNot sure what you mean. A table with N columns corresponds to an N-ary relation. The rows contained in the table are the tuples contained in the relation. Table = relation. That's why it's called a relational database. See also this example in Wikipedia of a ternary relation: https://en.wikipedia.org/wiki/Finitary_relation#Example https://en.wikipedia.org/wiki/Finitary_relation#Example Another example: If you have a table (SSN, Name, DateOfBirth), then that corresponds to the relation "person with SSN x has name y and date of birth z". In that case it's a relation between SSNs, names, and dates.
- grensley 4y agoVery fair, thanks for the example.
- ChainOfFools 4y agoI seem to recall that there are certain languages (human languages) that have cases specifically for talking about pairs of objects, situated semantically between singular and plural. I think one of these is an archaic form of Greek, maybe ancient or Hellenistic.
- tough 4y agoAsked ChatGPT Yes, you are correct! Ancient Greek has a dual number, which is used specifically for referring to two people or two objects. The dual is a distinct grammatical number, separate from singular and plural. In the ancient Greek language, nouns, pronouns, adjectives, and verbs all have different forms for singular, dual, and plural numbers. The dual number is used when referring to two things or two people, while the singular number is used for one thing or one person, and the plural number is used for three or more things or people. The dual number is no longer used in modern Greek, but it was an important feature of the ancient Greek language, which had a rich and complex system of inflectional morphology. Other languages that have a dual number include Old English, Old Norse, Lithuanian, and Slovenian, among others.
- guavaNinja 4y agoIn Arabic there is the mothanna مثنى (pair) case.
- playingalong 4y agoIt has always "bothered" me that AWS allowed for up to two API keys per IAM user.
- jdreaver 4y agoThat's probably so you can rotate your keys without downtime.
- alex_sf 4y agoThe argument against two would be: if you can do two, why can you not do three?
- GauntletWizard 4y agoWherever I need "Two" I usually find that what I actually need is a one and a many; there's not a master and a replica, there's one master and many replicas. There's not two places that the data is when doing a raid restripe, there's many places the data probably is and one place it should be.
- mmphosis 4y agoHow about a sign bit? https://en.wikipedia.org/wiki/Unum_(number_format) https://en.wikipedia.org/wiki/Unum_(number_format)
- teo_zero 4y agoI'd say that 2 is indeed quite common in Computer science. In graphs, for example, each edge has 2 ends. In an abstract syntax tree, a binary operator has 2 children. All raster images are based on 2 dimensions. A "for each" loop often involves 2 variables: the iterator object and an index. In all such cases it makes sense that a language/ construct/library special-cases 2 elements without generalizing for an arbitrary number of elements. By the way, 3 is much less common, except in some specific domains, like 3D vectors, UNIX permissions (user, group, other), etc.
- Kim_Bruning 4y agoOh, you're right, there are a few other exceptions for other numbers too!
- xigoi 4y agoUsually you wouldn't store these things in a collection, but as separate fields of a record type, so the rule doesn't apply.
- teo_zero 4y agoThe principle applies to all kinds of structures. For example a common way to implement a generic tree that respects this rule is to model each node with exactly one parent and any number of children. My statement instead is that you may have legitimate reasons to want exactly one parent and from zero to two children, but not more.