1. E X T R A C U R R I C U L A R S W I F T S A L LY S H E PA R D / / @ M O S T G O O D
2. T H E O P P O RT U N I T Y Lots of people will talk to you about Swift.Theyll talk to you about type safety, relying on the compiler and optionals.Theyll talk to you about functional patterns.Theyll talk to you about functions as rst-class objects.I want to talk about the potential of Swift in learning.About using its clear, concise syntax to teach the concepts and practices of programming.
3. T H E N E E D But why? Why teach kids to code?Learning to code does not mean funnelling every child into a job as a programmer. By the time they are adults the landscape will have changed probably beyond our imagination. The real benet of teaching kids to code is to pass on skills that are useful in many other paths through life. Ordered thinking, problem solving, abstraction and attention to detail are general skills that benet any occupation.
4. B R I D G I N G T H E G A P Resources in schools are often limited, and it's dicult for teachers to not only maintain knowledge of technology but to also learning new technologies.Because of this, its essential to have ways of complimenting the current curriculum.When I heard about this after school club for teaching children to code, I really wanted to get involved.So a few months ago I went to a code club induction session, super-excited about the possibility of teaching kids to code.
5. W H AT I S C O D E C L U B ? W W W. C O D E C L U B . O R G What is code club?-For children aged 9-11-Volunteer-led after-school coding club.-For one hour a week, kids get to learn to program starting with Scratch and working their way up through HTML and CSS up to Python.
6. E X T R A C U R R I C U L A R After-school clubs are often the only place where children can discover what is going on behind the games they play. It's great for them because they are not forced to be there, they want to be there, it creates a dierent relationship for them.We are a huge, untapped, reservoir of knowledge and enthusiasm that can make a real dierence.I love that we are a passionate, excited and friendly community and I think it would be amazing to leverage that excitement and pass it on to a new generation of programmers.
7. C O D E C L U B C U R R I C U L U M I wanted to spend some time working on helping kids learn to code, but I couldnt commit to running a club.Ive been looking at the Code Club tools and examining them as a framework for how Swift could be an amazing tool for learning.Before I get into what Ive been working on, I want to give you a brief overview of what gets covered in code club.
8. H T T P : / / S C R A T C H . M I T. E D U S C R AT C H The rst two terms involves using Scratch to build programmatic structures like loops and conditions with coloured blocks and immediately see the results on the screen.Its all drag and drop, so it really focuses on learning logic without having to also learn a language.Its mostly targeted at simple game mechanics as a way to get children interested.
9. H T M L & C S S After completing Scratch, the students can move onto a term of HTML and CSS.They get to build some simple websites and learn how to style them.
10. P Y T H O N Finally, they get to learn Python.It builds well o of everything theyve learned so far, but focuses on learning more about programming languages.The lessons for the rst term of Python include:Printing text, catching errors, variables, data types, conditionals, loops, using libraries, collections.It provides a decently comprehensive introduction to structures and data types.Id like to take a moment to look at the Python language and tools and why they make a good choice for learning.
11. W H Y P Y T H O N ? So why choose Python for learning?Simple, clear syntax: -theres no division between primitives and objects.-no complications around pointer notation and memory management.Focuses on what-to-do not how-to-do-it.Widely available:-free to obtain and ships with most OS.Wide selection for functions like math, drawing etc..And it has a choice of interaction methods.Theres Python IDLE. This is the method of choice for Code Club.And There are also Web-based tools.So now we understand the basis for using Python, lets take a look at Swift in comparison.
12. S W I F T A S A N A LT E R N AT I V E Swift embraces most of the points that made Python a good choice: Simple syntax, focus on what over how, great library support from Foundation and UIKit, and some choices as to how to interact with it.In less than a year, Swift has become hugely popular, just imagine where it will be in 5-10 years.
13. A C C E S S I N G S W I F T There are three main ways to access Swift-Xcode-REPL-Web-based tools
14. X C O D E Xcode gives you access to full projects and playgrounds.Playgrounds allow you to use a huge spread of libraries and features to live code anything from Hello, world up to Scene Kit 3D game views.
15. R E P L The closest match for the Python IDLE is the Swift REPL. This can be access by typing swift on the command line and requires at least that the Xcode Command Line tools package be installed. The REPL allows commands to be typed and executed immediately, referencing previously typed declarations and commands. Alternatively you can pass in a Swift le at the command prompt and have it executed automatically. You can also specify command line arguments, which can be accessed via Process.arguments
16. W E B - B A S E D T O O L S W W W. R U N S W I F T L A N G . C O M There are also some great web-based resources for running Swift, like runswiftlang.com. They are restricted to using Foundation only and so you do not have access to UIKit.The big advantage of this is you can run it on any computer that has access to the internet and you dont need to install any software or tools.
17. T H E C H A L L E N G E S There are some challenges to overcome before Swift can be embraced as a learning tool.
18. E N V I R O N M E N T A N D FA C I L I T I E S The biggest problem is schools dont usually have Macs, schools are most likely to have PC hardware running Windows. There are usually safeguards in place to limit accessing content outside of the school network and restrictions on installing additional software on any of these machines. At the end of the day, there is a potential roadblock around either needing Mac hardware to fully engage with Swift or using Web-based tools and accepting the limitations they have.Outside of having direct access to macs or using web-based tools, there are some other options Ive looked into.
19. S S H I N T O A S I N G L E M A C T O R U N R E P L You can SSH into a mac to run the REPL.Here youd use a single Mac with Xcode Command Line Tools installed, either added to the local network or remotely located and accessible through the rewall as a server and open up SSH sessions in a command line on any platform to access the REPL.The diculties with this are youd still need a Mac somewhere and you wouldnt have access to Playgrounds.
20. A C C E S S I N G A M A C V I A V N C You could also give visual access to a Mac to use Playgrounds across VNC or other Screen Sharing technology.Again, with this option youd still need a Mac somewhere and there could be performance issues, but you would have access to Xcode, Playgrounds and REPL.
21. R U N O S X I N A V I RT U A L M A C H I N E Run OS X in a virtual machine. This would enable both Xcode and REPL access.But, this would require the school to keep Xcode up to date, and for their IT team to know how to use Macs. This could also have performance issues since most computers in schools are not designed to run Xcode.
22. C O R P O R AT E S P O N S O R S H I P Get some corporate sponsorship to nance a small mobile mac lab.It means you dont have to interfere with the schools hardware or network.You would still have to deal with individual schools requirements over what software is installed on the machines, how its monitored and who is in charge of upkeep.
23. L I M I TAT I O N S O N I N P U TThe REPL and Playgrounds are missing one signicant feature that Python possess.And thats an way to easily capture input from devices, commonly standard input from the keyboard. This input allows interaction with running code, and that immediate feedback is a great way of providing a reward for work when children might have a small attention span.Although REPL has access to command line arguments, this is still limited and not in real time during execution.
24. W H AT A B O U T W I N D O W S ? Use your skills and imagination to build tools to make using Swift easier in other environments. Could you make playgrounds that work on Windows?Or a more full-featured web-based tool?
25. G O G E T I N V O LV E D Kids need the opportunity to learn from coding, not just for the next generation of programmers but also as general life skills.Swift is an amazingly suitable language to use to help kids understand the concepts and practices of programming.The tools are still maturing and need our input and innovation to reach the ubiquity of other languages.Our community is so ideally placed to make a dierence to the education and abilities of children, we owe it to them to make the eort.
26. H O W T O G E T I N V O LV E D There are a number of organisations for supporting this, but these are the two Im most familiar with:Code Club and Stemnet.
27. R U N A C O D E C L U B You can run a club: you dont have to do this on your own, in fact its better to get a few volunteers to run a club.There will also be a teacher with you at all times.Try to get your employer to agree to send a few peopl