3 ms·
> In this case you probably shouldn't pull it out into it's own thing because it's so specific (and weird) that you'll want it nearby it's use case (and not ava
by dolni 4y ago
> In this case you probably shouldn't pull it out into it's own thing because it's so specific (and weird) that you'll want it nearby it's use case (and not available for developers to accidentally use for the non Shakespeare uses).
I guess it depends on how much this weird Shakespearean to_lower is used around the codebase.
If there is one spot where it's used, I would probably factor out to_lower and add a special case check for "bob" in the business logic code (outside the scope of to_lower).
If the Shakespearean to_lower gets used in various places it actually might make sense to be factored into its own function.
- Verdex 4y ago* yeah this is convoluted. There are better ways to factor such a function. However the point is that something can be 'pure' but still not a good candidate to be pulled out of context.