JoC #15: Object interaction (first encounter)

      The pure and simple truth is rarely pure and never simple.
            — Oscar Wilde

Today a long, and quite full episode. We encounter various very important concepts for the first time: local variables, class types and object interaction.

If you have questions left after watching this – don’t worry. We will look at all of this again in more detail in future episodes. And you can use the comments below to ask your questions (or make any other comments).

By the way, I just noticed I made a mistake. (Yes, that does happen!) There is a bug in the program that I’m writing in this episode. Can you spot it?

Download video

Concepts discussedvariable, field, local variable, assignment, class type, object interaction, external method call


JoC #14: A first look at variables

      I’m a great believer in luck, and I find the harder I work the more I have of it.
            — Thomas Jefferson

Let’s move on to another important concept: variables.

There’s a lot to say about variables, so we start with oner example: An int variable as a counter.

Download video

Concepts discussedvariable, field, int, ++


JoC #13: The structure of a class

      We know accurately only when we know little; with knowledge doubt increases.
            — Goethe

It’s time to pause a little bit with our code writing and analyse what we have so far. We want to make sure that we properly understand what’s going on.

So, today you’ll get a deeper understanding of code structure and – as a bonus – find out a bit about comments.

Download video

Concepts discussedclass structure, class header, comments

JoC, Teacher Commentary 10: Motivation and reflection

      You must be the change you wish to see in the world.
            — Mahatma Gandhi

After a few days’ pause, here’s another video. And it’s time for a teacher commentary again.

We’ve crammed in quite a bit of material over the last few episodes, and the question now is: Firstly, how do we keep motivation up? But more importantly, do the students actually understand what’s going on?

Some hints and tips what to look out for…

Download video

The Joy of Code: Now with video download

One interesting suggestion I received from a viewer out there about the Joy of Code video series is to make the videos downloadable, because YouTube is blocked in a number of schools.

That seems like an obviously good idea, so I’ve done that now. Under every Joy of Code video, you will now see a download link. (On some (most?) systems, just clicking the link plays the video in the browser, so right-click, and choose “Save Link As…” or the equivalent option in your browser.)

Another advantage of this is that you can play the video in its original resolution (without up- or down-scaling), which should give you good high-def clear text on screen.

JoC #10: It’s done: Play the game!

      Times are bad. Children no longer obey their parents, and everyone is writing a book.
            — Marcus Tullius Cicero

And now we’re getting to the point where you can actually control the turtle and play your game.

Download video

You can download the scenario source (as it is at the end of this episode) below. If you do: unzip first, and then open.

Concepts discussedKeyboard control, code completion, String type

Scenario download:  trick-the-turtle-v3.zip

JoC #9: Snakes on a plane!

      Satisfaction lies in the effort, not in the attainment; full effort is full victory.
            — Mahatma Gandhi

Things are start to heat up in our scenario: Snakes are chasing Trick (the turtle) over the plane. (That’s, of course, ‘plane’ as in ‘flat bit of ground’, not as in ‘flying thing’).

Download video

Concepts discussedHmm, don’t know. Creating yet another class. Copy-and-paste coding – is that a concept?

JoC #8: Keeping your code clean

      Always code as if the guy who ends up maintaining your code will
      be a violent psychopath who knows where you live.
          — John F. Woods

Here it is: The Joy of Code, Episode 8.

This time: housekeeping. No new functionality, but good coding practice. Enjoy.

Download video

Below is a version of the scenario to download as it is so far (at the end of this episode). If you haven’t been coding along with the previous episodes, but want to start here, use this version.

Concepts discusseddefining methods, code quality

Scenario download:  trick-the-turtle-v2.zip