When your programming is increasing, then you need to segregate your code separately so that you can easily analyze them.
For this we are having a method use function.
the function is having the following advantages,
1) code becomes readable
2) less error
3) less memory