Softcoding

Why Trust Techopedia

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

Margaret Rouse
Technology Expert
Margaret Rouse
Technology Expert

Margaret 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 IT definitions have been published by Que in an encyclopedia of technology terms and cited in articles by the New York Times, Time Magazine, USA Today, ZDNet, PC Magazine, and Discovery Magazine. She joined Techopedia in 2011. Margaret's idea of a fun day is helping IT and business professionals learn to speak each other’s highly specialized languages.

Advertisements