Log in

View Full Version : Programming Code


themaxim
06-01-2005, 23:23
I have red the poll about your most popular programming code. and im sorry for being naive on the topic because I'm new, but what is the standard code for programming the robots? I'm new to programming, and I want to start of learning the basics of the widely-acepted "standard" code. Any suggestions?

Goobergunch
06-01-2005, 23:25
In 2004, the robots were programmed in C. I doubt that this will change for this year.

sburro
06-01-2005, 23:25
I have red the poll about your most popular programming code. and im sorry for being naive on the topic because I'm new, but what is the standard code for programming the robots? I'm new to programming, and I want to start of learning the basics of the widely-acepted "standard" code. Any suggestions?

The language on the first robot is c. This is a "scaled down" version of c++. If it is strictly an intrest in First, then C is the way to go. You can not program the controller in any other language.

sburro
06-01-2005, 23:27
In 2004, the robots were programmed in C. I doubt that this will change for this year.
If First were to change the language, I think they would have warned us like they did last year.

themaxim
06-01-2005, 23:28
if i learned c++ instead... would i still be able to know c? or are they two just way totaly different things? what are the benefits/downsides of c/c++?

phrontist
06-01-2005, 23:33
The language on the first robot is c. This is a "scaled down" version of c++. If it is strictly an intrest in First, then C is the way to go. You can not program the controller in any other language.

WARNING: NERD PEDANTRY AHEAD

C is not a scaled down version of C++. C++ is an object oriented version of C, along with a few other differences. You can most certainly program the robot in another language, and in fact the default code does: it's sprinkled with assembler. The Microchip compiler adheres to the C18 standard, which is a stripped down version of C.

While C is definately the best way to go for FIRST, many other compilers have been written for PICS, but C is the second most common language used on PICs in "the real world". Most PIC applications I've seen are done in straight assembler.

vtrehan
06-01-2005, 23:48
if i learned c++ instead... would i still be able to know c? or are they two just way totaly different things? what are the benefits/downsides of c/c++?

Of course, but i would suggest learning C first, the reasons being:

1. C is easier and simpler to work with.
2. C can be compiled with any compiler, including C++ compilers, whereas C++ can not be compiled in MPLAB, the compiler we are supposed to be using.
3. C is low level programming, meaning we can work directly with register values and do binary programming used widely in engineering type programming, which is what we are supposed to do. But C++ is a high level language mainly used to do programming for businesses.


C is really simple to use and their is a tonne of tutorials present for it, but if you need any specific help, PM me and ill do my best to help you out.


Best wishes :)
Vivek.

BrianJennings
07-01-2005, 11:54
From my understanding c and c++ are extremly similar. I think the only different between them is some code and added features to c++. So you could think of C++ as C. but ++...(AKA stuff added to it)

Kevin Sevcik
07-01-2005, 12:34
3. C is low level programming, meaning we can work directly with register values and do binary programming used widely in engineering type programming, which is what we are supposed to do. But C++ is a high level language mainly used to do programming for businesses.


WARNING: Even more nerd pendantry

C is not a low level language. It's a high level language, just like C++. C++ just has more abstraction incorporated in it, so it's a higher level language than C, but still. Low level languages are languages like assembler where you're actually working with registers and basic processor instructions full time. If you're defining variables and stuff, it's not really a low level language.

Alan Anderson
07-01-2005, 12:59
WARNING: Even more nerd pendantry

C is not a low level language. It's a high level language, just like C++. C++ just has more abstraction incorporated in it, so it's a higher level language than C, but still. Low level languages are languages like assembler where you're actually working with registers and basic processor instructions full time. If you're defining variables and stuff, it's not really a low level language.
I've always considered C to be sort of an "intermediate" level language. It started out with an awful lot of direct mapping of its features to the hardware on which the program runs. When the native register size of the CPU is a native variable type in the language, I don't think it's a very high level language at all. You're not working with the basic processor instructions themselves, but almost everything you do is directly related to those instructions, and using pointers is essentially right down there in the computer's RAM with little if any abstraction.

Raven_Writer
07-01-2005, 13:07
...
1. C is easier and simpler to work with.
2. C can be compiled with any compiler, including C++ compilers, whereas C++ can not be compiled in MPLAB, the compiler we are supposed to be using.
3. C is low level programming, meaning we can work directly with register values and do binary programming used widely in engineering type programming, which is what we are supposed to do. But C++ is a high level language mainly used to do programming for businesses... I'd like to correct a few things here.

1: C isn't "easier" or "simpler" for everyone. It really depends on how you learn, and whatnot. I find C++ to be a lot "easier" and "simpler", and I also find C to be the complete opposite. Like I said, it just depends on how you learn, and also your preferences to boot.

2: Most points made in #2 are correct, except that MPLAB is just an IDE (Integrated [sp?] Developement Eviroment). The compiler we're using is called CBOT. MPLAB just makes the coding easier.

3: C and C++ are both low level. C++ can do pretty much the same thing as C, and plus some (as far as I know). C isn't all that much low-level though. Is C low-level? Pretty much. Is C++? Pretty much. Anything done in C can be done in C++ (as you've said), so to say that C++ is a low-level language is kind of a lie.

If anyone would like to correct me on any points I've said and am wrong, please do so. My apologizes also for going off-topic, but I thought I should clarify some misconceptions that was said in the quoted post.