Mark Cautillo’s Little Piece of The Internet.

Feb 10

Imagine a World

iconFebruary 10th, 2008

I think that there’s a fairly serious problem with the programming languages that are in common use today. Most people seem to agree that object oriented languages such as Java, C++, Python, etc. are in some way better languages than early programming languages or assembly code.

A quick look at the wikipedia page on object-oriented programming gives some of these reasons:

Object oriented programming roots reach all the way back to the 1960s. As hardware and software became increasingly complex, researchers studied how software quality could be maintained. Object-oriented programming was deployed in part as an attempt to address this problem by strongly emphasizing discrete units of programming logic and re-usability in software.

Since it’s inception, object-oriented programming has proven to be an extremely useful way to think about programming. Through the use of an OO style, a programmer is able to encapsulate programming elements, abstract complex behaviour, inherit behaviour from other objects and control access to data and code. All of these features have made object oriented programming as popular and important as it is today. Even though OO code is a powerful and important tool, it is not without it’s flaws.

I would argue that a key concept in programming is the ability to encapsulate any logical construct so that it can be re-used in the future. Object oriented programming undoubtebly allows for some of this encapsulation. Whenever you write a method or a class, you are encapsulating functionality. The problem is that there are certain types of functionality that are either extremely difficult to encapsulate or impossible to encapsulate.

Design Patterns are widely celebrated and studied by advanced users of object oriented programming languages, and yet they seem to be an admission that there is something fundamentally wrong with the design of these languages.

There are a number of programming challenges which a developer encounters regularly in object-oriented design. There are also widely accepted solutions to these problems. The best known are the design patterns codified by Gamma et al, but in a broader sense the term “design patterns” can be used to refer to any general, repeatable solution to a commonly occurring problem in software design. Some of these commonly occurring problems have implications and solutions particular to object-oriented development.

If these patterns are repeatable and general, why is it that we haven’t put them into libraries in the same way that we have put file manipulation code into a library. I’ll try to motivate what I’m saying with a particular example.

One common and simple design pattern is the singleton pattern. The singleton pattern allows you to instantiate an object while forcing the object to have a single instance. Typically it takes 5-10 lines of code to convert a standard class into a singleton. You need to make the class’ constructor private and then add a method to get the singleton instance. While the amount of code involved in making a singleton is fairly small, it would be helpful to be able to encapsulate it.

Once you have defined what it means for a class to be singleton, it would be nice to be able to simply write:

singleton class ClassName

as opposed to the 5-10 lines of code it would normally take. Creating a construct as above is quite difficult in current object oriented languages. Something similar can be done using templates in C++ or generics in C#/VB.Net but it is likely not something worth doing due to the amount of work required, and does not provide quite the same results. The key ability that is missing in modern OO languages is the ability to define your own syntax . An object oriented programmer can only define certain types of syntax such as method calls or objects, but it becomes extremely difficult to define constructs in the vein of if statements or for loops.

I am currently doing research with Professor Gary Baumgartner at the University of Toronto to help remove some of these limitations from object oriented languages. It is interesting to note that there are already languages which allow this type of control. The macro systems in Lisp and various Lisp dialects allow for exactly these things. My next few blog posts will revolve around how existing languages provide this macro functionality while looking into how the control they offer can be wrapped around existing languages.

Dec 1

A Walk in the Park

iconDecember 1st, 2007

I happen to be lucky enough to live very close to some wonderful conservation sites. I went walking through Boyd Park recently and took some photos so I could share my experience.

Here’s the start of my walk, upon entering the forest, I was greeting with a beautiful view of the sun streaming through the trees.

It’s definitely winter just north of Toronto, but there is still some signs of life peeking through the snow.

I had never noticed these stairs before, I found them just a little ways off of the main trail.

I found quite a number of animal tracks along the path.

The park holds various nature camps in the summer and sometimes the kids build their own shelters. I found 3 of these over the course of my walk today.

After finding this shelter, I had to cross a small stream.

Crossing it was harder than I expected, since upon arriving at the bridge I usually take, I found this instead:

So, I crawled across a nearby log:

After walking deeper into the park, I stopped seeing footprints. It was just me and a pair of bicyclists who had been this far.

Eventually, even the bicyclists turned around, but I kept on going.

And I’m glad I did keep going, because I found some things that I’d never expect to find.

I guess it made for a good view of the river. Unfortunately, that door was nailed shut.
The river was just starting to freeze, so there were some beautiful ice formations.

I feel sorry for whoever got their kite stuck in the power lines:

I found some evidence of beavers:

And then some proof:

Not sure what these are doing in a conservation area, they look almost like air raid sirens:

Having not seen a single person in the park for the 2 hours I had been walking, and no evidence of people since the bike tracks, things started to take on a decidedly eerie feel. I felt like I had jumped into a forgotten past.

Look how far we’ve come. (That’s my cell phone on the top)

Then there’s the forever closed refreshment booth:

I really wanted to get inside, but the door was firmly locked, and apparently I wasn’t the only one who had tried to get in:

Inside there were ancient bottles of paint, and other strange containers I couldn’t identify:

Continuing on, I found some very recent evidence of beavers:

And passed by the best tobogganing hill I know (check out the soccer net for scale):

Nearing the edge of the park, I finally found some people, all in cars, driving by, ignoring what’s right beside them.

I decided to try a path I had never taken before, and was greeted by this:

So of course, I ran / tumbled / rolled down a nearby hill:

To get to the pond below

After exploring around for a while, I had to find a way back home, and I knew I needed to cross the river. Not wanting to cross at the road, I decided to follow the river in the other direction. In winter, it gets dark fast, and I was desperate to find a place to cross. After about half an hour, I found this, and thought that it would be a great place to try crossing.

But, all those warnings you hear about thin ice are not unfounded, and rivers are damn cold in winter. Luckily, I only broke the ice at the edge where things were very shallow, but I did have a very cold foot for the rest of the walk. Deciding not to risk jumping over the river again, I kept walking along it.

I was particularly glad that I decided not to try again after seeing this sign:

I finally found a bridge in the park, and crossed over. Luckily by that point I knew exactly where I was, otherwise, a path like this one might have scared me a little bit.

This was the last photo I took during the walk, and right after taking it, I saw an eerie red light bounding through the forest casting crazy shadows. The light started coming straight for me really quickly. And then it jumped on me and proceeded to try and lick my face. It’s name was Ginger and it was a beautiful shaggy dog out for a walk with it’s owners.

After seeing ginger, I saw a fox walking along the path in front of me, which promptly ran away as soon as it heard my footsteps.

I also saw a couple of deer running through the trees, and passed by a man with a big husky, who smelled strongly of marijuana.

I was glad to get home and change into dry socks.

So why did I feel the need to share this experience with you? I was thinking about games and exploration. A lot of games try to give a sense of exploration, but very few seem to achieve it. I think that what is lacking is diversity of things to find, and a challenge involved in the act of exploring.

I found exploration quite thrilling in the game Morrowind, but didn’t find it nearly as exciting in it’s sequel Oblivion, because I think the Oblivion environment was much more uniform and repetitive than Morrowind’s, and there were no difficult places to get to.

I don’t claim to know how to emulate a good exploratory feeling in a game, but I do know that I found exploring that park yesterday much more rewarding then I find exploration in games. I think it has to do largely with the diversity of the environment. Game designers need to find a way to capture that feel of constant discovery in their games if they want to cater to players who are interested in exploring a world.

Another factor I think is involved is the level of challenge, some of the wonderful views I saw during my walk would not have been so rewarding if I didn’t need to climb a huge hill first to get to them. It wouldn’t have been so exciting to find a creek if I didn’t need to crawl across a log to get to the other side because the bridge was out. Getting home wouldn’t quite be the same if I didn’t have to follow the river trying to find a safe place to cross in order to get there.

I highly recommend that people go out and enjoy the conservation areas and parks that Ontario has to offer, as I think that experiencing them can really inspire you in many ways. Hopefully one day games will be able to capture these feelings so that people who aren’t lucky enough to live right next to a conservation area can feel the same sense of excitement and exploration.

You can see some more pictures from my walk in higher resolution in the Picasa web album where I stored the images.

Nov 11

Blurred Lines

iconNovember 11th, 2007

We’ve all heard about violence in games and the affects it may or may not have on children. I won’t be making a statement on whether or not violence in games has an affect on children. I do, however, think that the line between games and reality is not as distinct for them as it is for adults. I remember from my own childhood that events and places in games sometimes seemed just as real to me as events and places in the real world. I was recently reminded of that feeling while having a conversation with some little people I know.

They were super excited about their Webkinz. For anyone out there who hasn’t heard of these things, they are essentially a cross between Tamagochi, Pokemon and MMORPGs. The website is run by Ganz, a manufacturer of stuffed animals. Kids can “adopt” a pet by buying a stuffed animal in a store. They can then take their pet home and use a code on the toy’s tag to access an on-line world for their pets to play in. They then take care of their pets in the world. By playing online flash games, they can earn “KinzCash” to buy things to use in the world.

Now that we’re all on the same page, lets get back to the talk I had with the kids. I was surprised by the way they treated this virtual world. Everything that happened in the world was as real and as important as what was happening in their daily lives, if not more important to them. One of them was so proud that she bought a monster truck for her pet and couldn’t wait to tell me about how she could drive her pets around in it. Another had been told by his parents that he couldn’t buy anything in the game because he was wasting his money. He had been buying things that his pet could wear on it’s head. He bought a warrior hat and a Mohawk. They thought he should be saving up to buy something better like the monster truck and had forbidden him from buying anything else in the game. He felt pretty bad, since he thought he had done something wrong.

So why am I bringing all of this up? I realized while hanging out with the kids that they weren’t talking about these things like they were in a game, they were talking about them like they were a part of their lives. The game was a big part of their lives, which made me a little worried about something. Even a seemingly innocent game such as webkinz could act as a powerful advertising force. I think that as game designers, it is important for us to realize how much of an impact our creations can have on people, whether we mean them to or not. We have to be careful about what we are teaching through games, especially when those games are made for kids. If games actually can affect people’s lives profoundly, I’d like to be sure I’m not teaching the wrong things. And maybe violence isn’t the only thing we should be worried about.

Nov 5

Welcome!

iconNovember 5th, 2007

Hi everyone! Welcome to my blog. I’ll be posting some more interesting entries once I get a good theme settled for the site and think of something enlightening to say. For now, I’ll just leave things at:

Hello World!