Yup - that's a great idea. Lots of ways to skin the cat here. My example isn't perfect, but one can make the argument that extending a function into multiple smaller functions that do similar things is even more unmaintainable.
Having to maintain 6 different API endpoints of get_llm_call_as_csv, get_llm_call_as_html, etc. is, in my opinio…
Yup - that's a great idea. Lots of ways to skin the cat here. My example isn't perfect, but one can make the argument that extending a function into multiple smaller functions that do similar things is even more unmaintainable.
Having to maintain 6 different API endpoints of get_llm_call_as_csv, get_llm_call_as_html, etc. is, in my opinion, even more unmaintainable than just using an enum in this case. That's 6 different API endpoints more to maintain compared to just 1, especially for functionality that is small enough that an enum can be the switch here.
Yup - that's a great idea. Lots of ways to skin the cat here. My example isn't perfect, but one can make the argument that extending a function into multiple smaller functions that do similar things is even more unmaintainable.
Having to maintain 6 different API endpoints of get_llm_call_as_csv, get_llm_call_as_html, etc. is, in my opinion, even more unmaintainable than just using an enum in this case. That's 6 different API endpoints more to maintain compared to just 1, especially for functionality that is small enough that an enum can be the switch here.
That's fair. I want thinking about the endpoints. I agree there.
Either way, your point is very well made.
I avoid booleans as you recommend. I think the enum is a very underused structure.
And I despise the use of underscores in variable names. 🙃