Nepedia
Back to Discover
Independent Reader
💻

Function (computer programming)

technology Maturity 7-9 Next article →

A function is a special part of a computer program. It is a set of steps that does one job. A programmer can call a function many times. This is a powerful way to write code.

Functions help solve big problems. They break a large task into small chunks. This makes the work easier for people to do. It also helps make software more reliable.

In the past, memory was hard to find. Early computers used paper tapes to hold instructions. Each function could be on its own piece of tape. This saved a lot of space. People called these collections of tapes a subroutine library.

Many people helped create this idea. John Mauchly and Kay McNulty worked on it. They used these parts to help calculate missile paths. Other thinkers like Alan Turing also worked on these ideas.

Most modern computers use a call stack. A stack is a way to store data in order. When a function starts, it makes a stack frame. This frame is a small space for its own data. When the function is done, the space is cleared. This lets the computer use that space again.

192 words

Where will your curiosity go next?

Keep exploring at your chosen reading level.

More to explore

What is Nepedia?

A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.