3 ms·
Very loosely related, but I really dislike the excepted design pattern for that cases where functions names are something like AssertThatOnePlusOneIsReturnAlway
by pluijzer 3y ago
Very loosely related, but I really dislike the excepted design pattern for that cases where functions names are something like AssertThatOnePlusOneIsReturnAlwaysTwoAndNeverFive. It looks ridiculous, smells like a hack, and I cannot think of any reason why giving a description of the test couldn't be handled by the testing framework in a more graceful way.
- prepend 3y agoMe too, I prefer function names like “assert_that_one_plus_one_is_return_always_two_and_never_five.” All kidding aside, but I gave up on this argument because I think people either get it or don’t and aside from trying a little conversation or something with guidance it’s a “can’t fix stupid” situation. People usually want to explain why it’s so important and that’s worse than suffering their long function name. I think it’s better to just accept ridiculous than to try to get consensus on what’s ridiculous and a spiral of wasted time. The upside is that it doesn’t matter any more since long function names are supported and work. And autocomplete means it’s just as easy to use as “ATOPOIRA” or whatever madness they would name it with some restrictions.