What is a function in Programming?

A programmer's main goal is not just to solve problems through coding but to do so efficiently. When you're programming, you may find yourself typing the same set of instructions in multiple places in your program. When you do this, it not only takes longer for you to write and read your code, but also takes longer for your computer to read and follow your instructions. That's why it's important to be concise. One major way to be concise is to use functions. Functions help you stay organized and each function has a fixed purpose. In other words, each function is meant to perform a particular procedure and you can write a set of instructions needed to perform a procedure and store in a function. So whenever you want to use this procedure in your program, all you have to do is refer to the function you wrote. And that's it. Now you know what functions are and why they're used in programming.

Comments

Popular posts from this blog

Black Hole : A mystery in the Universe

Global Warming : Threat to humanity