View Single Post
  #8   Spotlight this post!  
Unread 01-26-2011, 12:04 AM
davidthefat davidthefat is offline
Alumni
AKA: David Yoon
FRC #0589 (Falkons)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2010
Location: California
Posts: 792
davidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud of
Re: Bad Programming Practices

Code:
package edu.wpi.first.wpilibj.Robot2011;

import edu.wpi.first.wpilibj.Robot2011.Actuate.*;
import edu.wpi.first.wpilibj.Robot2011.Calculate.*;
import edu.wpi.first.wpilibj.Robot2011.Perceive.*;

/**
 *
 * @author davidthefat
 */
public class Robot
{
    private ArcadeDriveCalculation ArcadeDrive;
    private DataStructure Data;
    private Drive Arcade;
    private CVJoystick JoyManager;

    //Start Test Variables
    private CVEncoder e1;
    //End Test Variables

    public Robot()
    {
        ArcadeDrive = new ArcadeDriveCalculation();
        Arcade = new Drive();
        Data = new DataStructure();
        JoyManager = new CVJoystick();
    }
    public void RunTeleop()
    {
        JoyManager.update(Data);
        ArcadeDrive.Calculate(Data);
        Arcade.setMotors(Data);
    }
    //Use these test functions to test whatever you need
    public void test()
    {
        e1.update(Data);

    }
    public void testInit()
    {
        e1 = new CVEncoder(1,6);
        e1.setDiameter(11.1);
    }

}

That is how I code. I never understood commenting obvious things, but everything seems obvious to me. Its like "thanks captain obvious".

Edit: why the CVEncoder takes in 2 variables is because the new kid made it take in indices for a 2d array to handle the encoder channel. So it is very inefficient. Do not judge.
__________________
Do not say what can or cannot be done, but, instead, say what must be done for the task at hand must be accomplished.
Reply With Quote