Coding at Home: April 16th

UPDATE!!

Due to unforeseen circumstances, we weren’t able to live stream the coding session today.

We will be live tomorrow (Friday, April 17th) with bells on*.

*Warning, no actual bells will be worn.

We’re live at 1pm today, catch us on Twitch!

Logical Operators Return!

As with many of our sessions lately, yesterday’s was meaty. Logical operators are a whole new level in our programming toolbox.

We have the NOT operator, which is an exclamation mark (!) in front of a boolean variable, like !isOnGem. So if we are on a gem, that whole statement, the exclamation mark and all, will return false. Confusing? Sure, maybe a little. But we’ll get it with practice.

Then there’s the AND operator, which is two ampersands together (&&). This tests to see if both values are true. If one of them is false, the test will fail and return false. In code, it would look something like this: isOnGem && isBlocked. The only way this returns true is if we are on a gem and we’re also unable to move forward (that’s what the isBlocked tests).

Lastly, there’s the OR operator, which is two pipes next to each other (||). In this case, if one of the values is true, we’ll return true. The code looks like this: isOnGem || isBlocked. In this case, if either case is true… if we’re on a gem or we’re unable to move forward… or even both are true, we’ll return true.

Deep Breaths

The puzzles will require a bit of patience and sometimes a bit of trial and error to get a feel for combining conditions. But that’s what we’ll be practicing today.

Hopefully a few of the tricks we use to visualize the concept of logical operators will help you in today’s session!

See you at 1pm!

Coding at Home: April 15th

Our saga continues today at 1pm, Irish time!

Recap

We have covered a ton already this week, with our functions with added flair. You’ve been writing (and using) code that is super powerful because we can pass in parameters that change what the function actually does.

Hopefully you were able to build your own amazing game of Rock, Paper, Scissors. In our own version above we might have cheated a little by making an unbeatable unicorn. What did you do? Feel free to email us your creations at [email protected].

Logical Operators

Today we start on Chapter 8 of Everyone Can Code Puzzles, Logical Operators!

We’ll be talking about booleans again: values that are either true or false.

We’ll be introduced to the NOT (!) operator, which turns a boolean value into its opposite value. The AND (&&) operator, where two boolean values must be true for the condition to be true. And the OR (||) operator, which tests two booleans and if one of the booleans is true then the condition will consider itself true and execute that branch of the condition.

What this all means is that our conditions get can more sophisticated. With logical operators it allows us, especially with the && and || operators, to test multiple conditions at once.

We mentioned in the conditional coding session the example of deciding whether you need an umbrella or not.

Here in Ireland, you might check to see if it’s raining AND if it’s not too windy then you would bring an umbrella, otherwise, you would leave the umbrella at home.

We’d write that condition a little like this, if it were code:

But that’s all ahead of us today! See you at 1pm!

Our Live Sessions Setup

We don’t have it quite perfect (yet), but we’re pretty happy with our live streaming setup for our live coding sessions (weekdays at 1pm, Irish time).

Since we toyed with a few variations on the tech, we figured we’d write up what we went with, in the end, in case anyone else found it useful.

The Session

The basic session is about half an hour of coding and working through the material in the Everyone Can Code Puzzles book from Apple in Swift Playgrounds on an iPad. I tend to give a brief intro, on camera, to the session, then we dive into the iPad for exercises and illustrations of that lesson’s concepts.

It’s designed for kids from age 8 or so to 108, so long as they have an iPad and an internet connection. Ideally you’d have another screen, like a TV or laptop or other iPad to watch the coding session on while you follow along on the iPad.

The course material is geared towards people who have a limited understanding of what coding is. It introduces computing concepts in as painless a way as possible and is a great intro to programming.

The Gear

For the basics we have a MacBook Pro from 2015 running Catalina and a couple of our 2016 iPads we use in our Code Hub classroom for Swift Playgrounds and the Books app (and occasionally a couple Keynote slides). And I have an iPhone X that I use as my camera.

The recording setup

I bought a Shure MV 5 a few years ago and it works like a champ for a good quality external mic. The mic is just off camera, pointed at my face, and it’s very near where I work through the day’s code on the iPad.

I also have a 7-port, powered USB hub for charging and maintaining The Code Hub iPads, and it’s been pressed into service as my hub for connecting the iPads and iPhone, which has been a life saver if I need to change between multiple iPads and have all the other stuff connected, too.

Lastly, I have a USB-powered light/phone holder from TK Maxx (I still find it weird to say or type TK and not TJ). We bought it for a lark just before things shut down, but it’s been pretty great for lighting video calls and the sessions, as well as a camera mount.

The Software

I’ve floundered around most with the software for our setup, for sure. I tried a number of streaming apps for the Mac, including some that did multi-streaming, but in the end I really like OBS Studio’s feature set.

In the beginning, I just used OBS to stream to Twitch, and I used the scenes to switch between different elements, like an image I captured of a Keynote slide for the intro, video capture from my phone, connected by USB, just from the normal camera app previewing me, then the screen capture from the iPad.

Now I think I’ve got it a *little* better. I use OBS Camera, which has a plugin for OBS Studio and an app for the phone, which presents a much better video feed of me. My scene switching has gotten a little better, but I’m sure there are loads of tricks I’m missing.

OBS Studio is configured to save the recording to disk as well as stream it, in mkv format, which YouTube will accept. After each session I upload the saved video to YouTube and chuck it in the kids.code() playlist.

I watched this video to help me use the software a little better (but I could probably do with watching it again:

Audio Setup

Like I said, I’m not 100% sure I have my audio setup perfect, but it’s working well, for now.

I disabled my laptop’s mic and just use the external mic for my audio. I also mute the OBS Cameria mic, as you can see in this screenshot:

My opening Scene is the intro screen, which is just an image, that I put up when I start the stream. The Intro 2 group is my camera and a link screen I usually prepare the morning of the session with some tips for the day.

Once I’ve finished the intro I select Scene 3, which is the iPad(s), and I transition to that, and I’m off camera for the duration.

We’ve chucked a duvet up on an old clothes rack from Argos to help out with audio quality, and it does seem to damp the echo down a bit.

And that’s it! It’s not the most sophisticated stream in the world. It’s not the slickest. But I can run my classes online now, and I’ve had a ton of fun doing it.

Coding at Home: April 14th

Welcome back! We’re live streaming again today on Twitch, and you don’t want to miss this session, it’s one of my kids’ personal favorites!

Today’s Session: Functions with Parameters

We’ll keep going with our final playground page in Learn to Code 2 about functions with parameters today. We started on the page yesterday, but today we’ll finish off one of the few possible solutions, and then we’ll move on to yet another new playground.

Let’s Play a Game

After that quick review we’ll move on to our new playground: Rock, Paper, Scissors.

This is an amazing playground for encouraging interaction amongst your students and creativity. The students will build their own game of rock, paper, scissors with emoji and battle it out!

It’s usually one of the more engaging sessions in a class, and hopefully that translates to home, as well.

We’ll see you today at 1pm!

Coding at Home: Week Four

Can you believe you’ve made it to week four? This is a gigantic effort! While it’s true that #EveryoneCanCode, it’s not easy. It requires practice and a lot of patience.

We’re back today for the live coding session on Twitch at 1pm Irish time.

And if you feel like you’re a little behind, need to catch up, or just want to re-watch a session, you can always use the kids.code() playlist.

Recap

Last week we discussed two heavy topics: Types (and Initialization) and Functions with Parameters.

The syntax that we’ve learned so far gets a little funkier when we add these things into the mix.

Our homework over the weekend was to figure out a better way… or maybe just a different way, to write the function in the screenshot above.

Did you manage to come up with something better?

What’s Up This Week

We’re going to keep going with Functions with Parameters this week. Over the Easter weekend (which is still on here in Ireland with Easter Monday) we threw together a little addition to our Holiday Turtle Graphics playground.

In the new chapter, following our usual Christmas one, we’ve added two new egg-decorating pages. This chapter uses the more involved Turtle Graphics functions, so it shows off both instances of a type and a function with a parameter.

It’s available from The Code Hub’s playground feed, and will show up automatically in Playgrounds if you’ve already subscribed to the feed.

Later…

Later in the week we’ll move on to Logical Operators, which sounds like a particularly geeky band. They’ll really make our earlier lessons with conditional coding start to sing.

We hope to see you with us today at 1pm!

Coding at Home: April 10th

We’re back for day fourteen of coding at home, live today at 1pm, Irish time!

Recap: Types, Types, and More Types!

We’ve spent the last three days going over types in Swift. We could spend another couple dozen, easily, going over types, because they’re such a big part of Swift with a lot of fun aspects to explore.

If you feel like you need more practice we gave you some good pointers yesterday, in the Learn to Code 2 playground, and our work in the Shapes playground should provide you a lot of opportunity to work on initializing instances from types.

Functions with Parameters

As bad as “Initializers” sounded in the previous chapter, “Functions with Parameters” sounds like something Doctor Who might be attacked by.

But we’ve seen (and used) functions with parameters before! In the Turtle Graphics playground, we called the function forward() with a number in between the parentheses to specify how far we wanted the turtle to move forward. Or we used the right() or left() functions with a number to specify the number of degrees we wanted the turtle to turn.

We created functions in previous work because we found ourselves repeating a certain set of tasks. And it made sense to group the code together so we could call it by using just one function call.

By creating (or using) functions with parameters we’re just making our code even more useful.

We’ll spend our time today in a Turtle Graphics playground and the Learn to Code 2 playground.

Feedback

If you can, please fill out our six question, very informal, very anonymous survey so we can get a bit of feedback on the sessions so far.

And if you have any work you’re particularly proud of, feel free to email it to [email protected], we’d love to see your stuff!


Remember to wear your Easter best, bring your iPad and Learn to Code 2, we’ll see you at 1pm!

Coding at Home: April 9th

Live stream, today at 1pm Irish time: https://twitch.tv/thecodehub or catch up on the kids.code() playlist on YouTube.

More Types

We’re going to go over types and initializers (chapter 6 of Everyone Can Code Puzzles) one last time today. It’s a deep subject, and a bit of a shift from our previous lessons, which is why we’re spending a few days on it.

We saw one student use two turtles to draw the picture above, each instance of a turtle taking responsibility for drawing a different part of the picture. This is a nice use of instances to divide up tasks. A lot of what we’re covering these days is about organizing our code.

If you practice your Types and Initialization playgrounds you’ll get a ton of work on organizing your code. I would recommend “Setting the Right Portal” for practice with setting properties on instances. For organizing your code, the “Train Your Expert” page is excellent.

The Anatomy of a Type

Lastly, we looked at how a type is constructed, just to have a look at the guts of what we were doing.

For kicks, we designed a Dog type. This is something you might do if your code was part of an application that cataloged dogs… or trained them. We defined a property, called name, and a method, called chaseStick().

The point of this exercise wasn’t for us to go off creating our own types now. It was just to give you an idea of how types are constructed to demystify the code you’ve been using so far.

Today’s Session

For today’s session we’re going to dive into another new playground, called Shapes.

This will be our last stop in Chapter 6 of Everyone Can Code Puzzles. We’ll get to see a few new types, create some instances, and interact with those instances.

See you at 1pm!

Coding at Home: April 8th

We’re live again today at 1pm, still talking about types!

Recap: Types Everywhere!

We went through a LOT of stuff yesterday. A whole new concept with some fancy new language and new ways of writing code.

If we think about our playgrounds so far, we’ve been dealing with lots of different types:

  • Our character, who navigates around the puzzle, is a type
  • Portals are a type
  • Tiles are a type that have an isOnGem and isOnClosedSwitch property

Many of these things, so far, have been hidden to us, to ease us into coding. But as we go on, we’ll see types, and especially instances, in use everywhere in the code we’re writing and reading.

In other playgrounds we’ve used, like the Turtle Graphics playground, the turtle itself (which is a monkey, in our case) is an instance of a Turtle type.

Our Turtle type has certain properties, but what we’ve been using it most for is to perform certain actions, by calling methods on the instance. forward(), left() and setColor() are all functions on our type.

We’re going to explore turtles a little more in today’s lesson and we’re also going to open up a type and show you what the guts look like.

Types: Working with Blueprints

We’ll see how useful types are and use them as another way to organize our code.

So join us at 1pm today!

Coding at Home: April 7th

Join us for our live session today at 1pm on Twitch!

If you’re just joining us for the first time, feel free to watch through some of our earlier sessions. The sessions are relatively short (30 minutes or so) and gently walk you through the playgrounds to get you oriented. The kids.code() playlist on YouTube is a great place to start. We’ve even posted a new “Getting Started” video to help you get the right apps and content on your iPad before you start viewing.

Today’s Session

Today we’ll be starting a new concept: Types and Initialization.

This might sound a little daunting, but we’ll try and ease our way in.

We’ll be using the Learn to Code 2 playground again, so make sure you have that downloaded to Swift Playgrounds.

Types are yet another way for us to organize our code, and a way others have organized their code for us to use. Just like functions and loops and conditions before them, we can construct types many different ways, but we’ll try and show off a few techniques in today’s session.

Elsewhere

We’re featured on Everywhere School today, which is a great place to find live, upcoming streams of educational content that is super entertaining. I highly recommend checking it out!

See you at 1pm for Types and Initialization!

Coding at Home: Week Three – April 6th

We’re back again today at https://www.twitch.tv/thecodehub at 1pm Irish time!

Recap: Week Two

We covered a ton last week. We started with for loops and then moved on to variables. And then we dropped smack dab in the middle of conditionals! It was a busy week, with so, so much to remember.

We set up a discussions board with some common areas of discussion. Just register and post away! If that doesn’t work for you, you can always drop me a line or you can try joining the Code Hub’s Google Classroom with the code: mnynk52

If worse comes to worse and you need help with the lessons you can always contact me through our website.

Today’s Session: More Conditionals!

Hopefully you’ve all done your homework and we’ve got one quiz a student wrote over the weekend with some advanced features in it.

I’m going to walk through it with you. We’ll explore how the student handled answers in the quiz (including some of those more advanced moves). We’ll also take a look at how we solved problems with the code and did some real heavy-duty troubleshooting.

Conditionals, Loops, and Functions, Oh My!

There are 5 additional playground pages in Learn to Code 1 we talked about doing over the weekend, all to do with conditionals and building on our knowledge.

We’ll cover those today and see if we remember where we left off on Friday.

The Rest of the Week

This week is another big week with a lot of weighty topics, so buckle in, get plenty of sleep, eat a healthy lunch, and let’s get coding!

See you at 1pm, Irish time!