Don’t Repeat Yourself. If you’re repeating code, you should find a way to dynamically generate it, such as by using a function and function parameters.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q
4 Steps of the problem-solving process
A
Understand the Problem. Know what is known, what is unknown, and what you’re trying to find
Make a plan. Before writing any code, come up with an approach (or a few!) and decide what will work best
Execute the plan. Write the actual code, testing things along the way. Make sure your final tests include every edge-case you can think of
Review the solution. Can it be improved? Is it optimized? Does it cover every erroneous input or weird data you can imagine?