We are independent & ad-supported. We may earn a commission for purchases made through our links.
Advertiser Disclosure
Our website is an independent, advertising-supported platform. We provide our content free of charge to our readers, and to keep it that way, we rely on revenue generated through advertisements and affiliate partnerships. This means that when you click on certain links on our site and make a purchase, we may earn a commission. Learn more.
How We Make Money
We sustain our operations through affiliate commissions and advertising. If you click on an affiliate link and make a purchase, we may receive a commission from the merchant at no additional cost to you. We also display advertisements on our website, which help generate revenue to support our work and keep our content free for readers. Our editorial team operates independently of our advertising and affiliate partnerships to ensure that our content remains unbiased and focused on providing you with the best information and recommendations based on thorough research and honest evaluations. To remain transparent, we’ve provided a list of our current affiliate partners here.
Software

Our Promise to you

Founded in 2002, our company has been a trusted resource for readers seeking informative and engaging content. Our dedication to quality remains unwavering—and will never change. We follow a strict editorial policy, ensuring that our content is authored by highly qualified professionals and edited by subject matter experts. This guarantees that everything we publish is objective, accurate, and trustworthy.

Over the years, we've refined our approach to cover a wide range of topics, providing readers with reliable and practical advice to enhance their knowledge and skills. That's why millions of readers turn to us each year. Join us in celebrating the joy of learning, guided by standards you can trust.

What Is Convention over Configuration?

By Alex Newth
Updated: May 16, 2024
Views: 6,600
Share

Convention over configuration is a computer programming philosophy that usually makes it easier for programmers to design tables and elements based on a class name. When convention over configuration is used, only elements that go against the base class name must be written into the coding. Less coding is needed overall with this philosophy, and there generally are fewer spelling-based mistakes. Another advantage is that the configuration file that stores all the class names generally is smaller, which increases the coding’s speed and stability.

In the philosophy of convention over configuration, there may be one or several main classes used in the program, with sub-elements below it. For example, a program meant for tallying inventory may have a class named “Inventory.” Under this class, there may be tables and elements that have the same name but are distinct because of their function. This distinction means the programmer normally does not have to come up with unique or different names for each element, which can take time and can be difficult when there are many similar elements.

While using the same class name for every element is paramount in convention over configuration, there are times when the programmer will want or need an element to have a different name. This can be used to further distinguish the element or for a variety of other reasons. In this philosophy, only elements that are not named after the main class must be written into the programming; everything else is assumed to be named after the main class.

In terms of coding, convention over configuration often means less programming will be needed overall, because names do not need to be coded in. There also tends to be fewer problems with spelling mistakes, such as incorrectly naming an element, because fewer names are needed overall. Both of these make it easier for the programmer to create the software.

Functionality also is improved with convention over configuration because of a smaller configuration file footprint. Whenever a class or element name is placed in the programming, it also is stored in the configuration file so it can connect all the elements. A large configuration file often leads to a sluggish and volatile program, because there are many elements that need to be accounted for. If the file is small, then there is less to worry about and the software usually is better overall.

Share
EasyTechJunkie is dedicated to providing accurate and trustworthy information. We carefully select reputable sources and employ a rigorous fact-checking process to maintain the highest standards. To learn more about our commitment to accuracy, read our editorial process.
Discussion Comments
Share
https://www.easytechjunkie.com/what-is-convention-over-configuration.htm
Copy this link
EasyTechJunkie, in your inbox

Our latest articles, guides, and more, delivered daily.

EasyTechJunkie, in your inbox

Our latest articles, guides, and more, delivered daily.