Opentopia Directory Encyclopedia Tools

Default (computer science)

Encyclopedia : D : DE : DEF : Default (computer science)



 

For other uses of the word, see the default disambiguation page.
A default, in computer science, refers to a setting or value automatically assigned to a computer program or device, outside of user intervention. Such settings are also called presets, especially for electronic devices.

Examples

Computer input panel

One use of default parameters is for initial settings on input panels. For example, the first time a user runs a program it may suggest that the user's delivery address is in the United States. This default might be appropriate if more users of that program 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 program 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.

TV 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.

When to use computer program defaults

Using defaults involves two goals which sometimes conflict:

In cases where there is no clear majority and the results can't easily be verified by other available information, such as the gender of the individual, no default should be offered. Note, however, that some software packages require that default values be supplied.

Computer language defaults

Most languages in the C-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, the INIT parameter on a declaration defines an initial default value for that variable.

 


From Wikipedia, the Free Encyclopedia. Original article here. Support Wikipedia by contributing or donating.
All text is available under the terms of the GNU Free Documentation License See Wikipedia Copyrights for details.


Search Titles
0123456789
ABCDEFGHIJ
KLMNOPQRST
UVWXYZ?

E-mail this article to:

Personal Message: