2 ms·
> > Get out the chainsaw and rip out everything that’s not absolutely required to provide the features your company/open source project is advertising and selli
by lelanthran 3y ago
> > Get out the chainsaw and rip out everything that’s not absolutely required to provide the features your company/open source project is advertising and selling
> Except every legacy C++ codebase I've worked on is decades old. Just enumerating the different "features" is a fool's errand. Because of reshuffling and process changes, even marketing doesn't have a complete list of our "features".
Yeah, this struck me also, and your post should be modded up more. Anyone with significant experience in development knows what "Legacy" means.
Regardless of the language, after a specific point in a product's lifetime you cannot "know" all the features. Just not possible, no matter how well you think you documented it.
In an old product, every single line of code is there because of a reason that is not in the docs. Some examples that I've seen:
1. Using `int8_t` because at some point we integrated a precompiled library that was compiled with signed char, and we want warnings to pop up when we mix signs.
2. Wrote our own stripped-down SSL library because OpenSSL was not EMV certified at the time and did not come with the devkit. Now callers depend on a feature in our own library.
3. Client calls our DLL with Windows-specific UTF-16 strings. That's why that function has three variants that take 3 different types of strings.
4. This library can't be compiled with any gcc/glibc newer than X.Y, because the compiled library is loaded with `dlopen` in some environments.
5. We have our own 'safe' versions of string functions, because MSVC which takes the same parameter types for those functions assigns different meanings to the `size` parameter.
6. Converting fixed-precision floats to an int, performing the additions, and then converting the last division is faster and more accurate, but the test suite at the client expects the cumulative floating point errors and the test will fail.
Not to mention uncountable "marketing said this is not offered as a feature, but client depends on it" things.