Hardcoding is the practice of writing source code that must be rewritten in order to change its logic. In other words, hardcoded logic isn't configurable. Hardcoding is appropriate when it is reasonable to expect that a change would require the work of a programmer.
SoftcodingThe opposite of hardcoding, known as softcoding accepts parameters or looks up values in a configuration file or database that alter the flow of computer logic. A user interface may be provided to allow users to update these values. Softcoding provides limited ability for users to change the functioning of a system without a programmer. It may also be used to improve the general maintainability of code.
TradeoffsWell written code is typically both hardcoded and softcoded. In theory, softcoding is done to improve maintainability of code. However, if taken too far it becomes a mess of complex configuration files and execution code that is wimpy about implementing logic with roundabout approaches that reduce maintainability. Softcoding also has a tendency to shift errors from compile time to run time, making testing more time consuming and expensive.
|Hardcoding Definition||Computer operations that are fully expressed in source code that do not rely on configurations.|
|Softcoding Definition||Computer code that is sufficiently configurable or parameterized to meaningfully change its behavior without rewriting it.|
|Related Concepts||Source Code|
If you enjoyed this page, please consider bookmarking Simplicable.
TrendingThe most popular articles on Simplicable in the past day.
Recent posts or updates on Simplicable.
© 2010-2023 Simplicable. All Rights Reserved. Reproduction of materials found on this site, in any form, without explicit permission is prohibited.
View credits & copyrights or citation information for this page.