View Single Post
  #25   Spotlight this post!  
Unread 29-08-2008, 10:44
Pat Fairbank's Avatar
Pat Fairbank Pat Fairbank is offline
Circuit Breaker
FRC #0254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2001
Location: San Jose, CA
Posts: 2,132
Pat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond repute
Send a message via MSN to Pat Fairbank
Re: Compact rio not being able to use C

Quote:
Originally Posted by BradAMiller View Post
Actually it's the opposite. To make C++ work really well, the libraries have been developed as a series of classes that implement all the sensors, motors, etc.
Even better, then. Will these classes expose virtual functions so that teams can subclass them to extend their functionality?
Quote:
Originally Posted by BradAMiller View Post
We're currently trying to decide if the wrappers are really necessary since one could write the entire robot program using only C code except when calling the methods for those sensors and motors. And even that looks a lot like C. The upside for not doing the wrappers is that it allows the C++ code to be much more flexible and easy to use.
I don't really see the point in wrapping the method calls in C. Since writing code for the new controller is going to involve learning a new interface for I/O in any case, there's no argument to be made for preserving familiarity. Since C and C++ code will be compiled automatically by the same compiler, there won't be any build issues for those who choose to program in C.

I guess what is boils down to is whether there are teams who will choose to program exclusively in C and who would be confused by the C++ syntax. I can't answer for others, but my team may or may not decide to use C++, depending on how comfortable our students are with C. In either case, we'll already be taking advantage of having a C++ compiler to eliminate some of the shortcomings of C, so calling methods on a class for motors and sensors won't bother us.
__________________
Patrick Fairbank
Team 254 | Mentor (2012-)
Team 1503 | Mentor (2007-2011)
Team 296 | Alumnus (2001-2004) | Mentor (2005-2006)

patfairbank.com