HOME

TheInfoList



OR:

The Zero one infinity (ZOI) rule is a rule of thumb in
software design Software design is the process by which an agent creates a specification of a software artifact intended to accomplish goals, using a set of primitive components and subject to constraints. Software design may refer to either "all the activity ...
proposed by early
computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithmic processes, and development of both hardware and software. Computing has scientific, ...
pioneer
Willem van der Poel Willem Louis van der Poel (2 December 1926, The Hague) is a pioneering Dutch computer scientist, who is known for designing one of the first computers to be designed in the Netherlands, the ''Zeer Eenvoudige Binaire Reken Automaat'' (ZEBRA), tra ...
. It argues that arbitrary limits on the number of instances of a particular type of data or structure should not be allowed. Instead, an entity should either be forbidden entirely, only one should be allowed, or any number of them should be allowed. Although various factors outside that particular
software Software is a set of computer programs and associated software documentation, documentation and data (computing), data. This is in contrast to Computer hardware, hardware, from which the system is built and which actually performs the work. ...
could limit this number in practice, it should not be the software itself that puts a hard limit on the number of instances of the entity. Examples of this rule may be found in the structure of many
file system In computing, file system or filesystem (often abbreviated to fs) is a method and data structure that the operating system uses to control how data is stored and retrieved. Without a file system, data placed in a storage medium would be one lar ...
s' directories (also known as folders): * 0 – The topmost directory has zero parent directories; that is, there is no directory that contains the topmost directory. * 1 – Each subdirectory has exactly one parent directory (not including shortcuts to the directory's location; while such files may have similar icons to the icons of the destination directories, they are not directories at all). *
Infinity Infinity is that which is boundless, endless, or larger than any natural number. It is often denoted by the infinity symbol . Since the time of the ancient Greeks, the philosophical nature of infinity was the subject of many discussions am ...
– Each directory, whether the topmost directory or any of its subdirectories, according to the file system's rules, may contain any number of files or subdirectories. Practical limits to this number are caused by other factors, such as space available on storage media and how well the computer's
operating system An operating system (OS) is system software that manages computer hardware, software resources, and provides common daemon (computing), services for computer programs. Time-sharing operating systems scheduler (computing), schedule tasks for ef ...
is maintained. In real-world software design, violations of this rule of thumb are common. For example, the
FAT16 File Allocation Table (FAT) is a file system developed for personal computers. Originally developed in 1977 for use on floppy disks, it was adapted for use on hard disks and other devices. It is often supported for compatibility reasons by c ...
file system imposes a limit of 65,536 files to a directory.


Authorship

Van der Poel confirmed that he was the originator of the rule, but Bruce MacLennan has also claimed authorship (in the form "The only reasonable numbers are zero, one and infinity."), writing in 2015 that:


References


See also

* Magic number (programming)#Unnamed numerical constants {{Design Software engineering folklore Programming principles