Quote:
Originally Posted by BradAMiller
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
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.