Define efficiency in programming.
When we are trying to be "efficient" in our programming what are some (valuable) resources we might be concerned with? Why does it matter?
I think efficiency in programming is using the minimum amount of code to run a program with the minimum amount of resources needed. The resources we might be concerned with is storage space, amount of ram used, and how much computing power your program requires. It matters because if your computer uses too many of one of these resources, it will slow down the program and any other program being used on the user's computer. This will end up with frustration from the user, and drive them away from your program.
Thought Prompt: What is the “most efficient” way to program the solution for the 3x3 grid?
I know for sure that my solution was not the most efficient, but I think that the most efficient would be a program that minimizes right turns. Right turns take up 3 commands, and cutting down on those would be the easiest way to cut down on code.
- What surprised you about programming with such a small set of basic commands?
I was surprised there was no right turn.
- Were you able to be creative with such a limited set of tools?
I was not very creative, but looking back, if I started out the second program with a right turn, and made the box the opposite direction, it would create 3 left turns and a right, instead of 4 right turns, which is 12 left turns.
- What was most frustrating about this activity? If you could add one additional simple command, what would it be, and why?
It was frustrating not having a right turn. I would add a right turn command, because it would cut down on a lot of left turn commands needed.
- Draw (on paper) the simplest image you can that we would be unable to create with our “building block” commands, and explain why it would be impossible to create.
One simple image would be a triangle. The program is unable to create angled lines.
- Draw a second image we would be unable to create with the given simple commands, but for a different limiting reason than you cited in the first drawing
One other image would be a circle. The program is unable to draw curved lines.
No comments:
Post a Comment