Docsity

Feedback on P4 Assignment: Efficiency and Code Modularity, Assignments of Computer Science

Toggle sidebar
bg1
P4 Comments
Problem 1: Color Picker
GenerateColorSlice was implemented correctly by almost all students. There were no common errors for
this problem.
Problem 2:
The general performance for both DrawDot and Fill was good. Lots of students used the brute force
approach of iterating over the entire image, and decided what to do at each pixel (which is perfectly
acceptable for this assignment), however, some students made their programs much more efficient by
only iterating over the "bounding box" corresponding to the given operation.
Problem 3: Cut/Copy/Paste
The majority of style points were lost in this section. We tested student's ability to detect code
duplication and to use functions to eliminate redundant code. Code duplication is bad for the following
reasons:
-To make any changes to your code, such as fixing a bug, or changing the algorithm, you need to
remember everywhere the code has been duplicated. In practice, this problem is worsened because you
would be working with code written by others, and you would have to manually find everywhere the
code has been duplicated.
-It is easier to test modularized code. If you encapsulate all related code in one function, you can
verify thoroughly test this function, and then assume that this function works while testing higher-level
functions. This makes it a lot easier to test your code and reason about code correctness.
Even if the code is correct, it needs to conform to good programming style in order to be deployed
efficiently. This is especially true in the industrial environment where your code will have a long lifetime
and will be modified many times by developers whom you'll likely never meet.
Almost all students who modularized their code did so properly, and got full points (3 style points, see
Grading Guide).

Partial preview of the text

Download Feedback on P4 Assignment: Efficiency and Code Modularity and more Assignments Computer Science in PDF only on Docsity!

P4 Comments Problem 1: Color Picker GenerateColorSlice was implemented correctly by almost all students. There were no common errors for this problem. Problem 2: The general performance for both DrawDot and Fill was good. Lots of students used the brute force approach of iterating over the entire image, and decided what to do at each pixel (which is perfectly acceptable for this assignment), however, some students made their programs much more efficient by only iterating over the "bounding box" corresponding to the given operation. Problem 3: Cut/Copy/Paste The majority of style points were lost in this section. We tested student's ability to detect code duplication and to use functions to eliminate redundant code. Code duplication is bad for the following reasons: -To make any changes to your code, such as fixing a bug, or changing the algorithm, you need to remember everywhere the code has been duplicated. In practice, this problem is worsened because you would be working with code written by others, and you would have to manually find everywhere the code has been duplicated. -It is easier to test modularized code. If you encapsulate all related code in one function, you can verify thoroughly test this function, and then assume that this function works while testing higher-level functions. This makes it a lot easier to test your code and reason about code correctness. Even if the code is correct, it needs to conform to good programming style in order to be deployed efficiently. This is especially true in the industrial environment where your code will have a long lifetime and will be modified many times by developers whom you'll likely never meet. Almost all students who modularized their code did so properly, and got full points (3 style points, see Grading Guide).