
24-01-2010, 21:48
|
|
Registered User
 FRC #2152
Team Role: Programmer
|
|
Join Date: Jan 2009
Rookie Year: 2009
Location: Port Orange, Florida
Posts: 88
|
|
|
Re: Printing Float to Dashboard
Quote:
Originally Posted by Abrakadabra
Or sometimes us old-time C programmers know what is efficient and what is not. Remember, although the cRio is lightyears ahead of the old IFI controller, we are still programming on an embedded system, not a desktop PC. Using the C++ iostream library requires your program to bring in a whole bunch of extra code, most of which will never be used in our implementations. The extra processing required to do all the buffer manipulation that gives you that smooth I/O redirection interface is not really noticed in a program running on a desktop PC, but for a finely-tuned embedded program, it can be the difference between smooth operation of your control loops and erratic, unexpected behaviors.
Especially for a function like writing to the Driver Station, you want to keep things as simple and fast as possible, so as not to slow down or impede communications with the robot.
So sometimes the old ways are better not because they are "familiar", but instead are "just better" for the particular task at hand.
Now you kids get off my lawn with that crazy "<<" stuff! 
|
Strange, "WPILib.h" imports iostream... 
Last edited by TheDominis : 24-01-2010 at 21:52.
Reason: Slightly erroneous statement
|