3 ms·
> As is typical when you remove duplication, you notice more duplication, because stuff is closer together: the two parameters are almost identical, except for
by saagarjha 8y ago
> As is typical when you remove duplication, you notice more duplication, because stuff is closer together: the two parameters are almost identical, except for capitalisation. This doesn't have to be the case, but it is a good convention to have. Alas, the pre-processor can’t change the capitalisation of strings so we are stuck.
If you're at the point where you're using the processor, a bit of runtime trickery might be useful as well; specifically, NSSelectorFromString([CFSTR(commonName ":") lowercaseString]). You get an extra method call at runtime, but honestly, what's an extra couple nanoseconds?
- _asummers 8y agoLosing tbe ability to grep for usage, for one. And creating another abstraction simply to save typing. I’ve done similar things in thr past and have regretted it every single time. Just be explicit, it will be okay.
- saagarjha 8y ago> Losing tbe ability to grep for usage, for one. Grep for what? You should still see the outer macro; this just saves you from typing essentially the same parameter twice.