Intro to FRC Programming - Romi
  • INTRODUCTION
    • Overview
    • Important Links
  • 💽Setup
    • Setting up the Romi's Software
    • Downloading Essential Tools
    • APCS vs FRC
  • How To Code in VSC
    • VSC- Intro
    • A Tour Through VSC
    • Creating a Regular Java Project
  • Intro to Java
    • What is Java?
    • Beginning Steps
    • 🟩Fundimentals of Java
      • Variables
      • Operations
      • Methods
      • Comments
      • If Statements and Conditions
      • Boolean Zen
      • Loops
      • Challenge- Create a Box House
    • 🟨Advanced Concepts
      • Objects
      • Scanners
      • Null Objects
      • Arrays
      • Errors
      • For-Each Loops
    • 🟥Object Oriented Programming
      • Basics of OOP
      • Instance Classes
      • Static Classes
  • 🕑Romi Curriculum- Timed Base
    • Romi Curriculum- Introduction
    • Creating a WPILIB Project
    • Running Your Code
    • The Robot Class
    • Subsystems
      • RomiDrivetrain
    • Cool stuff i will rename this category later
      • Spark Motors
      • PIDs
      • External Controllers
      • Encoders
  • 🖥️Romi Curriculum- Command Based
    • Command Based Code
    • RobotContainer
    • Commands
    • CommandScheduler
  • UNRELATED IMPORTANT CODING KNOWLEDGE
    • Constants
  • SAMPLE CODE
    • Tank Drive Example
      • RobotContainer
      • TankDriveSubsystem
      • MoveRobotCommand
    • Worktop Systems Sample Java Code
      • Belt Elevator Sample Code
      • Rotating Arm Sample Code
Powered by GitBook
On this page
  1. Intro to Java
  2. Fundimentals of Java

Comments

PreviousMethodsNextIf Statements and Conditions

Last updated 2 months ago

Imagine if you were building a chair or something from IKEA and the instructions didn't have anything on them. The pure agony and misery you'd feel is the same feeling people get when they see a code without any comments (this is from experience).

Comments are little notes that the coder writes so that people who look through the code understand what's happening. Whatever's inside them will not be checked by the compiler for errors. If you're going to take away at least one thing from this entire page, remember to comment your code.

There are two types of comments that we use: singleline and multiline comments.

// single line comment

/* multi
 * line
 * comment */

Multiline comments are named this because they can be more than one line long. You can have a one-line multiline command and nothing bad will happen.

For most cases both comments work fine. However, there are two style rules that we follow to keep our life expectancy up:

  1. Put comments in parts of your code that look confusing.

  2. If a comment ends up being too long (200 > characters long), move the rest of the comment onto a new one below.

  3. Comment method/class headers. When you do, use multiline comments (VSC sets this comment as a tooltip. Behind the tooltip is the multiline comment)

🟩