Convention over Code

Convention over Code

Convention over Code is a design approach for programming languages where the conventional use of a feature is taken into consideration when defining the default semantics of the feature. Similar to Convention over Configuration, if a keyword can be implied by its absence due to convention, it becomes less a part of the idea the coder is expressing and a part of the hidden implementation.

A common, notorious example is found in Java and C#. We find the keyword public infused throughout a typical Java code excerpt, and in the case of methods it implies public scope access. In practice, more methods use public scope access than the other three: private, protected and package protected (which happens to be the actual Java default). While a matter of opinion and much debate by programmers that love to be explicit about everything, it is clear that leaving out scope access keywords altogether takes very little away from the actual expression of an idea in code, because it has nothing to do with the idea at all, it is an attribute of the implementation of an idea.

Convention over Code means we would make public the default for methods, and make better use of keyword huffman-coding in language design.

See also


Wikimedia Foundation. 2010.

Игры ⚽ Нужно решить контрольную?

Look at other dictionaries:

  • Convention over configuration — (also known as coding by convention) is a software design paradigm which seeks to decrease the number of decisions that developers need to make, gaining simplicity, but not necessarily losing flexibility. The phrase essentially means a developer… …   Wikipedia

  • Code Geass — Code Geass: Lelouch of the Rebellion First Code Geass DVD volume released in Japan. コードギアス 反逆のルルーシュ (Kōdo Giasu: Hangyaku no Rurūshu) …   Wikipedia

  • Convention plutôt que configuration — (aussi connu sous le nom de Coder par exception) est une bonne pratique informatique qui tend à faire décroire le nombre de décisions qu un développeur doit prendre, en gagnant sur la simplicité, mais sans forcément perdre sur la flexibilité. L… …   Wikipédia en Français

  • Code Pink — For the hospital emergency code, see Hospital emergency codes. Code Pink: Women for Peace Code Pink activists demonstrate in front of the White House on July 4, 2006. Formation …   Wikipedia

  • Convention on the Rights of the Child — Signed 20 November 1989[1] Location New York[1] Effective 2 September 1990[1] Condition 20 ratifications …   Wikipedia

  • Code of Personal Status (Tunisia) — The Code of Personal Status (CPS) (Arabic: مجلة الأحوال الشخصية‎) is a series of progressive Tunisian laws aiming at the institution of equality between women and men in a number of areas. It was promulgated by beylical decree on August 13, 1956… …   Wikipedia

  • Code Noir — Le Code noir. Le Code noir est un recueil de textes réglant la vie des esclaves noirs dans les îles françaises, en particulier l ordonnance de soixante articles, portant statut civil et pénal, donnée en mars 1685 par Louis XIV. Son premier… …   Wikipédia en Français

  • Code of the U.S. Fighting Force — The Code of the U.S. Fighting Force is a code of conduct that is an ethical guide and a United States Department of Defense directive consisting of six articles to members of the U.S. armed forces addressing how U.S. personnel in combat should… …   Wikipedia

  • Code name — A code name or cryptonym is a word or name used clandestinely to refer to another name or word. Code names are often used for military purposes, or in espionage. They may also be used in industry to protect secret projects and the like from… …   Wikipedia

  • Convention on the Elimination of All Forms of Racial Discrimination — ICERD International Convention on the Elimination of All Forms of Racial Discrimination Signed 7 March 1966[1] Location New York[1] Effective 4 January 1969[1] Co …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”