3 ms·
it seems like your argument boils down to "I prefer a for loop because I'm more familiar with it". if that's true of you and most of the people you work with, t
by leetcrew 5y ago
it seems like your argument boils down to "I prefer a for loop because I'm more familiar with it". if that's true of you and most of the people you work with, that's certainly a valid argument. the opposite happens to be true on my team. we understand and prefer the functions from the algorithms header in most cases.
one argument in favor of functions like any_of is that, once you get familiar with them, they provide additional documentation of intent. I'll concede this is a pretty minor benefit; most uses of any_of replace a pretty simple loop.
- quietbritishjim 5y ago> it seems like your argument boils down to "I prefer a for loop because I'm more familiar with it". I don't think that's it. A lot of code ends up being calls to functions, and so other types of syntax add a bit of texture. Replacing those with function calls too reduces the code to a smooth paste. It's a bit like if the standard library had a lessThanThree(x) function; it doesn't matter how totally familiar I was with it, I'd still prefer to see x<3.