|
|
|
|
|
by kccqzy
546 days ago
|
|
That's not an anti-feature because of cleverness. It's a failure of engineering. Just like everything else, clever code needs to be encapsulated behind a good interface, be well documented, be well tested. > if you randomly come across it most developers won't be able to easily understand how it works So document it. > uses undefined behavior So fix the undefined behavior. Use memcpy or bit_cast. > gives a suboptimal result That's probably intentionally sacrificing accuracy for speed. Document it. > doesn't have any meaningful comments Then add it. Clever algorithms is never the problem by itself. It's undocumented unencapsulated clever algorithms with unknown bugs. |
|