View Single Post
  #10   Spotlight this post!  
Unread 05-04-2010, 19:05
ideasrule's Avatar
ideasrule ideasrule is offline
Registered User
FRC #0610 (Coyotes)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2009
Location: Toronto
Posts: 108
ideasrule is a jewel in the roughideasrule is a jewel in the roughideasrule is a jewel in the roughideasrule is a jewel in the rough
Re: Modular Autonomous?

I agree with the posters above: modular code is what makes object-oriented code as powerful and elegant as it is. My philosophy is that if you're copy and pasting code everywhere, you haven't created enough methods/function/subroutines/whatever-they're-called. Our autonomous code looks like:

DriveSequence();
drive(-0.25,0);
Timer.delay(0.2);
drive(0,0);
turn(a,b);
fire();

If I had more time, I would've put this in a method of its own:

drive(-0.25,0);
Timer.delay(0.2);
drive(0,0);