Bug in the machine: six top tips for debugging your code

Making mistakes and learning how to solve them is a key part of becoming a coder. Read on to find out about the origins of the word ‘debugging’, and discover our newest resource to help your club members work through troublesome code. 

Programme Coordinator Zoe, holding the new debugging poster against a backdrop of an illustration of a house
Programme Coordinator Zoe, was excited to get her hands on our brand new debugging poster

Making mistakes is a part of learning 

The term ‘bug’ is used to describe a technical problem or mistake in code that stops it from working or behaving as you would expect. Every coder, from total beginners to seasoned experts, will have to deal with coding bugs, and it’s important to know the different approaches that you can take to fix them. 

Debugging’ is the term given to the process of working through your code to find and fix your mistake. Many things can cause bugs, from incorrect logic, to syntax errors, or even something as small as a missed comma. 

Bug in the machine 

The term ‘debugging’ is often attributed to U.S. Navy Rear Admiral Grace Hopper, a computer programming pioneer. In September 1947, Admiral Hopper was working with a team at Harvard on the Mark II computer, when they found an issue in one of the computer’s relays: a small, unobtrusive moth. As the moth was removed and taped into their research logbook, Admiral Hopper is said to have remarked that the team was ‘debugging’ the system. And so, the term was born — or so the story goes!

Whatever its initial origins, today, ‘debugging’ is a term used by programmers all over the world. 

Get debugging in your Code Club! 

We’ve created a new poster to help your Code Club members to debug their code. The poster explains what a bug is, and gives six top tips for Code Club members to try if they find a bug in their code: 

An image of the debugging poster, featuring spiders.
  • Check the project instructions — Have you followed the steps correctly? 
  • Read your code out loud — Does this highlight anything that is obviously wrong? 
  • Find the last time when your project worked — Can you isolate which part of your code is broken? 
  • Show your Code Club leader — Can your club leader help find which bit of your code isn’t working? 
  • Ask a friend — Get another pair of eyes to check your code! 
  • Stay calm and keep trying new things — The most important thing is to not get frustrated; you’ll find your bug if you keep looking! 

If you’re based in the UK, the USA, or Ireland, head to your dashboard to download your copy of our debugging poster. 

If you’re based outside of the UK, the USA, or Ireland, head to our Code Club international website to download this poster and other resources. 

Bringing Code Club to rural India

Over the last few months, Pratham Education Foundation and Code Club have successfully piloted a programme across 40 villages in rural India, supporting children and young volunteers to get hands-on with coding. 

The Pratham–Code Club programme

Code Club always strives to bring learning opportunities to rural communities. The Pratham–Code Club programme was established under Pratham’s Hybrid Learning Program earlier this year, and was run in 40 rural villages in Aurangabad (Maharashtra) and Sitapur (Uttar Pradesh) in India. The aim of the programme was to start new Code Clubs and introduce children in these communities to coding and digital technology. The programme also trained young adults in the communities to become the next generation of Code Club leaders.

Four girls gathered around a monitor learning to code.
Code Club members learning to code together

Finding young Code Club leaders

Pratham works directly with rural communities. First, Pratham held a series of village meetings, where young people aged 16–25 could sign up to become Code Club volunteers. Once enrolled, the young volunteers attended a training session to build their confidence and learn how to:

  • Set up a Raspberry Pi computer
  • Use the Code Club Scratch projects 
  • Share their coding skills with young people attending their Code Clubs 

Getting Code Clubs up and running 

The Code Clubs were set up in communities with few resources, where young people often do not have access to personal computers or tablets.

To help the Code Clubs to get up and running, the Pratham Education Foundation funded and put together coding kits containing a Raspberry Pi computer, keyboard, monitor, and a mouse. The kits were distributed across 40 villages, giving 244 Code Clubs in these communities access to hardware.  

Two boys, in a community setting using a keyboard. The monitor in the background shows a Scratch project.
Code Club members using the coding kits containing a Raspberry Pi computer, keyboard, monitor, and a mouse

Impacting young people

Through this programme, many youth volunteers were introduced to computing for the first time. 

I am thankful to the Code Club Programme because I feel that I am up to date with today’s technologies. It is only because of these sessions that I was introduced to this world of computers and I know what coding means!’

The programme had an amazing impact on young people in the communities, engaging 1109 Code Club members aged 10–14, training 50 young adult volunteers, and supporting new clubs to start across India. Through the Pratham–Code Club programme, children in the communities have been able to access a world of new coding opportunities, and youth leaders have been able to further their education and employment opportunities through running a club. 

Learning to code with friends

Help more young people learn with Code Club

The Raspberry Pi Foundation is working hard to ensure that children all over the world have access to coding and digital making. To partner with the Raspberry Pi Foundation in India, write to us at india@raspberrypi.org, or to help Code Club grow in the rest of the world, contact us at hello@codeclubworld.org

Reach out to the Pratham Education Foundation at digital@pratham.org, or follow them on Twitter and Facebook to find out more about their work in India.