Narrator: In order to write clean code and functions,
it is important that we reflect on what makes up a function.
And for that, we should probably look at a function,
for example, this dummy example add function here.
And just as a side note,
when I say function and what I show throughout this module
will also always apply to methods
since methods are really just functions inside of an object.
So this is a function or method.
And of course we cannot just define this function
and write the code for this function.
We can also call this function
which could look something like this.
And when we talk about clean code,
both parts should be clean.
Calling the function should be readable
and also easy for us as a developer.
If we are calling a function,
we wanna have an easy time doing so.
For example, the argument order should be clear.
And of course, working with the function,
writing code in an existing function,
maintaining existing functions should also be easy.
So the function body, the definition of a function,
should also be readable.
So therefore, it's the number and order of arguments
which matters to us because that defines how easy
and readable it is to call a function.
And it's the length of the function body, the amount of code
we have inside of a function which matters.
And in this section,
we are going to have a look at both aspects.