3.5 Paint Pot Refactoring and Documentation Curriculum Page
Portfolio Reflection Questions:
1. The Wikipedia article on refactoring talks about code smell and one motivation for engaging in refactoring. What is code smell? Describe briefly two examples of "code smell" and how refactoring would eliminate them.
- Code smell means that there is an issue within the coding of a program that can negatively affect the performance and quality of a program. An example of "code smell" is when there is redundancy within a code that could cause a bug if something isn't changed among all the parts of the code. This problem could easily be eliminated through refactoring by creating a procedure so that the whole block of code is in one spot and easy to change. Another example of "code smell" is when a code is too complex. This problem could be eliminated through refactoring by making a simpler code that's easier change.
2. Insert a screenshot of the procedure from your app below.
Attached below.
3. What are the advantages of using procedural abstraction? Try to name at least 2 advantages.
- The advantages of using procedural abstraction includes the fact that it makes the code simpler because the same structure, or procedure, can be used in the coding in multiple spots with a convenient place that will change the same structure for each spot. In addition, it reduces the amount of time someone needs to spend on creating the coding for their app because they can create one procedure that can be used multiple times.