132k views
16 votes
Write a two to three sentence response to the following question:

Name two reasons functions are useful in code and explain your response.

User Gordie
by
4.5k points

2 Answers

4 votes

Answer:

Functions act like "capsules" for your code to be stored in.


You can write code within these capsules so that every time you want to use this code, you can simply call the function with the necessary arguments to use that code.

This means functions allow you to reuse code, whilst making your code more readable, less repetitive, and look more professional.

User Kwoxer
by
4.5k points
4 votes

Answer:

Functions can be useful for many reasons, it is one of the main components to learn in writing code. Without functions code would not be where it is today.

Step-by-step explanation:

User Perrier
by
3.9k points