View Single Post
  #2   Spotlight this post!  
Unread 20-01-2008, 21:27
ebarker's Avatar
ebarker ebarker is offline
Registered User
AKA: Ed Barker
FRC #1311 (Kell Robotics)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Kennesaw GA
Posts: 1,437
ebarker has a reputation beyond reputeebarker has a reputation beyond reputeebarker has a reputation beyond reputeebarker has a reputation beyond reputeebarker has a reputation beyond reputeebarker has a reputation beyond reputeebarker has a reputation beyond reputeebarker has a reputation beyond reputeebarker has a reputation beyond reputeebarker has a reputation beyond reputeebarker has a reputation beyond repute
Re: switch vs. if... else if. More efficient?

The switch statement essentially constructs the same code as a stack of if/then/else statements.

The switch is useful because it is a way of documenting code and representing it as a 1 of n selector.

This is a plenty fast processor for what you are probably going to try and do so I wouldn't worry about it.

Worrying about these types of things for your i/o routines generally isn't necessary as it was say 30 years ago.
__________________
Ed Barker