Convention Over Code
   HOME

TheInfoList



OR:

Convention over Code is a design approach for
programming language A programming language is a system of notation for writing computer programs. Most programming languages are text-based formal languages, but they may also be graphical. They are a kind of computer language. The description of a programming ...
s where the conventional use of a feature is taken into consideration when defining the default semantics of the feature. Similar to
Convention over Configuration Convention over configuration (also known as coding by convention) is a software design paradigm used by software frameworks that attempts to decrease the number of decisions that a developer using the framework is required to make without necessa ...
, if a
keyword Keyword may refer to: Computing * Keyword (Internet search), a word or phrase typically used by bloggers or online content creator to rank a web page on a particular topic * Index term, a term used as a keyword to documents in an information syst ...
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 Java (; id, Jawa, ; jv, ꦗꦮ; su, ) is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea to the north. With a population of 151.6 million people, Java is the world's List ...
and C#. We find the keyword public infused throughout a typical Java code excerpt, and in the case of methods this access modifier 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 computer science and information theory, a Huffman code is a particular type of optimal prefix code that is commonly used for lossless data compression. The process of finding or using such a code proceeds by means of Huffman coding, an algori ...
in language design.


See also

*
Convention over Configuration Convention over configuration (also known as coding by convention) is a software design paradigm used by software frameworks that attempts to decrease the number of decisions that a developer using the framework is required to make without necessa ...
*
Ruby on Rails Ruby on Rails (simplified as Rails) is a server-side web application framework written in Ruby under the MIT License. Rails is a model–view–controller (MVC) framework, providing default structures for a database, a web service, and web p ...
*
Spring Framework The Spring Framework is an application framework and inversion of control container for the Java platform. The framework's core features can be used by any Java application, but there are extensions for building web applications on top of the Java ...


References

{{reflist Object-oriented programming