<p>What I like to do is to first teach them the code that will actually make the robot move/do whatever it's supposed to do, then from that point I'd teach them the structures that can be used to make it more interesting.</p>

<p>For example, if the motor is represented by the <code>DcMotor myMotor</code>, I'd first go with the simple <code>myMotor.setPower(1)</code>, just to get them to have a moment where they actually made it do something. From there, I'd add things like looping and I'd teach it the same way I'd teach it to other students, but here the thing being done might be checking the controller for changes in input to change the power for the motor.</p>

<p>Another route you could try (since the context is FIRST) is teaching <code>myMotor.setPower</code> first, then carrying on by explaining all the template code which surrounds it. The <a href="https://github.com/ftctechnh/ftc_app" rel="nofollow noreferrer">FIRST repo</a> has a template of the code you can use, and explaining to students how it works could be a useful teaching tool.</p>

<p>I also disagree with your premise that "there is a need to find ways to teach necessary concepts before diving into programming the robot itself." As someone on a small FIRST Tech Challenge team, I was the first person who actually learned to code the robot. The way I learned was first by copy pasting things from the various templates provided and using Android Studios suggestions. From there, I found out about how to do various other concepts from the google.</p>

CC BY-SA 3.0
2017-06-04T10:58:19.337Z
This isn't exactly what I meant in my question... but it does give me a better idea how teaching these things could be done, so thanks for that. Regarding the last paragraph: As mentors, we want to guide the students and teach them in a way that would be useful for them later. Students who learn these things on their own are more than welcome, but they are a minority.
ItamarG3
CC BY-SA 3.0
2017-06-04T11:00:33.133Z
Oh whoops. What else would you like for me to try to address?
thesecretmaster
CC BY-SA 3.0
2017-06-04T11:04:34.503Z
"programming concepts be taught in relation to the context". Teaching the concepts through the robot programming. The idea is a way to teach programming concepts, with orientation to some context.
ItamarG3
CC BY-SA 3.0
2017-06-04T10:25:41.953Z
2017-06-04T10:25:41.953Z
thesecretmaster
<p>Based on my two years of involvement with FIRST, I have a few suggestions:</p>

<ol>
<li><p><strong>Teach students to read the documentation.</strong> <a href="https://wpilib.screenstepslive.com/s/4485/m/13809" rel="nofollow noreferrer">This site</a> covers Java programming for the 2017 FRC Control System. FIRST programming, while requiring general programming skills, is specialized for the roboRIO and for the competition as a whole. We ran into a couple issues this year whose solutions were found by methodically reading through these documents. There can be a rush to jump right to coding, but it is essential to understand the WPI library and its API fully. This also serves the purpose of seeing which programmers have the discipline to follow documentation to the letter. Having the patience and thought to do so is a necessary condition for being a successful programmer.</p></li>
<li><p><strong>Use a simple chassis for coding/driving practice.</strong> Each year's game has its unique twists and challenges. However, underneath the superstructure  is a drive base that in many cases can be used from year to year with slight modifications. Treat this as essentially a learning robot. Give it working code, let students drive it, then teach the code itself. Make changes from one run to the next. Since the code has immediate, real-world consequences, show the results of minor changes in action. This way you can then go back to the classroom/IDE knowing that students have a context in which to operate. Have them observe and reflect on what happens from run to run when one variable, say, is changed.</p></li>
<li><p><strong>Research other teams' code.</strong> Most, maybe all, strong FRC programs have well-developed websites and numerous GitHub repositories. Look at best practices from these teams. Reach out to them. Have students try to read and understand their code.</p></li>
</ol>

<p>Ultimately, students need to know Java, and understanding classes and objects, inheritance and polymorphism, will be as needed with FRC as anywhere else. However, to help them see how Java applies specifically to FRC, start with something that drives and work backward from there. Maybe start with #2, move back to #1, and lead them to #3, maybe even with examples you have found of how teams use the WPI library in different ways. </p>

CC BY-SA 3.0
2017-06-05T07:45:15.767Z
2017-06-05T07:45:15.767Z
Peter
<p>Teaching programming is a great part of mentoring FRC (FIRST Robotics Competition) teams. For teaching how to program a robot (Specifically, a <a href="http://www.ni.com/en-il/support/model.roborio.html" rel="nofollow noreferrer">RoboRIO</a>), I first (unintended pun: <a href="https://www.firstinspires.org/" rel="nofollow noreferrer">FIRST</a>) need to teach various paradigms (OOP, Generics etc.). There is a need to find ways to teach necessary but general concepts before diving into programming the robot itself (e.g. motor controls and such). </p>

<p>Teaching Java paradigms in the classical and rather abstract sense usually confuses the students because they don't see any connection to robotics. As a result, students have difficulty understanding the subject (they aren't exactly at a level to learn that, so older team members try to teach it in a way that would make it easier). If they saw how these concepts integrated into programming the robot, then they would hopefully understand the subjects and their applications better.</p>

<p>So my question is this: how can I teach those programming concepts in the specific context of FIRST Robotics? </p>

<p>The students have a bit of experience with loops and types, but nothing more complex. </p>

CC BY-SA 3.0
2017-06-04T09:49:07.730Z
This sounds a bit too general to be easy to answer. What part of this problem is really difficult, or different from what you're familiar with?
Sean Houlihane
CC BY-SA 3.0
2017-06-04T10:41:29.890Z
@SeanHoulihane edited to add that
ItamarG3
CC BY-SA 3.0
2017-06-04T10:49:53.893Z
Thanks, Its a bit clearer now. Still seems a little like an X-Y problem https://meta.stackexchange.com/questions/66377/what-is-the-xy-problem but I think it's easy enough to answer.
Sean Houlihane
<java><frc><robotics><first>
Teaching coding paradigms and concepts with specific context
# Teaching coding paradigms and concepts with specific context

(Asked by: username_0 on 2017-06-04)

Teaching programming is a great part of mentoring FRC (FIRST Robotics Competition) teams. For teaching how to program a robot (Specifically, a [RoboRIO](http://www.ni.com/en-il/support/model.roborio.html)), I first (unintended pun: [FIRST](https://www.firstinspires.org/)) need to teach various paradigms (OOP, Generics etc.). There is a need to find ways to teach necessary but general concepts before diving into programming the robot itself (e.g. motor controls and such).

Teaching Java paradigms in the classical and rather abstract sense usually confuses the students because they don't see any connection to robotics. As a result, students have difficulty understanding the subject (they aren't exactly at a level to learn that, so older team members try to teach it in a way that would make it easier). If they saw how these concepts integrated into programming the robot, then they would hopefully understand the subjects and their applications better.

So my question is this: how can I teach those programming concepts in the specific context of FIRST Robotics?

The students have a bit of experience with loops and types, but nothing more complex.

**Tags:** java, frc, robotics, first

> **Comments:**
> **username_1**: This sounds a bit too general to be easy to answer. What part of this problem is really difficult, or different from what you're familiar with?  
> **username_0**: @SeanHoulihane edited to add that  
> **username_1**: Thanks, Its a bit clearer now. Still seems a little like an X-Y problem https://meta.stackexchange.com/questions/66377/what-is-the-xy-problem but I think it's easy enough to answer.  

---

## 2 answers

### Answer by username_3 on 2017-06-05. Score: 4 | Accepted answer

Based on my two years of involvement with FIRST, I have a few suggestions:

1. **Teach students to read the documentation.** [This site](https://wpilib.screenstepslive.com/s/4485/m/13809) covers Java programming for the 2017 FRC Control System. FIRST programming, while requiring general programming skills, is specialized for the roboRIO and for the competition as a whole. We ran into a couple issues this year whose solutions were found by methodically reading through these documents. There can be a rush to jump right to coding, but it is essential to understand the WPI library and its API fully. This also serves the purpose of seeing which programmers have the discipline to follow documentation to the letter. Having the patience and thought to do so is a necessary condition for being a successful programmer.
2. **Use a simple chassis for coding/driving practice.** Each year's game has its unique twists and challenges. However, underneath the superstructure is a drive base that in many cases can be used from year to year with slight modifications. Treat this as essentially a learning robot. Give it working code, let students drive it, then teach the code itself. Make changes from one run to the next. Since the code has immediate, real-world consequences, show the results of minor changes in action. This way you can then go back to the classroom/IDE knowing that students have a context in which to operate. Have them observe and reflect on what happens from run to run when one variable, say, is changed.
3. **Research other teams' code.** Most, maybe all, strong FRC programs have well-developed websites and numerous GitHub repositories. Look at best practices from these teams. Reach out to them. Have students try to read and understand their code.

Ultimately, students need to know Java, and understanding classes and objects, inheritance and polymorphism, will be as needed with FRC as anywhere else. However, to help them see how Java applies specifically to FRC, start with something that drives and work backward from there. Maybe start with #2, move back to #1, and lead them to #3, maybe even with examples you have found of how teams use the WPI library in different ways.


---

### Answer by username_2 on 2017-06-04. Score: 1

What I like to do is to first teach them the code that will actually make the robot move/do whatever it's supposed to do, then from that point I'd teach them the structures that can be used to make it more interesting.

For example, if the motor is represented by the `DcMotor myMotor`, I'd first go with the simple `myMotor.setPower(1)`, just to get them to have a moment where they actually made it do something. From there, I'd add things like looping and I'd teach it the same way I'd teach it to other students, but here the thing being done might be checking the controller for changes in input to change the power for the motor.

Another route you could try (since the context is FIRST) is teaching `myMotor.setPower` first, then carrying on by explaining all the template code which surrounds it. The [FIRST repo](https://github.com/ftctechnh/ftc_app) has a template of the code you can use, and explaining to students how it works could be a useful teaching tool.

I also disagree with your premise that "there is a need to find ways to teach necessary concepts before diving into programming the robot itself." As someone on a small FIRST Tech Challenge team, I was the first person who actually learned to code the robot. The way I learned was first by copy pasting things from the various templates provided and using Android Studios suggestions. From there, I found out about how to do various other concepts from the google.

> **Comments:**
> **username_0**: This isn't exactly what I meant in my question... but it does give me a better idea how teaching these things could be done, so thanks for that. Regarding the last paragraph: As mentors, we want to guide the students and teach them in a way that would be useful for them later. Students who learn these things on their own are more than welcome, but they are a minority.  
> **username_2**: Oh whoops. What else would you like for me to try to address?  
> **username_0**: "programming concepts be taught in relation to the context". Teaching the concepts through the robot programming. The idea is a way to teach programming concepts, with orientation to some context.  

---

