Programming Functions and why are they so special

807 views

I’m still trying to wrap my ahead around this concept.

I’ve done basic maths, so I know that f(x) = x is like a function, but I can’t find an intuitive way of explaining why some functions don’t have to return values. In addition, what separates functions from just lines of code?

In: Technology

12 Answers

Anonymous 0 Comments

function in programming are not like math functions

a function in programming is an operation you perform on data, normally a simple task that can be split in its own block of code

it doesnt necessarly need ot return anything(tho in most cases it should even if its only to debug itself) since often all you need from the function was the operation it did on the variables that can be taken over by another part of the code, not their actual result.

You are viewing 1 out of 12 answers, click here to view all answers.