ROBOTC.net forums
http://robotc.net/forums/

RobotC and the keyword 'this'
http://robotc.net/forums/viewtopic.php?f=1&t=4221
Page 1 of 1

Author:  MHTS [ Wed Feb 08, 2012 3:12 pm ]
Post subject:  Re: RobotC and the keyword 'this'

I haven't tried the "this" keyword. But I would avoid using it since it is a keyword in C++. You don't want to confuse whoever reading the code thinking this is C++.

Having said that, RobotC is a hybrid of C and C++. It does have some C++ features. For example, it allows function parameter initialization so you can skip a parameter if you want to go default. It also supports function overloading. There are some other minor C++ features too. IMHO, it is actually confusing to me because then I don't know what are and what are not supported, so I have to constantly do experiments to figure out if it does support it. Even if it seems to support it, I don't know if the support is fully compliant with ANSI standard. In other words, when something is not quite working, is it a bug or is it just departing from ANSI standard?

In my opinion, this is especially bad for beginners learning the language because once you learned RobotC, you may think it is the standard and writing code that would work with RobotC and expecting it to work elsewhere but it may not. I am always hoping RobotC will support full blown standard C++ in the future with class, inheritance and polymorphism. At the very least, I would like to see some documents explaining the difference between RobotC and ANSI C/C++.

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/