Default (computer science)
Encyclopedia
A default, in computer science
, refers to a setting or value
automatic
ally assigned to a software application, computer program
or device, outside of user intervention. Such settings are also called presets, especially for electronic devices. The Oxford English Dictionary
dates this usage to the mid-1960s, as a variant of the older meaning of "failure in performance".
Default values are generally intended to make a device (or control) usable "out of the box
". A common setting, or at least a usable setting, is typically assigned.
. For example, the first time a user runs an application it may suggest that the user's delivery address is in the United States. This default might be appropriate if more users of that application were in the US than any other country. If the user selected a new country, that would override the default, and perhaps become the default for the next time the application is used on that computer or by that user. Changing the default for the next run would involve storing user info somewhere, such as in cookies
on the user's computer for an Internet application.
In cases where there is no clear majority and the results cannot easily be verified by other available information, such as the gender of the individual, no default should be offered. Note, however, that some software applications require that default values be supplied.
family (but not C itself, as of ISO-C99) allow a function to have default parameters, that are used if the function is called with omitted parameter specifications.
In C and languages based on its syntax, the
In Fortran
, the INIT parameter on a declaration defines an initial default value for that variable.
, the default was usually the first floppy drive (DRIVE A:); on later versions that supported hard disk drives, the option was changed to the hard disk (DRIVE C:).
These new versions of DOS had unexpected consequences; occasionally a user would learn the hard way that the command:
formatted the hard disk (DRIVE C:) by default. This could be disconcerting to a user who has just inserted a floppy disk, listed its directory (DIR), and been informed that no directory existed. The default had been the first floppy drive in earlier versions of MS-DOS, but the designers of MS-DOS had found it convenient to change the default to the most-used drive when hard disk drives were supported. For the developers, deleting the operating system would not have been a major problem, because they could easily replace it, but for a customer, losing the operating system—and several months' work—could be catastrophic.
Computer science
Computer science or computing science is the study of the theoretical foundations of information and computation and of practical techniques for their implementation and application in computer systems...
, refers to a setting or value
Value (computer science)
In computer science, a value is an expression which cannot be evaluated any further . The members of a type are the values of that type. For example, the expression "1 + 2" is not a value as it can be reduced to the expression "3"...
automatic
Automatic
- Technology :* Automatic transmission, or a car with an automatic transmission* Automatic firearm* Automatic watch* Automatic , a defunct American automobile company- Albums :* Automatic * Automatic...
ally assigned to a software application, computer program
Computer program
A computer program is a sequence of instructions written to perform a specified task with a computer. A computer requires programs to function, typically executing the program's instructions in a central processor. The program has an executable form that the computer can use directly to execute...
or device, outside of user intervention. Such settings are also called presets, especially for electronic devices. The Oxford English Dictionary
Oxford English Dictionary
The Oxford English Dictionary , published by the Oxford University Press, is the self-styled premier dictionary of the English language. Two fully bound print editions of the OED have been published under its current name, in 1928 and 1989. The first edition was published in twelve volumes , and...
dates this usage to the mid-1960s, as a variant of the older meaning of "failure in performance".
Default values are generally intended to make a device (or control) usable "out of the box
Out of the box
Out of the box is the term used to denote items, functionalities, or features that do not require any additional installation. In addition to being used for tangible products, the phrase is often used in a less literal sense for software, which may not be distributed in an actual box but offer...
". A common setting, or at least a usable setting, is typically assigned.
Application software preferences
One use of default parameters is for initial settings for application softwareApplication software
Application software, also known as an application or an "app", is computer software designed to help the user to perform specific tasks. Examples include enterprise software, accounting software, office suites, graphics software and media players. Many application programs deal principally with...
. For example, the first time a user runs an application it may suggest that the user's delivery address is in the United States. This default might be appropriate if more users of that application were in the US than any other country. If the user selected a new country, that would override the default, and perhaps become the default for the next time the application is used on that computer or by that user. Changing the default for the next run would involve storing user info somewhere, such as in cookies
HTTP cookie
A cookie, also known as an HTTP cookie, web cookie, or browser cookie, is used for an origin website to send state information to a user's browser and for the browser to return the state information to the origin site...
on the user's computer for an Internet application.
Television or computer monitor
A TV or computer monitor typically comes with a button to "restore factory presets". This allows the defaults for brightness, contrast, color, etc., to be returned to the settings recommended by the manufacturer. This button may be used when the settings get badly misadjusted (say by a toddler playing with the controls). Some "fine-tuning" of the settings may still be needed from the factory settings, but they are likely closer to the desired settings than the current random settings.In application software
Using defaults involves two goals which sometimes conflict:- Minimal user interaction should be required. Setting defaults to the most commonly selected options serves this purpose.
- Panel entry errors should be minimized. Using defaults will tend to increase errors, as users may leave incorrect default settings selected. In cases where the value can be verified, this is not a severe problem. For example, the delivery country can be checked against the street address or postal codes and any mismatch can generate an error panel displayed to the user, who will then presumably make the correction.
In cases where there is no clear majority and the results cannot easily be verified by other available information, such as the gender of the individual, no default should be offered. Note, however, that some software applications require that default values be supplied.
In computer languages
Most languages in the CC (programming language)
C is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system....
family (but not C itself, as of ISO-C99) allow a function to have default parameters, that are used if the function is called with omitted parameter specifications.
In C and languages based on its syntax, the
switch
statement (which dispatches among a number of alternatives) can make use of the default
keyword to provide a case for when no other case matches.In Fortran
Fortran
Fortran is a general-purpose, procedural, imperative programming language that is especially suited to numeric computation and scientific computing...
, the INIT parameter on a declaration defines an initial default value for that variable.
In operating systems
Early operating systems used a command line interface in which the user typed short commands, often followed by various parameters and options. For operations on disks, one commonly specified the disk name or drive number (or letter). On early versions of MS-DOSMS-DOS
MS-DOS is an operating system for x86-based personal computers. It was the most commonly used member of the DOS family of operating systems, and was the main operating system for IBM PC compatible personal computers during the 1980s to the mid 1990s, until it was gradually superseded by operating...
, the default was usually the first floppy drive (DRIVE A:); on later versions that supported hard disk drives, the option was changed to the hard disk (DRIVE C:).
These new versions of DOS had unexpected consequences; occasionally a user would learn the hard way that the command:
FORMAT [no options]
formatted the hard disk (DRIVE C:) by default. This could be disconcerting to a user who has just inserted a floppy disk, listed its directory (DIR), and been informed that no directory existed. The default had been the first floppy drive in earlier versions of MS-DOS, but the designers of MS-DOS had found it convenient to change the default to the most-used drive when hard disk drives were supported. For the developers, deleting the operating system would not have been a major problem, because they could easily replace it, but for a customer, losing the operating system—and several months' work—could be catastrophic.