Go to Post In the long run, you don't remember your ranking points, you remember the lessons and friendships from when you were on a robotics team in high school. - smurfgirl [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 17-02-2013, 01:37
PLAIDProgrammer PLAIDProgrammer is offline
Registered User
FRC #2538
 
Join Date: Feb 2013
Location: Minnesota
Posts: 2
PLAIDProgrammer is an unknown quantity at this point
Exception Handling

Although we would not like to be having exceptions at this stage in code, it happens. I was wondering weather other programmers catch exceptions or let them stop the code? Any help will really make my teams life much easier.
Lenny
Reply With Quote
  #2   Spotlight this post!  
Unread 17-02-2013, 02:05
gixxy's Avatar
gixxy gixxy is offline
Programming and Arduino Mentor
AKA: Gustave Michel III
FRC #3946 (Tiger Robotics)
Team Role: Mentor
 
Join Date: Nov 2011
Rookie Year: 2012
Location: Ruston, LA
Posts: 207
gixxy is on a distinguished road
Re: Exception Handling

I believe in catching errors and handling them rather than letting them crash code. Especially if you know what could cause them to happen.


This year a major example is our RaspberryPi, which we are using to process camera images. We them pipe the data back to the cRIO via TCP Socket. There will be times where something goes wrong and I will get an IOException, and I would rather have it handled gracefully and keep the robot running rather than it crash.
__________________
Programmer - A creature known for converting Caffeine into Code.
Studying Computer Science @ Louisiana Tech University
Associate Consultant @ Fenway Group

2012-13: 3946 - Head of Programming, Electrical and Web
2014 - 3468 - Programming Mentor
2015 - Present - Lurker
Reply With Quote
  #3   Spotlight this post!  
Unread 18-02-2013, 15:35
Cel Skeggs Cel Skeggs is offline
Robot Software Manager Alumnus
AKA: Previously known as Colby
FRC #1540 (The Flaming Chickens)
Team Role: Alumni
 
Join Date: Feb 2013
Rookie Year: 2009
Location: Portland, Oregon, USA
Posts: 107
Cel Skeggs is a glorious beacon of lightCel Skeggs is a glorious beacon of lightCel Skeggs is a glorious beacon of lightCel Skeggs is a glorious beacon of lightCel Skeggs is a glorious beacon of lightCel Skeggs is a glorious beacon of light
Re: Exception Handling

In our code base, we catch certain kinds of errors - anything that we know could be thrown (for example IOException or NumberFormatException) we will catch.
Most of the time, we don't try to catch exceptions if we don't know they'll be thrown - it's not useful to us to try to catch ArrayIndexOfOfBoundsException or NullPointerException, because generally they imply that there's a bug in our code that should be fixed.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 22:15.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi