View Single Post
  #4   Spotlight this post!  
Unread 25-11-2012, 02:51
joelg236 joelg236 is offline
4334 Retired Mentor & Alumni
AKA: Joel Gallant
no team
Team Role: Mentor
 
Join Date: Dec 2011
Rookie Year: 2012
Location: Calgary
Posts: 733
joelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond repute
Re: Enhanced I/O through Cypress

"ex.printStackTrace();" Does exactly what it says: prints a stack trace to the default console (in your case, netbeans console used to deploy). It would not add anything significant to keep that inside of the catch block. (And it would end up being helpful when debugging)

As for whether what you did will work, it completely depends on what you want your code to do when that exception is thrown, so if that is setting the Feed to Relay.Value.kOff, sure.

Something that bugged me a bit in your code is this:
Code:
DriverStationEnhancedIO Cypress = DriverStation.getInstance().getEnhancedIO();
In Java, camel case is standard (see coding conventions - http://www.oracle.com/technetwork/ja...v-138413.html). This is because accessing static members only requires the class name, which should start with a capital letter. When your fields are named starting with capital letters, it can be hard to distinguish between fields and classes. It's definitely worth starting a habit of camel casing.
__________________
All opinions are my own.
Reply With Quote