A simple example would be a PRNG. Specialized version:
int dice_roll = random(1,6);
Generic version (this is from C++'s standard lib): std::default_random_engine generator;
std::uniform_int_distribution<int> distribution(1,6);
int dice_roll = distribution(generator);
The specialized version does not cover non-uniform distributions, nor the use case where you need multiple PRNGs with independent states.. and is much simpler and more straight-forward because of that.Often generic solutions are the best trade-off in the end, but one should not assume that more generic is automatically better.
I think the reliance of modern programmers on libraries which offer highly generic (and thus almost inevitably sub-optimal) solutions is one of the primary reasons for software boat.