ELI5: Explain Like I'm 5

Parameter

Okay kiddo, you know how when you're playing a game and you need to give some instructions to your friend so they can play with you? Well, those instructions are called parameters.

Think of parameters like rules that you set for your game. They help your friend understand what they can or can't do in the game. For example, you might say "we can only play with two dice" or "we can only throw the ball across the yard, not over the fence".

Similarly in computer programming, a parameter is like a rule that is passed along to a function or a program to tell it how to behave. These rules can be anything, like a word or number, that the program uses to do its job.

So, let's say you're designing a spaceship game and you want to have different kinds of spaceships. You might make a parameter that tells the program what kind of spaceship to use, whether it's a fast one or a slow one, or if it has lasers or not.

Basically, parameters give instructions to the program, just like you give instructions to your friend during a game. And just like your game might change based on the rules you set, a program can change too depending on the parameters that are given to it.
Related topics others have asked about: