Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoiding the case block #5

Open
jerryjohnjacob opened this issue Jul 19, 2016 · 0 comments
Open

Avoiding the case block #5

jerryjohnjacob opened this issue Jul 19, 2016 · 0 comments

Comments

@jerryjohnjacob
Copy link

jerryjohnjacob commented Jul 19, 2016

As a brainstorming exercise, can you try figuring out if there's any way you can avoid using the case block here?

Usually the switch-case block is regarded as unclean code. I don't quite agree with that. What I do think is that the tendency is generally to misuse it and hence it ends up getting used in inappropriate places. I think your current use of it is fine. But like I mentioned, as an exercise, just think about other means through which you can implement the same (no need to update the code or anything).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant