Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

does this affect performance

 
Martin Vanyavchich
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

in the spirit of 'there are no stupid questiones', are there any performance benefits to using either one of these syntaxes:



Thank you, for any replies.

Martin
 
Tim Holloway
Bartender
Posts: 18423
60
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As far as I can eyeball this early in the morning, they should both collapse down to the same set of elements fairly early in the parsing process.

What's far more important is that when it comes time to maintain the code, one will be easier to continue on in "switch/case" fashion (if/else if/else if/...). The other is more conducive to "if /else {if/else}" type logic. Which might require a few more milliseconds on the programmer's side to work through.
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 35762
412
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Martin,
I agree with Tim they are the same.

Even if they weren't, it would be too small a difference to be worth worrying about.
 
Martin Vanyavchich
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, it make sense =) Thanks again for your replies.

Martin
 
I do some of my very best work in water. Like this tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!