Monday, 16 February 2015

Object Oriented Programming, thoughts

This weeks opinion piece/assignment is about Object Oriented Programming concepts and what I think of them. As in all things there are the good, the bad and the ugly. I will start with the good. There seems to be a nice compact organization about the way like actions are grouped together. The class system, computer not social, is a logical grouping of similar activities (methods). I can see how over the long run especially with large complex programs that farming off repeatable activities into methods allows the underlying logic of those methods to be changed without effecting the downstream functions that are using them. As long as the functionality of a method doesn't change than improvements can be made without destroying the whole and with limited duplication of effort.

Now on to the bad. This is where we end up going down the rabbit hole. Not everything can fit in the nice construct of a class but there is the temptation to try anyway. This is akin to finding a nice colour of blue paint, you paint one room with it and you think it looks so awesome that you proceed to paint every room in the house the same colour. The paint is still a nice colour but now your house looks ridiculous. It is pretty simple logic to go from classes being good to having everything in classes as being better. That is one possible outcome, but not the only possible outcome!

And finally the ugly, unreadable code. I think this is where we take the bad to the extreme. Chopping things into smaller and smaller classes and sub-classes so it becomes difficult to know which class is doing what. At some point the programmers using your classes won't know where to look for things and end up writing functions that recreate what exists in multiple classes. I am sure nobody wants to end up there but I can definitely see it happening.

My overall impressions are very favourable and enthusiastic for OOP. I can see why the programming world has gone this direction since it makes such logical sense. As long as I stay aware of the possible pitfalls and not get carried away (like I did with recursion) then all will go well. I think the goal is consistency. Be organized at the start and only the good will happen, not the bad and the ugly.

Sunday, 8 February 2015

But is it fun

Not sure if this student thing is supposed to be fun. When asked by colleagues of my impressions of doing school work again I tell them I am having fun. It is an interesting reaction that occurs. How can school work be fun? You have a strange definition of fun! Is there some sort of masochistic rule you apply to the phrase fun? I think they are all valid responses so I thought it my be 'fun' to delve into it a bit.

My first thought is that when school is a means to an end, like getting a great job, it takes on a 'must-do' factor that removes any concept of fun. Since that isn't why I have gone back to school this is removed as a constraint. But then I think why didn't I view school as fun the first time around. Is that a restriction that I placed on myself that has led to the career I have had and my subsequent need to do it all again.

The treadmill that is high school, bachelors degree, MBA is all about getting a better job. You look at the patterns of our parents and their peers and determine what you think defines success and try to emulate that path. If my universe was populated with health professionals would the defined path be medical school? I grew up in a neighbourhood full of accountants and middle managers so that was my barometer of what success looks like. The result was Commerce/Economics undergrad followed later by an MBA. Very useful in my current career I must say.

The question is did I have fun. I learned a lot of stuff that I found interesting, and a great deal I didn't. I am a curious sort so learning new things is always exciting. But once I have learned something do I really feel excited by applying the knowledge. I always tell my staff and colleagues that I am a fountain of useless trivia. Sometimes I think that is the bulk of what I achieved with my education. Setting the bar a bit low isn't it.

What is the difference this time? Why do I now believe that school is fun? I think a lot of it stems from mid-career, mid-life self assessment. At some point you start to understand what kind of work makes you happy. There are a lot of things that I am very good at but not as many that I am great at. That is the thing that I didn't understand when I was younger, just because you are good at something doesn't mean that should be the path you choose. What I have now determined is that I want to spend my time doing stuff I am great at and I think that is where the fun comes in.

Of course it is easier for me now that I am not scrambling to get a job so I can pay my student loans (I graduated the first time during a recession). The one thing that I have learned from my time in business is that if you are doing something you are great at then the money/career/accolades will follow. This doesn't always line up with the concept of getting a job. I am not sure you know what you are great at versus good at when you first go to school. You probably have a idea of your good attributes but that doesn't necessarily lend itself to discovering great. I think the problem is when you stop examining what you are good at and accept the career path as determined by your first job you might not achieve all that you can. Counting the years to retirement is not something I want to end up doing.

One thing I have observed about myself and others is that when you are working on something that involves your great then time disappears. I can go for hours working on something that involves my 'great' skills and not even stop for food. I can't say that about the bulk of the work I do for my job. And after all that I emerge thinking that was fun. When work involves something I want to do then it really stops being work, if you view work as a four letter word.

And this is where I get back to fun. If you are learning and doing things that you truly feel are fun then that is probably close to where your great lies. It also helps in the marks department. How many people have you come across taking a course that isn't in their aptitude but they need it for the career they want. Sometimes you have to look at why that course is required and if it isn't your aptitude then perhaps your career direction is mis-aligned.

I am having fun because I am taking courses that focus on my great. I also carry a lot of good things with me as well which can improve my ability to do and make money at great. Nothing I have done or learned previously has been wasted and will definitely come in handy in the future. But I do like having fun.

Monday, 2 February 2015

week four, intro to comp science

Into week four and starting to get the rhythm of the course. Busy week last week with the first assignment due along with the regular lecture/lab routine. Got to experience recursion and how to trace how the program runs through the loops. Didn't find it the most intuitive exercise. More an issue with how to represent the traces that were already identified than what the program was actually doing. Think I have it straight now, will find out on the mid-term this week.

It was good to get the assignment running early so I could spend a good amount of time tuning. Had written a nice little routine for the computer to choose moves in Subtract Square. Unfortunately couldn't use it in the assignment since it was too specific to the one game type. Hopefully I will get to pull it out again down the road. Overall pretty happy with the results from the assignment. It was good to force the use of subclasses to really get a good understanding of how they work.

Looking forward to the mid-term, will be a good indicator of how much I have absorbed so far.