Back

Why do arrays start at zero?

15 July 2025

If you’ve ever dived into programming, you’ve probably asked yourself: why on earth do arrays start at zero instead of one? At first glance, it seems counterintuitive, but the answer lies in efficiency and logic.

Visualising arrays: the row of lockers analogy

Think of an array as a row of lockers. Each locker has a position, starting at the very beginning of the row. The first locker is zero steps from the start, the second locker is one step away, and so on. If you want to access the third locker, you count two steps from the beginning: 0, 1, 2. This is the essence of zero-based indexing—it measures the offset from the starting point.

The link between arrays and memory

Arrays in programming map directly to how memory works in a computer. When an array is created, it’s stored as a block of memory. Accessing an element at array[i] involves the computer locating the base address of the array in memory and adding i to it. Starting at zero simplifies this calculation, making it faster and more efficient. In essence, zero-based indexing aligns perfectly with how hardware is designed to operate.

Why not start at one?

While starting at one might feel more intuitive, it’s not practical. Zero-based indexing is baked into the very foundation of programming languages, compilers, and hardware logic. Switching to one-based indexing would introduce unnecessary complexity and inefficiency. That’s why programmers worldwide have embraced zero-based indexing as the universal standard.

It’s not weird—it’s smart!

So, the next time you see array[0], remember it’s not just a quirk of programming. It’s a smart, efficient design choice that keeps your code running smoothly.

Want to learn more?

Want to know more? Check out The Lesson Hacker’s YouTube video HERE.

For more Lesson Hacker Videos, check out the CraignDave YouTube playlist HERE.

Visit our website to explore more cutting-edge tech-transforming news in the computer science world!

Related posts

The biggest curriculum shake-up in a decade – Part 3

Discover what the new Progress 8 and Attainment 8 changes really mean for curriculum planning — and why computing still sits in a tricky spot.
In part three of our CAR breakdown, we unpack the shifts, the challenges, and what they might mean for your department.

28 November 2025

Meet the Team Behind Craig’n’Dave

At Craig’n’Dave, we believe that every mission needs its explorers, problem-solvers, and visionaries. Behind the scenes, our team is working […]

26 November 2025

The biggest curriculum shake-up in a decade – PART 2

From shrinking teaching time to a brand-new GCSE, the latest curriculum review sets the stage for the biggest shake-up in computing education in a decade.

21 November 2025

The biggest curriculum shake-up in a decade

The biggest curriculum shake-up in a decade is here — and computing is right at the centre of it. From a brand-new GCSE to talk of AI qualifications, Craig and Dave break down what it all means for teachers and students.

14 November 2025

Smart Revise Wins Teach Secondary Award for Curriculum Improvement 2025

We are thrilled to announce that Smart Revise has been recognised with the Teach Secondary Award for Curriculum Improvement 2025! […]

10 November 2025

Student kicking a ball into a goal

Introducing Goals: smarter revision, clearer direction

The new Goals feature brings a powerful upgrade to Smart Revise, helping students not only understand their progress but also […]

8 November 2025

High expectations from the first minute

In Computing, every minute counts. Setting high expectations isn’t about demanding work or creating unnecessary pressure—it’s about clarity. It means […]

7 November 2025

High expectations and homework: A culture worth building 

High expectations are often spoken about in education but rarely unpacked in a way that feels practical and actionable. We […]

1 November 2025

What is a code pointer?

Demystifying stars, ampersands and memory mishaps. Pointers in programming can be baffling — all those stars and ampersands, but what do they actually mean?
We break down code pointers using sandwiches, and sticky notes, to make sense of it all.

28 October 2025