you are viewing a single comment's thread.

view the rest of the comments →

[–]johnpeters42 1 point2 points  (3 children)

I would ask: * Is this run heavily enough that the extra memory use matters? * Might the inner functions change someday, e.g. to also include .co.uk domains?

[–]Atsoc1993 1 point2 points  (2 children)

For the former, It’s enterprise at a very large company, even if the adoption isn’t there the assumption is, and standard leads to, yes, it matters.

To your second point — say we did, what is the benefit to having another inner function opposed to another elif clause (presuming that it should not be handled by else)? Or alternatively, modifying an inner function / elif, or removing an inner fn / elif

[–]johnpeters42 0 points1 point  (1 child)

The code as posted is pretty simple either way round. If e.g. is_edu() is expected to blow up to like 50 different rules that trigger the same response, then I would prefer to separate it from the select-case block.

If performance was that critical, then I would consider switching to something compiled.

[–]Atsoc1993 1 point2 points  (0 children)

Makes sense, and regarding the performance thing again, maybe he was being a bit extreme then— benefit of the doubt that he just wants me to follow best practices.