Coding at Home: July 1st, Sonic Workshop #2

We’re back with Sonic Workshop today at our usual time of 1pm, Irish time, join us!

Coding with Closures

Yesterday was a big session. We were introduced to closures and learned a little bit about what they are (unnamed functions, in a few words) and when we would use them. And how.

The closure we wrote had no parameters, so it’s one of the easier forms to use (and write).

You might remember, if you’re not scarred (😉), from the later chapters in the Swan’s Quest playgrounds, that we used closures a bit.

When we got to the Timer code we scheduled a timer and wrote some code to be run every so many seconds. We’re going to learn how to write code like that soon!

Today’s session

Today we’re going to go back to functions. Back in the Everyone Can Code Puzzles days, we learned a lot about functions.

In today’s lesson we’ll write functions that return values. This means we do some work in the body of the function and get give some sort of feedback back to the code calling it.

We’ll also write functions with parameters. This lets us write code that can easily be re-used. If you hang around programming long enough, you’ll realize that’s one of our Holy Grails.

We’ll put our function in some shared code, so it will live with us for the rest of the playground pages.

So come along with us at 1pm, Irish time! Or follow along later. We have a new Sonic Workshop landing page, which shows you videos from the Sonic Workshop YouTube playlist. All the videos in this latest series will show up there.

Leave a Reply

Your email address will not be published. Required fields are marked *