Payal's Mid-Semester Reflection

by Payal Patel

15 Feb 2016

Introduction:

In order to reflect on my programming experience so far, I decided to review all of my Github posts. When going through my posts on Github, I noticed I used the words “frustrating”, “challenging”, “interesting”, “try”, and “realized” quite a bit. To me, these words reflect much of the programming experience. When working on programs I remember feeling frustrated, challenged, and interested throughout the entire process. I liked the concept of the programs I was working on, but would often hit a road block or a problem that would result in me feeling frustrated. These challenges have taught me that programming involves a lot of problem-solving and trial-and-error. There are four programs/ activities from this course in particular that I feel help showcase my experience and the important things I have learned with problem-solving in programming thus far.

Program One: Chapter 5 Exercises

These exercises consisted of creating loops, specifically while loops, to solve the problem given. Initially, I was overwhelmed when I read the problems for these two exercises. In order to create the programs for these exercises I decided to break the problem into smaller sub-tasks. By doing this I was able to focus on smaller parts of the program at a time. This strategy also helped me understand the different components to each program and how they all work together. Each sub-task I had created ended up being a smaller piece of a large puzzle (the program). Thinking of programming in this way and using this strategy helped me understand the placement of items in a while loop (and the placement of code in programs in general).

Program Two: Payal’s Logical Turtle

While working on this program I learned that just because a program doesn’t work when you run it, doesn’t mean that there is a big problem with the program. Often, whenever I couldn’t get a program of mine to work it was because of a little error. Little errors such as typos or logic errors (forgetting to create a variable that I would use later in the program). This “Logical Turtle” Program is a key example of when I learned the impact little errors have on running a program. When working on the “Logical Turtles” Program I remember my program not working because of syntax errors, such as, forgetting to insert an extra parenthesis or adding an equal sign with the goto function even though it’s not part of the function. These errors were simple mistakes that resulted in my program not working at first. I tried to look for the error in my code, but everything seemed to look correct when I looked at it. So, I decided to take a break and look at it later. When I came back to look at my program I was able to find the errors I had initially missed. By taking a break, I was able to look at my program with fresh eyes and catch the errors I made the first time.

Program Three: Payal’s Clicky Turtle

This programming experience taught me that problem-solving occurs in unique ways and can result in a lot of trial-and-error. With this program I made it so that whenever the user clicked the screen a design would be created. In order to add some variety, I made it so that each of the four quadrants had a different color design. After doing this, I decided I wanted to figure out a way to have different designs appear when the user clicked the screen (rather than the same design being used the entire time). I tried to do it by different ranges depending on the location of the user’s click, however, that didn’t turn out the way I expected or intended for it to. When that didn’t work I decided to experiment a little with the amount of code I did know. I decided to create an if-else statement so I could have two different designs appear on the screen. (The designs were created using for loops—which I learned how to do in the turtlehacking exercise by looking online at different sources). At first I created the condition of the if-statement to create a design based off of the comparison between the x and y coordinate. When I tested this out, it worked, but it didn’t create the random effect I was hoping for. I tried several other ideas including using greater than, less than, the position function, etc. in order to try and achieve the vision I had in mind for the program. I finally tried using the absolute function on the if statement condition [“abs(tina.xcor()) > abs(tina.ycor()”]. Once, I ran the program with this code, I achieved the result I was working towards. This experience showed me that creating a program not only takes time, but also requires a lot of trials.

Program Four: Payal’s Turtle Treasure Hunt

The in-class group activity following the Turtle Treasure Hunt programming exercise showed me the importance of collaboration for problem-solving in programming. Talking with others about the assignment and the different strategies we each took in order to create the program allowed for ideas to not only be shared, but altered and combined to create something even more efficient than what one of us could do alone. From this experience I was able to learn and experience the impact collaboration and discussion can have on a program. When talking with my group members I was able to learn about different techniques and approaches that can be used to solve the same problem. I was also able to gain ideas that could help enhance the program I created.

For example, with the Turtle Treasure Hunt, my user feedback consisted of changing the turtle’s color (with colors ranging from red to blue, depending on the turtle’s proximity to the treasure) and a print statement associated with each color that also described the turtle’s proximity to the treasure. These print statements gave relative descriptions of the turtle’s location to the treasure, such as, “You’re getting closer” and ”You’re freezing”. When talking to members in my group, a couple of them choose to give the user absolute measures of their location to the treasure (i.e. your x is ___ off and your y is __ off). I thought this was an interesting and unique approach. In our group we discussed how the program could benefit from the combination of these ideas. By combining these ideas together in a single Turtle Treasure Hunt program we concluded that the user would be able to play the game more quickly (because with our own versions we found a common problem was that the user could end up taking a long time to get through the game).

Conclusion:

Overall, I would say I’ve noticed most of my learning growth experiences in programming have come from when I have faced a problem and figured out a way to overcome it. I have also had great learning moments when working and discussing ideas with others. I think having the willingness and determination to try to solve a problem is an important attitude to take in programming. So far, I have seen this attitude be very beneficial when creating programs, and I plan on sustaining this attitude when working on future programs.

Payal is a junior at UNC-Chapel Hill majoring in Information Science. Find Payal Patel on Twitter, Github, and on the web.