ELI5: Explain Like I'm 5

Procedural programming

Procedural programming is like giving instructions to someone step-by-step, just like a recipe! When you want to bake a cake, you follow the recipe to measure the right amount of sugar, flour, and other ingredients, and mix them in a certain order. Similarly, in procedural programming, programmers write a series of step-by-step instructions, also called procedures, that the computer follows to complete a task.

For example, if a programmer wants to add two numbers, they will create a procedure that tells the computer to take the first number, add it to the second number, and then give the result. This procedure can be re-used whenever the programmer needs to add two numbers.

Procedural programming is helpful in organizing code and making it easier to understand because it breaks down a task into smaller, manageable steps. Yet, if there are too many steps, it can become hard to keep track of them all. This is why other types of programming, like object-oriented programming, were developed to help manage more complex tasks.