View Single Post
  #15   Spotlight this post!  
Unread 17-03-2004, 14:59
Chris Hibner's Avatar Unsung FIRST Hero
Chris Hibner Chris Hibner is offline
Eschewing Obfuscation Since 1990
AKA: Lars Kamen's Roadie
FRC #0051 (Wings of Fire)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1997
Location: Canton, MI
Posts: 1,488
Chris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond repute
Re: C Programing language. Is it the devil?

Quote:
Originally Posted by seanwitte
The big advantage to C is the fact that you can break your code up into logical blocks based on shared interfaces.
I still say the biggest advantage to C is signed math. The hoops you had to jump through with pBASIC to get anything to work was rediculous. Look at the following two statements:

pBASIC:
PControl = Error * PGain - 127*(PGain-1) // What??????

C:
PControl = Error*PGain;

It seems to me that the C implementation is much easier, more intuitive, and requires less testing/debug to be sure you recentered yourself correctly around zero. The sad thing is, it just took me 2 seconds to write the C line, but about 5 minutes to figure out the pBASIC line. Given that, I'd rather have C any day.
__________________
-
An ounce of perception is worth a pound of obscure.