Hardcoding is the practice of writing source code that must be rewritten in order to change its behavior. 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.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 the ability for users to change the functioning of a system without a programmer. This 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.
Computer operations that are fully expressed in source code that do not rely on configurations.
Computer code that is sufficiently configurable or parameterized to meaningfully change its behavior without rewriting it.
If you enjoyed this page, please consider bookmarking 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.