Some RobotC problems that I have encountered
Page 1 of 1

Author:  madjocko [ Sat Feb 13, 2010 7:10 pm ]
Post subject:  Some RobotC problems that I have encountered

Hello all,

I am a current CMU student taking a Robotics class and we are programming the NXTs using RobotC. I have come across several things that have contributed to a couple frustrations that I have had.

The following code is the exact code that I have been using for an absolute value function:
#define ABS(x) (x)>0 ? (x) : (-(x))

However, for some reason, this macro does not quite output the correct value. I think there may be some problems in the pre-processor.

Memory Allocation
I know there is no support for memory allocation but why is that? If this language is built upon just the C language (which i assume it is... shouldn't it be able to take advantage of probably the most powerful part of programming in C?)

There is very little optimizations that are done when compilation occurs. I can tell because recently I was programming a multi-threaded program and realized that by simply combining a couple of mathematical operations(addition/subtraction/multiplication/division), the code was able to produce much more reliable results while also being computed much faster. However, in C, a lot of optimizations are performed regarding this manner and I have never had this problem before when coding in C.

There is no support for recursion and I'm not sure why. A lot of traversal algorithms, like DFS, are innately recursive and although it is pretty simple to write DFS in a iterative manner, there are much much more complicated algorithms that depend on recursion, mainly a lot of dynamic programming algorithms. A lot of concepts in Robotics will require recursion and this is this almost necessary to support!

Anyways, I was hoping that some of these issues could be fixed in the near future as it would make the transition from programming in C to RobotC less painful and much easier to work with!

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group