Skip to content

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

Open
vsyaco wants to merge 1 commit into
michelf:masterfrom
vsyaco:master
Open

Using switch instead of multiply if-else statements.#5
vsyaco wants to merge 1 commit into
michelf:masterfrom
vsyaco:master

Conversation

@vsyaco

@vsyaco vsyaco commented Apr 12, 2013

Copy link
Copy Markdown

No description provided.

@michelf

michelf commented Apr 12, 2013

Copy link
Copy Markdown
Owner

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