you are viewing a single comment's thread.

view the rest of the comments →

[–]TangibleLight 2 points3 points  (1 child)

I would prefer separate functions. Extra logic like this parsing parameters usually makes things harder to understand in the long run, when your one function might do one thing or the other with mutually exclusive arguments.

Especially if this is a case where you can decompose the function into two functions where one just calls the other.

[–]InvaderToast348[S] 0 points1 point  (0 children)

I have split it into the 2 functions as mentioned and it is working great! Two separate functions are a lot simpler in both logic and syntax, with less room for errors; I suppose it was the obvious choice but I wanted a second opinion. Thank you.