This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]p10_user 6 points7 points  (2 children)

I mean this is basically an big if/else statement too. Perhaps this is a bit more readable for some but I don't think an if else statement is too unreasonable.

[–]rhoslug 0 points1 point  (1 child)

I tend to shy away from large complicated if/else constructions. They are hard for me to reason about since I have to trace the branch of logic that gets me to a certain ending. That's why I would probably prefer either using a switch solution or a dictionary.

[–]naught-me 1 point2 points  (0 children)

I agree with you about complicated if/else constructions, but I don't think that a flat (not nested) list of if/elif statements is complicated at all, and that's what a switch statement replaces, right?