Is a switch statment ok for 30 or so conditions?
Posted
by DeanMc
on Stack Overflow
See other posts from Stack Overflow
or by DeanMc
Published on 2010-04-14T19:49:48Z
Indexed on
2010/04/14
19:53 UTC
Read the original article
Hit count: 215
I am in the final stages of creating an MP4 tag parser in .Net. For those who have experience with tagging music you would be aware that there are an average of 30 or so tags. If tested out different types of loops and it seems that a switch statement with Const values seems to be the way to go with regard to catching the tags in binary.
The switch allows me to search the binary without the need to know which order the tags are stored or if there are some not present but I wonder if anyone would be against using a switch statement for so many conditionals.
Any insight is much appreciated.
© Stack Overflow or respective owner