Tuesday, September 18, 2012

College Reflections

It's been exactly one month since I moved into my campus dorm. Since I have some sort of free time, I felt I should write a bit, explaining how I've come to feel over the past month.

Starting from the first day, one thing that delighted me and continues to do so: the food! Apparently my college is ranked 14th in the nation for best food, in some list or another, and it sure does live up to the number. Before I arrived on campus, my diet consisted mostly of Ramen noodles, cereal, and Pop-Tarts. This was mostly my own choice, so as not to expend too much money. But ever since the first day, at least twice I've been able to have a meal of a variety of foods. And a lot of it, as well. Trust me when I say I'm eating well here.

One of the things that has surprised me about this place is the relatively strong Christian presence. Universities are known as places where secular thinking is prominent, and people tend to lose their faith. I anticipated the place being somewhat antagonistic to faith. What I've found is pretty much the opposite. A lot of people here are Christian, with differences in how serious they are about it. It's not uncommon to hear people playing Chris Tomlin songs on their laptops. Several campus missions exist here, of which I've hooked up with Cru (formerly Campus Crusade for Christ). One of my teachers, who I assumed was a non-believer due to his strongly analytical nature, is actually a faculty advisor for one of the groups! I don't have to be as defensive about my faith as I thought I would, because several others here are at least somewhat open about it, and I've yet to hear them (or myself) get any crap because of it.

Something else I am discovering is that I'm lacking in the necessary levels of self-discipline and time management. Starting about a week ago, you could say I've been pretty busy with schoolwork. Seriously, all my time not spent in class is usually spent doing something related to school work. The reading and assignments take up lots of time, perhaps more than they need to. And I believe part of the reason they expend so much time is because I'm so easily distracted. When I'm working in front of my computer, I usually have Internet access. What's on the Internet? Facebook, Twitter, message boards, etc. So many things that, often, are more interesting than what I'm supposed to be doing at the moment. One of the skills I'm developing out of necessity is being able to say "No" when I need to concerning the Internet and distractions. It's strange, but my location does affect how easily I fall into this pattern. If I'm at my desk in my dorm, it's likely I'm gonna end up at twenty other Web sites instead of my homework. Yet put me in my floor's lobby, or perhaps a library, and I'll be much more focused.

Time management is also a pain. Part of the way I operate is that sometimes, I'll find something intriguing or a creative idea will pop into my head and even if I'm trying to do something, the excitement of this new thing will hijack that. Combine this with being wont to procrastinate if something isn't due for a few days and you get a little bit of a mess.

These two things may seem a bit strange coming from a type A personality person like myself. But I suppose that in the past, my natural intelligence allowed me to do well in school and other things without much hassle. Yet somehow university is different and that kind of thing isn't cutting it. It seems I need to (gasp!) put effort in order to do well. The purpose of university is to teach us how to think, and it seems that in some aspects my thinking skills haven't grown sufficient. But hey, that's why I'm here!

Something that I've repeatedly experienced here is near informational overload. Reading seventy pages for a week's worth of discussion? Needing to know things to the most minute detail? This is new for me. Having to sort all this out is quite the challenge.

As an introvert, I've been slow to integrate myself into any social circles. Beside my roommate, I can't say I've developed any quality friendships. I have plenty of acquaintances, but not really any friends. This is something I've been proactive about since just about the first day I've arrived. Knowing my pasts follies, one of my goals has been to get active in social groups. Loneliness is not fun. It seems my main method for getting to know people better is adding them on Facebook. Admittedly, this is something of a flawed technique as people aren't really the same online as in real life. I think what I need to do is start getting to know people on a personal level. To the college's credit, I have found most people to be receptive and kind. A lot of people are willing to engage, I just need to do so as well.

This post seems like more complaining than what I intended. I do enjoy being here. Being away from home in a setting where I can better shape myself and my lifestyle. Where I am better set to pursue my goals. With this kind of freedom comes responsibility and I am slowly developing the skills to utilize this freedom to its maximum.

Thursday, September 6, 2012

Abstraction in Programming

There is a topic I've been learning in my computer science class that caught my attention recently, and I thought I'd share it with my readers. It's something called abstraction, which apparently is one of the foundational concepts of programming. It's something I've done before I even knew what it is, and now that I look back, I'm sometimes confused by it.

Abstraction is all about using something when you don't really know what it truly is. We use a symbol of some kind to represent it and use it in the program. Does that sound confusing? Let me give you a basic example.

Perhaps you know that computers think in a number system called binary, which is expressed as zeros and ones. The use of zeros and ones as symbols is a form of abstraction. The computer isn't really operating on actual zeros and ones; rather, there are electrical strengths flowing through the circuits of the machine. We represent the higher voltage with a 1, and a lower voltage with a 0. That makes it easier to understand and work with. I don't know the deep electrical mechanics of the computer, but I know how to handle zeros and ones. It's easier to think of zeros and ones than high voltages and low voltages.

We could have some fun with this. Suppose instead of using electrical currents, we utilized water streams. There could be two possible states: water flowing, or water not flowing. These could be represented by 1 and 0, respectively. Because water flows are so similar to electric current, they could be used to make huge water-based computers, although the graphics wouldn't be very nice.

Let's take this to the next level of programming. At the very base, computers operate by handling sets of zeros and ones in a specific manner programmed into their hardware. There is something called assembly language, which is very primitive and one step up from the ones and zeros. It may look something like this:

LD A, 0
INC A
LD HL, BC
RCCA
RET

Doesn't look very readable. The letters and numbers correspond to specific pairs of numbers. This is abstraction because we don't need to know the exact zeros and ones in order to make the computer operate. We just need to know this vaguely more English-like set of commands.

Take this one more step into languages which most programmers are more familiar with - Java, C++, PHP, JavaScript, and so on. They look much more like written language, even though there is a lot of mathematical appearance. These are a large leap of abstraction. Consider a FOR or WHILE loop. You don't know all the bits and bytes being moved around, but that's alright. You don't need to, you can just run these loops to make it work.

Or think of variables. They have all sorts of types and names. This is touched on in fields of math like algebra and calculus. You have a variable x. You don't know what it is but you still do stuff with it, such as solving or simplifying equations for it. In JavaScript, you might do something like this:

function showMessage(x) { alert(x); }

The function doesn't know what x is, and indeed you could throw any kind of value into it and it will work nonetheless. One example which we did recently in my CIS 300 class involved abstraction when it created an array of type T. This was part of a class definition and went something like this:

private T[] arrayName = new T[10];

It was done in C#. This is a cool example because T means that the data type could be anything the user wanted, be it int, string, long, bool, object, Thingamadoozy, or whatever! You didn't need to know what the data type was when you made the code, you could just use T as a stand-in until the data type was given.

I think that abstraction, along with the very structured hierarchy that many languages, particularly Java, show are some of the things which are catching my interest these days.