5 ms·
> OOP also; I've seen so many crazy class architectures that could just be a handful of plain-old-functions, also, tons of "generic" numerical code with templa
by enriquto 7y ago
> OOP also; I've seen so many crazy class architectures that could just be a handful of plain-old-functions,
also, tons of "generic" numerical code with templates everywhere, where the only two possible instantiations are "float" and "double". Some people do really like to add useless complexity everywhere.
- _pmf_ 7y agoNot only is it needlessly complex, but untested generic code is a minefield of subtle future bugs ... "oh, the function is there and tested, so it should work" ... well, not in this particular combination of the completely unrestricted generic parameter set.
- edflsafoiewq 7y agoWhat's wrong with that? It seems like the easiest way to write code that works with either floats or doubles.
- enriquto 7y ago> It seems like the easiest way to write code that works with either floats or doubles. You never really need to do that. In the rare cases you need to, once every five years or so, it is trivial to change your code.
- fnord123 7y agoEh... I have seen the same in Rust. People write tests with i32. i32 implements the Copy trait which means your can blindly clone it all over the place. When you try using some libraries with String or anything else they don't work.
- deleted 7y ago[deleted]