|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Re: Code Review: Semi-Novice
Quote:
|
|
#2
|
||||
|
||||
|
Re: Code Review: Semi-Novice
This isn't really a code thing, but it's best practice in git to exclude anything binary (your bin, build, and dist) folders. You can use a .gitignore file to do this.
General - You've got some redundant/unnecessary classes. Instead of things like IntakeIn and IntakeOut you could have a generic IntakeRoll that accepts an enum parameter for in or out. - When using booleans in if blocks, you don't need an "== true" So instead of Code:
if(pSwitch.get() == true) { ... }
Code:
if(pSwitch.get()) { ... }
Code:
if(RobotMap.intakeOutSwitch.get() == false) { ... }
Code:
if(!RobotMap.intakeOutSwitch.get()) { ... }
- Using an array of joystick buttons might be neater Robot.java - What is pSwitch? A better variable name would help. Also the channel is hardcoded - You store joystick buttons here. Those should be in OI RobotMap.java - You name some channel numbers "driveVictorX" and then create a Talon object with them - Then you name your lift motor channel "liftTalon" and create a Victor from it - Intake switches are hardcoded Subsystems - I agree with the design choice of having subsystems store hardware objects (instead of RobotMap), but it's really up to you. Note that these are best practices/recommendations. It's difficult to write software well, and even our own code doesn't really meet these standards (especially as we piled on more and more mid-competition hacks) ![]() Last edited by euhlmann : 22-05-2016 at 19:48. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|