|
|
|
|
|
by bsaul
1039 days ago
|
|
There's a middleground that many developers have trouble finding : You can design your code so that it'll be easier to evolve into the most likely path. However, you don't actually implement the future cases. Example: it doesn't take a lot more effort to create a configuration struct instead of hardcoding a value. However, you don't want to implement handling of any other values that the one you planned on using. You can easily throw a "value not supported" error if the configuration has anything else. However, this will greatly help any newcomer on the codebase to understand what possibilities your component potentially offers and how it can evolve. |
|