Diamond Reflection Prompts
Prompt: “List the benefits of being able to define and call functions in a program. Who specifically gets to enjoy those benefits?” Everyone enjoys the benefits of functions. It makes programmer’s lives easier, and also makes the code easier to read and understand. It organizes code, saves you from writing repeating code, and makes the code easier to read.
Prompt: Explain more than one reason why programming languages have functions. Functions are useful tools to split up code and make it look logical, while also being able to reuse sections of code. For example, if I had a section of code that calculated a certain equation, or something that took out a section of a string, instead of rewriting that code, I could just use a function, and call that function inputting the numbers. They are also able to organize code. Instead of having a large chunk of code that does a complicated math function, you could make it into a function. That way you know it takes the derivative of the function, without seeing the large chunk of code.
Prompt: “How is the use of a function an example of abstraction? Functions are an example of abstraction because it can make parts of your code reduced to essential commands. It reduces large chunks of code into nicely named functions, which give only the essential data. Within the function, only the relevant data is passed into it, making it simplified.
Prompt: Explain more than one reason why programming languages have functions. Functions are useful tools to split up code and make it look logical, while also being able to reuse sections of code. For example, if I had a section of code that calculated a certain equation, or something that took out a section of a string, instead of rewriting that code, I could just use a function, and call that function inputting the numbers. They are also able to organize code. Instead of having a large chunk of code that does a complicated math function, you could make it into a function. That way you know it takes the derivative of the function, without seeing the large chunk of code.
Comments
Post a Comment