|
|
|
|
|
by gcassie
1449 days ago
|
|
That's fair. But maybe someone wants to reuse this in another place so they do this: ```
def make_string_filename(s, style="new"):
# 2 lines of shared magic
if style == "old"
# 2 lines of original magic
elif style == "new":
# different 2 lines of magic
``` When you get here, two totally separate `make_string_filenames()`, each private to the area of code they're relevant to, would be better. |
|
- make_string_filename_style1
- make_string_filename_style2
- make_string_filename
Then make_string_filename consists of logic to use the right style.
Or one function and a Sum type to be called like:
Given sum type: