What is an Algorithm?

What is an algorithm?

It’s a reasonably straightforward question isn’t it? But one that yields quite a few debates. I’ve written the following answer to ‘what is an algorithm?’ question based around the STEM computing classes with children.

First it helps I find it helps if you pretend you’re asking one of these to solve a problem; if you don’t tell them everything they get into a real mess!

Robot algorithm

 

An Algorithm is a precise set of instructions to solve a  problem*

For me, that gets to the heart of the definition: solving a problem in a precise manner.

The problem being solved could be as simple as calculating the number of times ‘as’ appears in this sentence or as complicated as finding the quickest route for a journey across rush hour London.

What’s interesting about algorithms and not obvious from their definition is that once created, executed and observed they can often be refactored/reused to solve other problems that require the same generic process to solve.

For example, I’ve lost count of the times I’ve written a function to solve a specific problem then subsequently refined and abstracted it slightly to solve a much broader range of problems, often implemented using polymorphism. This elasticity, once you recognise it, is for me, the root of writing maintainable code. e.g. In the example above, rather than searching for a specific word, you would refine the algorithm to search for any word. This is obviously beyond the stated curriculum but a nice example of a way to illustrate a seemingly abstract part of the curriculum.

I’ve been asked about efficacy a few times as part of the definition and my view is that its not part of the definition. Efficacy is important for Computing Science but it’s not part of the definition.

* As some children are pretty young, under 7,  we don’t talk about Turing machines. But I know a few people favour this addition to the definition and describe it as something that could be simulated by a Turing complete machine. Although I do wonder if we could somehow simplify and adapt this into the design and discussion of Turing machines…

Zac and The Neverland Pi-rates – Part 1

This is Zac. He loves Jake and the Neverland Pirates. I gave him a Raspberry Pi today and we’re going to mash them up!

 

Zac and the Pi - part 1
Zac and the Pi – part 1

He’s almost 4 and we’re going to turn his room into a treasure Island adventure with his Raspberry Pi.

Zac loves Jake and the Neverland pirates so I thought it would be fun to use the Pi in his room to create an interactive treasure map on his wall – one that changes the location of the treasure each time he plays!

Jake Neverland Pirates Treasure Map
Jake Neverland Pirates Treasure Map

I’ll document what we’re building over the next few weeks, the how to diagrams and of course any source code we write.

In the meantime feel free to ask any questions on twitter @danfbridge

 

Computing is not Programming

There’s a fair amount of “teaching kids to code is a [great|terrible] idea” style articles around at the moment. For example the Telegraph recently ran a piece titled “The Government wants to teach all children how to code. Here’s why it’s a stupid idea

It’s a bit Clarkson by numbers, which I think was the point, but there are valid points in there and it got me thinking about both sides of the argument. This a good thing.

We are picking up where we left off in the 1980’s in the way we introduce technology to our children – see Nesta’s Legacy of the BBC Micro report. It makes sense to continually evaluate it and make sure it’s right for them and not just right for election campaigns.

The specific aspect that’s feeding the articles comes from the misapplication, or misinterpretation, of Computing for Programming. It’s easy to see why as code is the “stuff” that makes a Computer do something. There’s a good parallel here with being able to read and write musical notation and its composition.

Code is often not the only end product of a lot of design, thinking and problem solving. The valuable end product is often not the code but the data it subsequently produces and increasingly in large volumes aka big data. Being able to understand, manipulate and secure it is important and that’s not the same thing as programming. This is why it’s important to see that being able to write code is really useful but:

Computing is not programming.

Programming is a part of Computing but there’s a lot more to the area of Computing than just instructing a machine with code. It’s also about other aspects such security, privacy, Internet architecture, distributed service and how this affects our social, commercial and global communication.

Computing, as far as we’re concerned as parents and consumers, is largely about the application and use of technology to make things easier for us e.g. receiving an email/photo to the other side of the world in seconds rather than waiting days for a letter, ordering consumables, etc

Academically, Computing exists to solve problems that are too large or too time consuming for our poor old monkey brains to handle – which is usually anything to do with large amounts of data and numbers. e.g. forecasting weather, analysing massive amounts of data from the Large Hadron collisions at CERN, or helping architects develop safer structures through modelling.

Computing is not Programming - Monkey Tools
Computing is not Programming – Monkey Tools

Speaking of monkey brains ,this is really the point of why it’s important Computing as subject needs to be taught from a young age in schools:

Humans are tool users and the Computer is the most advanced and useful tool we have.

We are all taught from a young age to use a fork and knife, but not all of us will be surgeons. I know, it’s a trite example (and I’m certainly not saying programmers are the surgeons of Computing – that’s UI designers for me 😉 but you get the jist, Computing is learning to use a tool and it’s not just about coding.

Here’s a real example:

I worked as a Software Engineer at Reuters in a small R&D team that programmed the Reuters Business Briefing products for web. When I say a small team, although there were only 3 programmers the real team was much larger. Working with us was a team of branding experts, User Interface designers, SQA testers, System Administrators, enterprise network architects, operations deployment engineers and product managers.

If you read back that roll call that worked to deliver what became an award winning product, the number of people writing code was pretty small.

The majority of the jobs on a technical project were clearly not programming. Though, if you talk to the majority of programmers they’d tell you that they’re doing most of the work. But we’re slightly biased!

This is where the educational aspect of Computing beyond coding can have a real impact. There are many great, interesting, important, jobs building products that don’t involve any coding. But what they all need is a solid understanding of Computing.

Why? Because if the research is correct, the next 7 years will see a massive amount of opportunity for our children if they’ve got the correct skills.

Computing Jobs By 2020
Computing Jobs By 2020

We Don’t Need Everyone To Code

We don’t need everyone to code. But we do need people to understand how Computers work and how to use them effectively.

For example, We need people who understand how to search for patterns in the noise of millions of database records, efficiently. How to configure and performance tune a web server so it can serve photographs of people enjoying themselves. And definitely make sure servers aren’t full of security holes – which are usually left open by sloppy programmers.

Code is often not the final destination in Computing.

The valuable end product is often not the code but the data it subsequently produces and increasingly in large volumes aka big data. Being able to understand, manipulate and secure it is important and that’s not always the same thing as programming.

Knife and Fork
Knife and Fork

We are all taught from a young age to use a fork and knife, but not all of us will be surgeons.

I know, it’s a lazy extrapolation (and I’m certainly not saying programmers are the surgeons of Computing – that’s UI designers for me 😉 but you get the jist.

Computing is learning to use a tool and it’s not just about coding.

Here’s a real example:

I worked as a Software Engineer at Reuters in a small R&D team that programmed the Reuters Business Briefing products for web. When I say a small team, although there were only 3 programmers the real team was much larger. Working with us was a team of branding experts, User Interface designers, SQA testers, System Administrators, enterprise network architects, operations deployment engineers and product managers.

If you read back that roll call that worked to deliver what became an award winning product, the number of people writing code was pretty small.

The majority of the jobs on a technical project were clearly not programming. Though, if you talk to the majority of programmers they’d tell you that they’re doing most of the work. But we’re slightly biased!

This is where the educational aspect of Computing beyond coding can have a real impact. There are many great, interesting, important, jobs building products that don’t involve any coding. But what they all need is a solid understanding of Computing.

Why? Because if the research is correct, the next 7 years will see a massive amount of opportunity for our children if they’ve got the correct skills.

Computing Jobs By 2020
Computing Jobs By 2020

Building A Programmable Game for GameCity.org – Day 2

A programmable game has to be the most fun way to learn to program so I’ve decided to build one for my Craft Computer workshop at GameCity.org [info on the Craft Computer here]

I’ve built it to tie in with the Craft Computer that my junior computer experts will build in the mornings. Once they’ve made their craft computers and learned about what makes computers “tick” they will get to write a program for their ‘MowBot‘. (Here’s the previous post on using Jeff Minter’s Hover Bovver as the inspiration for our  programmable games)

They’ll learn basic programming via Hover Bovver MowBot such as instructions and loops

This is what I’ve got running after Day 2. It’s a basic tilemap engine but today the sprites are programmable! Each sprite has a little stack and program counter which can be ‘hacked’.

See the vine for a quick clip – the little chap moving, is MowBot and he’s now being controlled by a program rather than the keyboard 🙂

Open Badges Should Be Used By Industry To Fill The Tech Job Shortage

There is a well documented supply shortfall of candidates for ‘tech jobs’. code.org/stats estimates this to be around 1m unfilled jobs by 2020.

I believe that Industry needs to solve this problem, not the education system, and it can do it with a collaborative set of Open Badges.

Programming Job Shortage
Programming Job Shortage

Mark Hartely’s post over at KPMG’s tech growth blog posits that to address this potential shortage ‘The UK education system needs to get with the program’.

His reasoning is that:

as the pace of technological change is so fast, I worry that these institutions risk falling further and further off the pace.”

I was about to tweet Mark with my agreement but something was bothering me, I couldn’t quite agree with him and this is why:

it’s not the responsibility of educational institutions to keep up with the insanely quixotic turns of technology industry

Nor can it realistically do so. If that code.org job shortage stat turns out to be correct, anyone with technical skill is going to be headhunted with extreme prejudice into industry, not academia. So the supply of quality teachers will shrink. As is the case right now.

So let’s reverse that stat and take the burden from the already creaking educational institutions. Let’s leave them to excel at what they do: progressing education and research as a rigorous academic discipline. Something that I believe should be one step removed from the madness of Internet speed innovation. This is an important role for our society and civilisation.

Academia should be Industry’s House of Lords. They should retain a healthy, if grudging, respect for each other!

Does the UK Industry need to get with the program?

I believe so and if you think about it, it’s the one best placed to do so, as it painfully understands what’s needed.

It’s Industry not Education that has to be the one to change and there are some fine examples of this such as Google’s Summer of Code, Mozilla.org’s webmaker, the very brilliant young rewired state etc

But what about traditional industry, why doesn’t Tesco, HSBC, KPMG, Carphone Warehouse or Virgin run summer of code camps? I’d love to get a group of kids hacking on a Tesco Clubcard API 😉

OPen Badges
Open Badges

If we take look at the fantastic Mozilla Open Badges initiative, UK Industry could come together and create an Industrial apprenticeship.

A combined Industry set of Open Badges could be the practical equivalent of a Computer Science degree.

With it we could fill that shortage quickly. With smart, tech focused students who want to work, learn and earn their qualification on the job. It would be globally portable and industry recognised.

It would by default meet the pace of new technology developments.

So let’s put that burden on private industry.

It was our industry that created this incredible opportunity for growth.

Let’s all go and help realise it.

Craft Computer – Create Your Own Computer Craft Kit PDF

Build your own craft computer with our PDF computer craft kit  – suitable for ages 5 upwards!

Craft Computer
Craft Computer Kit

Download Craft Computer Kit PDF

We’ve designed it as a PDF craft computer pack for teaching children core computing ideas without the need for any computers or tablets! All you’ll need is a printer, safety scissors and glue – oh and some pipe cleaners or string if you’d like to network your Craft Computers 🙂

Here’s the write up from our first test run with it:

When teaching children we wanted to start at the beginning, before programming, with something tangible, something they could handle and own. There is a strong urge with Computing to dive straight into programming which is the obvious goal  but we have found it valuable to have it supported  by a solid physical understanding through play and craft.

Children love to create, especially with paper and glue so that’s how we came up with the Craft Computer. As cross-curricular addition it also involves teamwork, hand eye coordination and maths transformation (2D to 3D).

The kit contains:

  • some components (MEMORY, CPU, FILES) which we use to teach the children some simple fundamentals on how computers work.
  • Pixel files – we use these as a fun colouring in task to show how computers use numbers to represent things like colours
  • Program Punch cards – we use these to draw simple “programs” on

Using the Craft Computer Kit you can create your own craft computers which you can give to a whole class with just an A4 printer.

Anyway, that’s enough rambling, here’s the Craft Computer PDF file*:

Download Craft Computer Kit PDF

Please feel free to share around your networks if they’re of any use.

*If you find any errors or have some suggestions please drop me a line – the pack is a draft so there might be some bugs 🙂

Cheers,

dan@inpractice.org (@danfbridge)

English Computing Curriculum Key Stage 1 and 2

Here’s the revised English Computing Curriculum Key Stage 1 and 2

It sets our the purpose for the curriculum as:

A high-quality computing education equips pupils to understand and change the world through logical thinking and creativity, including by making links with mathematics, science, and design and technology. The core of computing is computer science, in which pupils are taught the principles of information and computation, and how digital systems work. Computing equips pupils to use information technology to create programs, systems and a range of media. It also ensures that pupils become digitally literate – able to use, and express themselves and develop their ideas through, information and communication technology – at a level suitable for the future workplace and as active participants in a digital world.

Key stage 1 Pupils should be taught to:

  • understand what algorithms are; how they are implemented as programs on digital  devices; and that programs execute by following precise and unambiguous instructions

  • create and debug simple programs use logical reasoning to predict the behaviour of simple programs

  • use technology purposefully to create, organise, store, manipulate and retrieve digital content

  • use technology safely and respectfully, keeping personal information private; know where to go for help and support when they have concerns about material on the internet

  • recognise common uses of information technology beyond school.

 

Key stage 2 Pupils should be taught to:

  • design, write and debug programs that accomplish specific goals, including controlling or simulating physical systems; solve problems by decomposing them into smaller parts

  • use sequence, selection, and repetition in programs; work with variables and various forms of input and output

  • use logical reasoning to explain how some simple algorithms work and to detect and correct errors in algorithms and programs

  • understand computer networks including the internet; how they can provide multiple services, such as the world-wide web; and the opportunities they offer for communication and collaboration

  • use search technologies effectively, appreciate how results are selected and ranked, and be discerning in evaluating digital content

  • use technology safely, respectfully and responsibly; know a range of ways to report concerns and inappropriate behaviour

  • select, use and combine a variety of software (including internet services) on a range of digital devices to accomplish given goals, including collecting, analysing, evaluating and presenting data and information.

Teaching Girls About Technology and Computing

Today I’m teaching a group of five year old girls computing fundamentals and in front of me right now is a stack of material that’s looking decidedly ambitious – we’re going to cover a fair bit of the English 2014 Key Stage 1 syllabus for Computing.

Oddly I’m a bit nervous.

I don’t usually get nervous before giving a talk. Today is different. Today I’m not really talking, I’m teaching. My memory of great teachers tells me there’s a big difference between the two things. For me it was the difference between mental inspiration and stagnation.

The shining light from my schooldays was the aptly nicknamed Shiner, my physics teacher. Shiner, so called due to his dazzling pate, was Alka-Seltzer for my brain following a sadly stodgy History – History was taught by the deputy-head, so he’d come in for 5 mins at the start, tell us to copy a bunch of pages from a book then bugger off again, often not even coming back.

Shiner was on the Ultraviolet end of the teaching spectrum and could, almost at will, ignite the entire class in fits of laughter and then before you knew it he’d have you buried in text doing actual work. It never felt like work and Shiner was genius at that alchemy. If I get stuck I’ll think of Shiner!

I’ll report back later but the nerves have gone somewhat as my five year old daughter has just told me we need to leave!

Yes miss!

Learning To Program Does Not Mean You’ll Be A Programmer

Learning to program does not mean you’ll be a programmer just as learning to read and write does not mean you will become a writer or a professional speaker. But they are a fundamental part of the skills you now need to develop as a person and find meaningful employment. Which I think is pretty important right?

So why do we learn to read and write?

For me, it’s all about survival and communication.

We learn to read and write because we have to survive and to survive we have to communicate. “Run, here comes a tiger!” etc Being able to read a sign warning you not to cross the motorway/freeway can save your life. Being able to write a CV/resume will help find you work so you can feed yourself and your family.

These are skills that are vital to everyday activities in the modern.

Likewise understanding technology is now a fundamental part of that skill set because you now need to communicate to/with technology.

Learning and understanding how computing influences your world and how you can influence those technologies is now part of our everyday activities: from sending email, sharing photographs, buying groceries to making sure your details are safe online and making sure your children are safe online.

So learning to program does not mean you’ll be a programmer anymore than learning to write means you’ll be a writer. But what it does do is provide you with some very powerful ways to think and interact with our, now largely digital world, which will make it much easier for you to communicate with and using technology.

The basis of this post came after I was asked a great question when talking to a parent about their children going to a local computing club which went along the lines of “what’s the point of learning to program if they don’t want to be programmers?”.

I usually respond with anecdotal evidence that it “helps with problem solving” but I find that a bit wooly so I gave it a bit more thought and replied that “it helps them to communicate and I think communication is at the heart of everything we do and today that’s largely reliant technology”.