Skip to content

Stage 0: Operators + Java Fundamentals#20

Open
Adrianamm wants to merge 14 commits into
frcsoftware:mainfrom
Adrianamm:Stage-0-Operators
Open

Stage 0: Operators + Java Fundamentals#20
Adrianamm wants to merge 14 commits into
frcsoftware:mainfrom
Adrianamm:Stage-0-Operators

Conversation

@Adrianamm

Copy link
Copy Markdown
Member

Added information about operators for stage 0
It includes: Arithmetic, Assignment, Comparison and Logical operators.
No exercise yet but I plan to add one in after all stage 0 material is written

@Adrianamm Adrianamm linked an issue May 22, 2026 that may be closed by this pull request
7 tasks

@ArchdukeTim ArchdukeTim left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are already many free online courses that teach an introduction to java and its syntax. Would it be better to just recommend one of them as a precursor, rather than trying to reinvent the wheel?

Comment thread src/content/docs/intro-to-java/java-fundamentals.mdx Outdated
Data types refer to the type of value that our variable has. It helps tell our program more information about our variables such as what type of information it holds and how it can be used.
Data types can include numbers, characters or a string of words. Some examples of data types that are commonly used in FRC programming are:
* Int: integers or numbers that are positive or negative. Int only allows numbers without decimals. Example: 12
* Double: Double: numbers that are positive or negative. Unlike int, double allows numbers with or without decimals. Example: 34.1

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Double: Double: numbers that are positive or negative. Unlike int, double allows numbers with or without decimals. Example: 34.1
* Double: numbers that are positive or negative. Unlike int, double allows numbers with or without decimals. Example: 34.1

Comment on lines +10 to +11
## Syntax
As you start programming, you might make a mistake or make a typo. When that happens, your code will have a red line under it. This is because Java has rules called syntax. Syntax is a set of rules that have to be followed so that the computer can understand and run your code. It’s important to pay attention to the syntax!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Syntax errors are common, but not the only reason that you might get a compiler error. For example, using a misspelled variable name is valid syntax, but still an error.

Comment on lines +36 to +38
The name of your variable can be whatever you want. However, it should be easy to read and make sense to others who may be reading your code.
There are also some rules with variable names. The name of the variable can not include spaces. Instead you can write variables with camel case (frontLeftDrive) and snake case (front_Left_Drive).
Variable names can not start with a number. However, they can have a number at the end of the name.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be whatever you want...rules with variable names

It would be better to just state what the rules and maybe conventions are

they can have a number at the end of the name

They can have a number anywhere except the start

Comment thread src/content/docs/intro-to-java/java-fundamentals.mdx Outdated
Comment thread src/content/docs/intro-to-java/java-fundamentals.mdx Outdated
Comment thread src/content/docs/intro-to-java/java-fundamentals.mdx Outdated
Comment thread src/content/docs/intro-to-java/java-fundamentals.mdx Outdated
Comment thread src/content/docs/intro-to-java/java-fundamentals.mdx Outdated
Adrianamm and others added 3 commits June 19, 2026 15:53
@Adrianamm Adrianamm changed the title Stage 0: Operators Stage 0: Operators + Java Fundamentals Jun 20, 2026
@samfreund samfreund force-pushed the main branch 16 times, most recently from ea813ca to f514f00 Compare June 30, 2026 04:58
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

🌐 Preview URL: https://pr-20.frcsoftware.pages.dev

@roboteer5291 roboteer5291 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Java fundamentals looks good.

I didn't call out the instances of this, but in line with what's standard convention and used in the rest of the course, variables used in the operators section shouldn't be capitalized.

Also, maybe we should include all references to variables names and operators in single tick code blocks? If we do this throughout the course, that may help call things out better and improve readability.

Comment thread src/content/docs/learning-course/intro-to-java/operators.mdx Outdated
Comment thread src/content/docs/learning-course/intro-to-java/operators.mdx Outdated
Comment thread src/content/docs/learning-course/intro-to-java/operators.mdx Outdated
Comment thread src/content/docs/learning-course/intro-to-java/operators.mdx Outdated
Comment thread src/content/docs/learning-course/intro-to-java/operators.mdx Outdated
Comment thread src/content/docs/learning-course/intro-to-java/operators.mdx Outdated
Comment thread src/content/docs/learning-course/intro-to-java/operators.mdx Outdated
Comment thread src/content/docs/learning-course/intro-to-java/operators.mdx Outdated
Comment thread src/content/docs/learning-course/intro-to-java/operators.mdx Outdated
Comment thread src/content/docs/learning-course/intro-to-java/operators.mdx Outdated
Adrianamm and others added 2 commits July 11, 2026 20:50
Co-authored-by: Andrew Haselton <13470989+roboteer5291@users.noreply.github.com>
@Adrianamm Adrianamm requested a review from roboteer5291 July 12, 2026 02:13

<Aside type="note">
When dividing two integers, the result will be an integer instead of a
double. Example: ```java System.out.print(7 / 2); ``` The example above will

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove java from code block, this should be a single-tick (inline) code block too


```

## Comparison Operators

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Examples in this section still need to be refactored to use lowercase variable names


```

## Logical Operators

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lowercase variable names here too


## Logical Operators

Logical operators are symbols that let a program make decisions by combining true or false statements.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Logical operators are symbols that let a program make decisions by combining true or false statements.
Logical Operators are symbols that let a program make decisions by combining true or false statements.


```

## Logical Operators

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should include a note about order of operations and parenthesis for these

System.out.println(--y);
// [/increments]

// [arithmetic]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here and below needs refactoring to lowercase variable names


In the example below, we have two variables.

```java stage0/snippets/operators.java#increments

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refactor to have x++ and y++ on own lines (as discussed)

<summary>Answer</summary>
<div class="content">
<p>
* false. && returns true if both statements are true. `AnswerTwo` is

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bullets borked

<summary>Answer</summary>
<div class="content">
<p>
* `answer1` is 6 because 2 + 4 = 6 * `answer2` is 2 because 6 / 3 =

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bullets borked

// [/multiplication]

// [increments]
int x = 6;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refactor to have x++ and y++ on own lines (as discussed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FRC Software Stage 0

3 participants