Tuesday, September 27, 2011

The Journey Begins

My first expedition into programming started with C++, from which I learned much about loops, and how to use them. After that voyage ended, I decided to take off on a journey with scheme, in 1901, and promptly disregarded everything i had ever learned about loops, and object-oriented programming as a whole. That is, until I was asked to come back to the land of C++, and be a TA.

My time as a TA has, if nothing else, made me  proficient at debugging C++, and making heads or tails of nonsensical code. This, I believe, shows when I write code myself. I generally try to make it as easy to understand as possible, because I know what it's like to try to read code that's essentially gibberish. So, in that area of programming, I'm feeling pretty good. Comments and I, on the other hand, have not had a very good relationship.

When I first started programming, my thought process was that, all we care about is the finished product. That whatever we write functions as it should, and that it doesn't really matter too much, how we make it work. So naturally, I found commenting to be an utter waste of time. No one was going to have be doing anything with my code after it was done anyway, so why comment anything? Since that time, I've come to realize that people will, in fact, have to read my code at some point, and that reading code without comments sucks really  badly when you don't have the person there explaining what the thought process behind the code was. But just because comments and I understand each other now, it doesn't mean we're on speaking terms. I still don't use them as much as I should, but I, at least, know that I should be using them more, and that's a start.

So, pretty much what I was trying to say in this post was, I'm pretty good at writing code that, itself, is fairly easy to understand. However, this is counteracted by the fact that the I don't utilize comments as well as I should be, leaving me with an end result of most likely, only mildly frustrating code to read. I'm hoping, by the end of the semester, to be able to write code that even engineers can follow.

2 comments:

  1. Ah comments, I'm a in favour of them. My experience has shown to me is that if you're working with open source software, academia, or any place where your product is meant for others to tinker with, understandable code with comments is vital. On the other hand if the environment is industry where only your company is going to be using your code, other engineers are going to have to see it at some point because successful projects don't have one person doing all of it. How would your viewpoints change if your code left a co-worker/group member feeling frustrated at the end of the day instead of you?

    ReplyDelete
  2. oops, forgot my name.
    -Elsa Dosh

    ReplyDelete