SouthEugeneRoboticsTeam / BunnyBots-2017

SERT's code for the 2017 BunnyBots game: Hide and Seek
MIT License
5 stars 1 forks source link

Discuss file structure #6

Open andrewda opened 6 years ago

andrewda commented 6 years ago

Kinda more large-scale than #5. How should we structure the robot? I like this format a lot:

src/main/java/org/sert2521/bunnybots/
  Robot.kt
  Constants.kt
  drivetrain/
    Drivetrain.kt
    ArcadeDrive.kt
    TankDrive.kt
    actions/
      DriveForward.kt
      AlignToTarget.kt
  arm/
    Arm.kt
    actions/
      MoveArm.kt
  claw/
    Claw.kt
    actions/
      OpenClaw.kt
      CloseClaw.kt
  utils/
    OI.kt
    Switch.kt

Guess I still like the subsystem/action structure even if we're not technically using subsystems. It's much more organized and easier to follow.

SUPERCILEX commented 6 years ago

Aren't we already doing that? Just without the actions thing. But yeah, looks good.

andrewda commented 6 years ago

Yea just a few minor changes. We should use drivetrain instead of driving, utils instead of util (at least that's the standard in Python and JavaScript, maybe that's different in Kotlin?), and remove the Utils suffix from the utilities (again, maybe that's actually not the standard in Kotlin).

andrewda commented 6 years ago

Also move Constants.kt outside of utils.

SUPERCILEX commented 6 years ago

@andrewda util is a standard Java convention (and by extension Kotlin) for a package that contains a wide variety of unrelated stuff. utils is used when the stuff is focused on one specific thing. See this Java lang package for example.

@Jamdan2 suggested we change the utils stuff to lowercase and remove the Utils postfix which is cool by me. @Jamdan2 Does IntelliJ append a Utils to their file names or just use the name of whatever's inside?

Also, moving consts is fine by me.