2 ms·
It really depends. If you repeat this a lot, you might have a domain concept. If you can come up with a name that makes sense for your domain then you should
by sbov 7y ago
It really depends.
If you repeat this a lot, you might have a domain concept. If you can come up with a name that makes sense for your domain then you should probably take that domain concept and realize it within your code in the form of some kind of abstraction - e.g. a function call. Even if it is as simple as a .startswith call.
If you can't come up with a name, kinda depends upon how prevalent it is. If you just do it a handful of times, no big deal.