|

Coding Process

Note: This article was published while I was in my early 20s. I was much younger and dumber. Please don't hold it against me. One of the perils of having a 20+ year old website!

Here is a paper I recently found. It’s on my coding process (after being a coder for about 2.5 months), and was written my freshman year of college…

What I do BEFORE I write any code?

Before actually coding any program, I have to make sure I understand it. Usually, I will understand what I have to do, but not what that means when it comes to writing the program. However, for the last 2 assignments we’ve had, I sat down, and wrote exactly what I had to do, and then what kind of methods I could use for writing that program. This took some time on my part. Just recently I’ve realized I should do this, and it makes writing the program so much easier. Since this course is my first experience with programming, It takes me a little longer to actually realize what I have to do and how to go about doing it. This is, I should also mention, the longest part of the process for me. For the current program, we actually had to write and hand in what we thought we had to do. We had to set up an array that took the inputted number and added 1 to t hat spot in the array. Ex. If 50 was the input, the a[50]= 1. Then the program had to print out the array with the number in that array. So this example would print 50: 1. After figuring out what I had to do, I thought of the best solution. Since I am new to programming, the best solution might not be the best, but I want to be sure that the program works. My solution was that I should set up an array, then use a for loop to make each value in that array 0. Then read in the Int. with a while loop, and made the loop terminate with a value less than 0. After each number was read in, I set up another for loop that, if the value in the array spot was greater than 0, it would print the array spot and its value.

What I do BEFORE I get my first clean compile?

Before my first clean compile, I go back to make sure that I didn’t miss anything. If I did, I would fix it. This is before any compile. I align everything to make sure it is all written correctly. Then if I compile, and it is not clean, I fix the errors the best I can. Sometimes, this would include asking a friend for some pointers on where I messed up. With this particular program, my error at compile time was that the file input class Prof. Plishka provided was not updated. So I went out to the website and got the updated one. I make sure everything makes sense, and then I proceed to my first clean compile.

What I do AFTER my first clean compile?

After my first clean compile, I first pray to God that the program works. Sometimes, it does. Usually, it doesn’t. So I go back to my code to check where the problem might be. After checking through the entire program- pretty much line by line, I assess where the problem might be and solve it accordingly.

Quite a bit has changed since then, and now coding is ‘like a second language’ to me. I don’t really need to put a lot of thought into how I will do something, just into how I can make it better, more efficient. I use a lot more print statements for error checking now than I did then, and they really do help pin point any problems. I don’t need to check line by line any more, since I am more familiar with whatever languages I use, so I usually can tell what is giving me trouble. As for asking friends for help, that is always good to do. Writing code is like writing a paper in the sense that you might over look errors because you wrote it. Later.

Similar Posts

  • |

    When To Listen To Podcasts When Stuck at Home

    So you normally listen to podcasts on your commute to and from work, in the car, or generally when traveling. And now..well, you’re probably not doing much of that. So when do you find time to listen to podcasts? Here are a few good times to listen to podcasts while you’re cooped up at home.

  • |

    Learning Binge 2: Design, Sketch, and Angular

    Around January of 2014, I wrote about a learning plan I came up with get me up to speed on several tools, including git and Sass. That worked out relatively well for me, seeing as I use both of those every day now. I’ve decided that while I’m not going to break it down by weeks…

  • |

    My 2018 Learning Plan

    Every so often I like to come up with a learning plan for the year/month/week. Last year’s didn’t work out the way I hoped for a number of reasons (like having a baby, and going solo). But this year I’m doubling my efforts and came up with a plan where I set aside at least…

  • Links Round Up for 7/25/10

    Note: This article was published while I was in my early 20s. I was much younger and dumber. Please don’t hold it against me. One of the perils of having a 20+ year old website! How To Design And Style Your WordPress Plugin Admin Panel: This helped me immensely this week. Great for any WordPress…

  • Podcast Advent 2024 is Underway!

    For years, I thought about doing a “Podcast Advent,” similar to what 24ways.org did for web development until it sadly stopped in 2019. Last year, I finally took action on November 27th, registering the domain, and coming up with a plan for me to create 24 pieces of content in 24 days. It worked out…