What Does Softcoding Mean?

Softcoding is the programming practice of obtaining values from external sources, such as preprocessor macros, external constants, databases, command line arguments and user input. The term is the opposite of “hardcoding,” or putting values directly in the source code, unable to be changed by users. Softcoding is considered more flexible.


Techopedia Explains Softcoding

In programming, hardcoding, or directly embedding configuration data in source code, is considered bad practice because it makes software difficult to configure. It is considered better practice to obtain values from external sources, such as configuration files or command line arguments. This is called “softcoding.”

The obvious advantage of softcoding is that it is much easier to change parameters with user input than it is by going into the source code. At the same time, it is possible for developers to go overboard, abstracting too many elements so that the software becomes more difficult to maintain, negating the goal of softcoding. Other times, they might create poorly designed scripting languages.

It is better for developers to examine the needs of individual software projects. With a small in-house tool or open-source program, developers can assume that people will have access to source code and can make changes, meaning that the program can be less configurable. A proprietary program would need to be more configurable, since users are not able to change the source code.


Related Terms

Latest Privacy and Compliance Terms

Related Reading

Margaret Rouse

Margaret Rouse is an award-winning technical writer and teacher known for her ability to explain complex technical subjects to a non-technical, business audience. Over the past twenty years her explanations have appeared on TechTarget websites and she's been cited as an authority in articles by the New York Times, Time Magazine, USA Today, ZDNet, PC Magazine and Discovery Magazine.Margaret's idea of a fun day is helping IT and business professionals learn to speak each other’s highly specialized languages. If you have a suggestion for a new definition or how to improve a technical explanation, please email Margaret or contact her…