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

Using switch instead of multiply if-else statements. #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Using switch instead of multiply if-else statements. #5

wants to merge 1 commit into from

Conversation

vsyaco
Copy link

@vsyaco vsyaco commented Apr 12, 2013

No description provided.

@michelf
Copy link
Owner

michelf commented Apr 12, 2013

I'm not convinced this is an improvement. On one hand, switch removes the redundancy of $attr ==. On the other hand it requires adding a break everywhere otherwise it'll fall through the next case silently. I'd argue that the later is more error prone.

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

Successfully merging this pull request may close these issues.

2 participants