Oi Pablo, obrigado por compreender minha opnião. Dentro deste post há um comentário sobre uma aplicação sua chamada STRU, só que eu não a localizei. Poderia dispnibiliza-la ou indicar onde está?Pablo César wrote:Hi Amarante,Amarante wrote:Frankly I could not see a significant difference and personally I like the "IF" structure in place of "CASE".
I think it is more a matter of taste since no significant change at runtime, but please me know if I'm wrong.
I also agree in parts with you. I have read this:
I agree with just for the appearance which Do Case seems more clear IMHO, that is important. Micro-seconds of performance is not going to affect your system anyway. The important is the code to be more clear as posible for now and for the future interpretation, being by me or others.Is “elseif” faster than “switch() case” ?
Why do you care?
99.99% of the time, you shouldn't care.
These sorts of micro-optimizations are unlikely to affect the performance of your code.
Also, if you NEEDED to care, then you should be doing performance profiling on your code. In which case finding out the performance difference between a switch case and an if-else block would be trivial
Also I believe when many IFs are defined, many duplicated conditions could be attended at same time. So, IMHO Do Case I use when I just want only one choice.
This is my point-of-view. I hope to be helpfully to form a good own review.
Desde já agradeço pela consideração.