Thursday, 12 February 2015

OOP(s) -- Learning Object Oriented Programming is NOT a Mistake

Object oriented programming. What is it? That's the question most students of computer science must ask themselves on a daily basis, and I'm here to give you a quick summary. Object oriented programming is crucial in our understanding of computer sciences methods and theories, so we have to know exactly what it is. Object oriented programming is exactly what it sounds like -- it's programming that organizes itself around objects rather than other actions or methods. Object oriented programming likes to focus on data rather than ordinary logic.

OOP involves many aspects that we've already been using in class, such as property and inheritance. Inheritance and ADT make your life as a computer programmer a lot easier, by allowing you to have one big generic abstract class instead of having to repeat methods for a bunch of similar classes. It cleans up your code, and makes your work a lot more organized and simple -- also makes it a lot easier for someone else to follow later on! This also means you can access classes in any other object oriented program, making things very organized and simple -- write one class, and you'll never have to write a class remotely similar again. OOP also allows for property, which lets data hiding occur and heightens the security of your program. Dottoripy has some really good points on property in OOP -- head over to her blog if you want to learn more.

Data structures such as queues, trees, and stacks would all be impossible without OOP. OOP allows you to refine your code and further understand exactly how to think out your code. Object oriented programs are easy to read, easy to modify, and work quickly, hence their resounding popularity today in the world of computer programming. Python, Java, C++... All are object oriented programs, making them both fairly easy to learn but also they allow to write complex code, and produce good, fast working programs. Object oriented programming is something everyone needs to learn, and they'll be thankful they did.

Thursday, 5 February 2015

Tracing the R-word

Tracing. Sounds easy, right? Absolutely not. Tracing forces me to slow down my thinking and actually see how my program works, step by step. I understand that tracing helps with understanding how one's program actually works, but for me it can get tedious quickly, and often I get lost in my own thinking and add far too many mini steps in between each step. Especially when we start dealing with nested lists -- I start having to make my writing minuscule, just so I can fit all my layers and written out recursions in one line.

Tracing, despite the pain it causes us poor CSC 148 students, is however necessary for complete and total understanding of your program. It helps you realize exactly what steps your program takes to get to the answer, and increases your Python knowledge on a whole. Especially when it comes to the dreaded R-word: Recursion. In order to understanding recursion, one must first understand recursion, in order to understanding recursion, one must first understanding recursion, in order to.... You get the point.

Recursion is difficult to explain -- you either get it or you don't. It involves calling a function within itself, either once or infinite times. In layman's language, it's meta, it's Inception -- something within something within something within something. The concepts may sound simple, but putting it into practice can be a little more difficult. Especially when tracing. When tracing recursion, I know what the answer will be before I start, but when actually writing out the lengthy steps, I can get really lost in my own muddled thoughts of recursion. I think to truly become more comfortable with tracing recursion, I will need to fully understand exactly what recursion means.

Dottori and I seem to be on the same page when it comes to recursion -- we both understand the concepts, but find it tricky to put it into action. Both of us will need a little more time to actually wrap our heads around it, and hopefully by the time the exam rolls around, we will be 100% on top of recursion, no matter how many nested lists it involves.

Wednesday, 28 January 2015

First Few Weeks: Getting Back to Python

Every time you begin a new class, one of the biggest hurdles you have to overcome is the first assignment. Be in an English class, a Computer Science class -- the first assignment is your first chance to show what you can do, and to make a good impression on your classmates and instructors. This week in CSC 148, most of my time was taken up with putting the final touches on the first assignment. I had a working program weeks ago, but I had to adhere to assignment rules. I read through the assignment sheet many times, picking through it with a fine-toothed comb to make sure I hadn't missed anything. I checked Piazza daily to see how my fellow students were doing, and if there was any help I could offer or intelligence I could gain from their questions. 

The first assignment is also the first chance you have to see if you really enjoy what the class is teaching you. This assignment for me really gave me a chance to do this -- I loved writing this assignment. There were times I was frustrated, such as when I was unsure if I was doing every small thing the assignment required, but by the end, I felt confident in my assignment and also like I had learned a lot. 

The first assignment was my main goal for these first few weeks, but I also learned a lot from classes and labs. I haven't taken a Python class in a while, so these weeks have been a good chance to refresh my Python knowledge and redefine my coding style. I'm finding writing these SLOGs very helpful, as it helps keep all my thoughts in order. The weekly tests in the labs are good incentive to make sure I understand everything immediately, and force me not to lag behind. 

All in all, I feel like my experience in CSC 148 is off to a good start. All the work is really enjoyable and challenging, and I feel a sense of reward every time I manage to complete a lab or assignment. To be honest, I can't wait to get started on the second assignment! I am sure I will continue to enjoy this class, and I look forward to the challenges up ahead!


Wednesday, 21 January 2015

Death to Writing: Why Should You Write if You Can Code?

You've heard it before -- the age old story that technology is the death to tradition, that computers stop kids from writing, that video games kill creativity. These ideas taint technology, but the truth is, writing and coding go hand in hand. You may think you don't need to know how to write and how to use language if you're in computer science, but that's just wrong. Let me tell you why.

I'm an English specialist, with a taste for coding. I've spent most of my undergraduate career defending my choice of study. The ability to write and the ability to use language can help you in any career path you choose -- especially in computer science. 

Clients. Clients don't speak code, they speak English -- most of the time. You are much more likely to be hired if your cover letter and resume actually make sense. Language helps you appeal to clients, and appealing to clients means more work, which means more money and life happiness. You need to write proposals, specifications, funding requests -- language is the face of all careers, including computer science.

Fellow programmers need to read your code too. You have to have comments that make sense without being too lengthy. The faster someone can read and understand your code, the more productive the whole project is. The less time you spend explaining your motives, the easier it is to work with other people and finish your project on time. 

The language of computer programming. Yeah, yeah, I know -- computer science is all about the math! Sure, understanding mathematical concepts is crucial in understanding computer science, but you don't have to be mathematically minded to be good at coding. If you can look at a problem and think about the language of it, it becomes easy to put into code. Think of it as one big word problem, and you've got yourself a fun project to get started on. I find that it's easy to get caught up in the math minutiae when you're writing code, and sometimes it's hard to step back and see the big picture. Language helps a lot in this aspect.

Having a grasp of language is crucial in computer science, just as understanding mathematical concepts is. If you can write, you can translate your code to colloquial language. It makes it easier for you to understand what you're doing and what your fellow programmers are doing. Trust me -- you can't go wrong with having a grasp of language, in any field you choose to pursue.