Zero One Infinity
   HOME

TheInfoList



OR:

The Zero one infinity (ZOI) rule is a rule of thumb in software design 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. 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 systems' 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 – 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 Data storage is the recording (storing) of information (data) in a storage medium. Handwriting, phonographic recording, magnetic tape, and optical discs are all examples of storage media. Biological molecules such as RNA and DNA are consi ...
and how well the computer's
operating system An operating system (OS) is system software that manages computer hardware, software resources, and provides common services for computer programs. Time-sharing operating systems schedule tasks for efficient use of the system and may also i ...
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 ...
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