View Single Post
  #11   Spotlight this post!  
Unread 06-04-2006, 00:47
TimCraig TimCraig is offline
Registered User
AKA: Tim Craig
no team
 
Join Date: Aug 2004
Rookie Year: 2003
Location: San Jose, CA
Posts: 221
TimCraig is a splendid one to beholdTimCraig is a splendid one to beholdTimCraig is a splendid one to beholdTimCraig is a splendid one to beholdTimCraig is a splendid one to beholdTimCraig is a splendid one to beholdTimCraig is a splendid one to behold
Re: Critique this code

He's right in that in control_system.c your indenting is inconsistent. Quite a few more comments explaining why things are done and what functions actually do in plain English would be helpful.

I really don't like using multiple returns from a function. You're more likely to screw up your logic when you make changes with multiple returns and it's harder for outsiders to trace that logic. With the compiler warning level set high enough, and I really, really recommend you set it at the highest and fix your code so NO warnings are generated, functions like joystick_deadpan and percentage_limit will generate a warning because technically they are expected to return a value and when you just hit the closing curly brace you're returning void.

Some of these things may seem nit picking but they're what make the difference between good code and four letter word code. And I've spent too much of my life trying to fix the latter kind.

Last edited by TimCraig : 06-04-2006 at 00:48. Reason: typo