Programs other than C.

4 replies [Last post]
Clare120's picture
Title: NooBot
Joined: 10/24/2013
BotPoints: 14
User offline. Last seen 5 years 1 week ago.

Can C++ work just as well as C? The same question goes to Java and Python.


Jeremy Rand
Jeremy Rand's picture
Title: Botball Youth Advisory Council
Joined: 04/03/2009
BotPoints: 1168
User offline. Last seen 3 years 25 weeks ago.

Are you referring to Botball specifically, or just in general?

Generally, C++ is a superset of C (with a few minor exceptions), so most C code will work fine if compiled as C++. Java and Python are higher-level languages, and therefore are better-suited for different applications than C/C++. The general rule of thumb is that when you need extreme speed or direct access to hardware, C/C++ is a good choice, while if you want to write the program quickly and have your program be easily readable by other humans, Python is a better choice. (I'm not a Java fan, so I'll let someone else describe whatever advantages it might have.)

In Botball, C is the only language supported by KIPR. Using other languages is legal, but you may run into bugs, and KIPR will be unable to assist you. (Although the Botball Community is a good place to get help with such things.) Various hackers have enabled all 3 of the other languages in Botball (I did C++, Braden McDorman did Java, Scott Miller did Python).

-Jeremy Rand
Senior Programmer, Team SNARC (2012-2013), Norman Advanced (2010-2011), Norman HS (2008-2009), Norman North (2005-2007), Whittier MS (2003-2004)
2012-2013 VP of Tech, 2011 President, Botball YAC (2009-2013)
Mentor, Alcott and Whittier MS

Title: NooBot
Joined: 10/28/2013
BotPoints: 286
User offline. Last seen 4 years 39 weeks ago.

Ok, here's a clarification and evaluation of the programming languages. C/c++ are both medium level languages. C is not object oriented while c++ is. The main difference is that object oriented languages support encapsulation, polymorphism, and inheritance. This is the main thing about these two languages. Now, Python is a high level language who's main focus is readability. The purpose of the language is to provide an compiler that let's you express with very little amount of code. I'm personally not a big fan of Python. Now, since Jeremy didn't talk about Java (I don't like java either), Java is basically C++ with a few changes and a totally revamped compiler. In C++ the compiler looks at preprocessor,libraries, and after all of that, it turned it into binary which allows the computer to read it. Now, Java, on the other hand is a total different language. Java compilers first turns the code into byte code which is universal in java machines. This is how java achieves such high level of portability. Then, after that, the Java framework does a complicated process to the byte code and translates it into binary. (I'm not an avid Java programmer so I might be wrong on a few things) Now C# is just like c++, but the compiler again, just like java, does something weird. First, it uses the .NET framework to translates the code into Microsoft Intermediate Language. After that, the CLR (common language runtime) translates the MSIL into something that all compilers can read. After that the compiler looks at the code just as it will with any language and translates it into binary. This gives C# it's ultimate portability. But, all of this comes at a cost with more bugs, longer compile time, and slower programs. So if i was programming a robot, I would use c++, but, in botball's case, since c is supported, C remains the recommended language of the game.

I hope this clarifies things and answers your question, thanks.

Jesus Arzapalo
Title: NooBot
Joined: 10/23/2013
BotPoints: 82
User offline. Last seen 2 years 18 weeks ago.

c++ can work as well and even better but it is not supported on KIPR. Also if you can use Java on a link I would be very impressed but it is possible. It would probably work better but it would take a lot of work to integrate it.

Harrison Cassar
Title: NooBot
Joined: 10/16/2013
BotPoints: 197
User offline. Last seen 3 years 39 weeks ago.

@Jesus Arzapalo: Please do not re-post already posted information. Thank you