Warming Up

I hung out with Chevy Ray of FlashPunk fame the other night, and he shared with me some programmer wisdom. Which I now share with you: warm up!!


I always make it a point of mine to spend enough time warming up before physical activities. Whether it’s going for a run, dancing, rock-climbing…anything physical. I always make sure to spend the first few minutes doing some light but similar exercises, stretches etc. It literally serves to warm the joints and muscles, because they become more flexible and powerful a few degrees above body temperature, but it also serves to put me into a more self-forgiving mindframe. I suppose it’s because when I warm up it really drives home the point that I’m human, that I’m not perfect, and that it can take me a little while to get into the groove of something so that I can do my best work.


What Chevy pointed out to me was warm-ups can be made for mental activities as well. Some of the best teachers I know get their students into the right frame for class by throwing around some open brainstorming or opinion questions: mentally warming their students up for the subject at hand. And it’s just as useful to put this idea into practice for the dark art of computer programming. And I don’t know about you, but being more aware that I’m human, not perfect, and need to get into the groove of something goes a long way towards helping out that pesky programmers block :)


So today as I start my programming, I’ll be taking Chevy’s advice: start on a few small things, just change some colours around or tweak some variables, write a piece of code you’ve already written before, change some formatting or variable names. Just to warm up. Don’t get buried in changing little things, just get the mind thinking about programming before moving on to what needs to be done today.

Multiplayer Madness

So I was recently linked to a youtube video, a tragic one for those of us who are quite attached to our consoles: Asian Girlfriend Destroys PS3.  After watching the video, I realised two things: firstly, the guy probably deserved what he got; secondly, there is a whole slew of similar videos in the related tab:  Hot Chick Smashes Boyfriends XBox 360 Console, Psycho Girlfriend Smashes XBox and they got me thinking about videos like Girlfriend Deletes WOW Characters.

Really there is no need to watch any of these videos, anyone can get the gist of them from their names. And it pointed out to me one of the intrinsic issues that I have with multiplayer games, and one of the main reasons why I don’t play them: there’s no pause button. In a single-player game, the whole thing is being run by you. If something important comes up, a friend pops around, or the kettle is boiled then it’s no issue to stop the game and do whatever it is that needs to be done: make a cup of tea, converse with your friend, do that vacuuming you said you’d do 3 days ago. This could mean pausing the game, or I can even switch my console off and know that I can always resume the story at the last checkpoint. Multiplayer games don’t have that luxury.

One of the things it’s easy to forget when my career is based around video games is that consumers have this thing called Real Life as well. And frankly, that’s more important to them than my game is – whether they treat it that way or not. I recently had a long discussion about the ethics of games like World of Warcraft that seem to deliberately offer incentives for remaining in the game (unless you’re in Korea, where they boot you out every so often to eat food). My argument at the time was that developers try to make their game as fun as possible, which can inadvertedly lead to mechanics not dissimilar to those of poker/slot machines and create an addictive experience. What I forgot at the time was the staying power intrinsic in being online with other people. See, most people are FOMO’s.

FOMO is the Fear Of Missing Out, and it happens to essentially anyone who’s leaving a situation where everyone else is going to stay. In a singleplayer game this feeling doesn’t often come up, because I can always go back and do that thing, or play through the game again differently. In multiplayer there’s a constant FOMO – I could miss out on experience points, sweet drops, that stupid thing Leroy did, killing that annoying guy (boom, headshot) etc. And now that there’s plans to punish rage-quitters there’s actually negative reinforcement around the idea of leaving. But how can you tell the difference between a rage-quitter and a guy who wants a cup of tea with his girlfriend?

This is I suppose a post of solidarity with the other bloggers out there who are criticising game length as a measurement of quality: Mutliplayer games are repetitive and essentially as long as the player’s attention span is. That doesn’t necessarily mean they’re good, just that people don’t want to leave them. Give me a 6-hr long epic single-player over a multiplayer mode any day of the week.

Other blogs on Game Length:

They’re everywhere…

I’m pretty new to iPhone development.

I mean, I’ve only been using Objective-C as a language since January this year. Almost a decade of C++ experience before certainly helped me pick up a few concepts, but I’m certainly not about to go parading myself as a guru anytime soon. In fact, I still end up turning to Google on a daily basis for insight on whatever issue I’m having with Cocoa Touch that hour.

Something I can’t help but make notice of are the number of accepted solutions out there that are bad. Not wrong. Most every time I find a solution it does indeed solve the problem at hand. But not elegantly.  Not efficiently. Not well written, not well named, not well tested. And really, just not good code. The examples that spring to mind include C++ code that marked int and float parameters as const in a member function (these integral types are copied when pushed onto the stack for a function call – they’re the same size as a pointer anyway.  Marking them const isn’t const-nazi power, it’s just redundant) and some Objective-C code that didn’t bother naming the second parameter of a method (Obj-C has a quirky style of naming any parameters after the first one, leading to highly descriptive method names like

middle:@"is" suffix:@"SPARTA!"

Not using this convention shows a deep misunderstanding of the language).
Any new or learning programmer that finds a solution of this sort and then tries to copy-paste said code into their project will be met with a rather unpleasant surprise. Their code instantly becomes less consistent, less standardised and less maintainable. Let’s be honest though – they deserve it.

Yes, I bet you thought this post would be a rant about how “solutions never work when I copy-paste them into my DetailViewController.m”. Not so, and shame on you sir for thinking so! For you see, I like it that Google’s proferred solutions don’t work like cookie-cutter magic. For me, as I expect it is with most people, if all I do is copy and paste then I don’t learn anything. If the code works without me having to do anything then the next time I get faced with a similar challenge my first thought isn’t going to be “I’ve solved this before”, it’s going to be “where was that website that solved this for me?”. And frankly, those people I’ve seen that do try to copy-paste the code and then comment asking for it to be slightly modified to suit their needs usually deserve whatever issues they bring upon themselves. And maybe it will eventually help them: I know from my years of programming that one of the best motivators for writing good code is having to maintain bad code in another system.

So bring on the bad solutions – seriously. As a blogger I’m usually tempted to try and make the code I release here robust and reusable and free of coupling issues. I don’t plan to stop that – I like to think that keepiing these things in mind are indicative or where I’m at as a programmer, these are the worries I’ve earned and I’m not going to drop them so that someone else can learn from mistakes I shouldn’t have made. But I’m not going to spend extra time to make that code as pretty and useful as possible: it’s up to the person that wants to use it to get in there and change every line and variable name that they need to – and learn what the code actually does at the same time.

Playing with others

After a long period of being injured, I’m beginning my foray back into the world of parkour.  It seems like no matter how often I seem to make mistakes and hurt myself during this sport, I keep coming back to it.  I’d like to think that maybe the universe is telling me that I’m supposed to be a traceur; gently, inevitably pulling me back towards parkour everytime.  Of course, it could also just be my own bloody-mindedness :)

This time there’s a difference in how I find myself training though.  While before it became about power, ability; “how big is that, reckon you could make it across?” etc.  This time though, the moves don’t matter to me.  This time I’m concentrating on the movement between the moves.  I’ve realised that’s the place where true efficiency can be discovered.  And I don’t think I would have realised this – or even gotten back to regular training this quickly – without the help of the guy I train with.  In fact, there’s a lot of situations where I actually needed someone else just to get me to do something I’d always wanted to do.

When I think of the things I’ve achieved, more often than not there’s a teacher or friend there that motivates me and pushes me past my limit.  When I think of the things that I’ve failed at, or am still meandering about trying to do – they’re things that I’m trying to do alone, and for no-one but myself.  I guess the people in my life that aren’t me are the greatest motivators :)

I think of my new obsession – Bikram yoga – where the teacher pushes each and every one of us to try harder than we want to, and for me it works.  After just 3 classes I can touch my toes, knees straight, for the first time in my life!

I think of dancing and my amazing teachers, always giving me new challenges and watching intently as I take them on.  And the partner that’s always in my arms, hoping to understand the move we’re learning, or try something new with it.

Most especially I think of my mentor, James.  Without him I never would have pushed myself into the places I hate – the bars and pubs and clubs where the music is played too late and the people throng around me spilling drinks – but because I did I now have no fear in meeting new friends whenever I’m networking or out alone.

So the point of this week’s – this month’s – musing is that oftentimes bringing someone else into a project, being directed by someone else, or wanting to create something for someone else is the greatest motivator of all.

Agile Musings

I’ve been writing my own code using Test Driven Development (TDD) for about 6 months now, and at the same time have found myself professionally working for two different non-games firms.  In this time I’ve had the opportunity to try using agile methodologies – and unit testing – in a few different environments: business through to casual.  I want to share some thoughts and musings from this time.

Firstly, tests are hard.  Plenty of people have covered this point in the blogosphere and beyond, but until I actually tried it just never truly sunk in how hard they are.  It’s one thing to be “informed” that “agile is difficult”, but it’s an altogether different experience when I’m staring blankly at my screen with absolutely no idea how to write a test for this functionality I want.  And those moments happen.  A lot.  And they are truly a struggle to get through, but I learn very important lessons once I figure them out.  And yes, it takes dedication and effort to figure them out.

Secondly, getting tests onto legacy code is even harder.  I have a secret obsession with Michael Feathers’ fantastic book Working With Legacy Code, which gives some plentiful ideas for how to add tests to code that was never designed with tests in mind.  Armed with these suggestions, some experience writing brand new code covered by tests, and the right environment, one can get tests on just about anything.  In a casual environment i.e. When I’m my own boss, I find it pretty easy to see the benefit for refactoring old code to make it testable (I’m easily convinced though) :).  Things get a bit iffy when the work is for someone else though.  In my experience there are often factors preventing the system going under test that have absolutely nothing to do with the code.  People can be lazy, or busy, or scared of tests.  Unless the whole team makes a commitment to getting agile, it’s probably not a good idea to spend hours finding seams and getting code under tests.

Finally, it’s worth it.  It’s damn worth it.  I’ve never written such beautiful or simple code as I do when I write tests first.  But code aesthetics is a nothing phrase to most managers and business men.  Luckily, along with writing nice code I find I write code that catches bugs more easily (at this stage each bug is usually a situation where I didn’t think to put a test case in), code that’s easier to maintain and understand (easy to tell what something does and how it works when a test is written for it) and my favourite: it increases my productivity (I make it a point to end each of my coding sessions on a failing test.  It’s lovely to just hit compile and see exactly what that next thing I need to do is.  Straight back into it!)

Half the battle is getting it working

Unit testing in XCode.  Using Git with ProjectLocker (or at all).  Using Eclipse for C++ development.  These and many other things had been lingering on my todo list far too long before they actually got done.  And basically this is because I tried them once, and it wasn’t a straightforward path to get them working.

When adopting a new tool, or trying out a new way of doing things, half the battle can turn out to be actually getting it working the way it’s supposed to.  Sometimes, such as when changing to Scrum or XP, learning 3D modelling, or trying to use any of Adobe’s top-shelf applications, this is because it’s hard to learn.  Old ideas or techniques or heuristics need to be thrown out and I have to try and learn from step one in a strange new world that looks eerily like the same computer I was just happily using Visual Studio on.

Some other times, however, it’s not so much a challenge as it is a bare-knuckles bar brawl with the ghost in the machine.  Unit testing with XCode, for example, threw up a random “unknown error” message that Google was powerless against.  It could only be fixed by completing removing, reinstalling and then updating XCode to the Snow Leopard exclusive version.  Eclipse seemed to gag on its own shirt shortly after the installation procedure finished, and a tutorial that was almost 3 versions behind didn’t help.  Eventually a friendly guru helped me to set it up, and I now have a half-dozen *nix-based command-line tools installed on my system that I’m only slowly learning about one at a time.

Git is a similar story.  Like Eclipse, it seems like a damn good idea in theory.  In practice, it requires setting up security keys, which requires ssh, which requires installing yet another half-dozen unknown nix-based command line tools into my windows with blurred lines regarding where the Windows prompt ends and the Nix-prompt begins.  In the end – and I thought I’d never say this – thank god I had a Mac.  With everything already set up in it’s distant-cousin-to-Unix OS, installing and setting up git finally become a “follow the tutorial” affair.  Which was all prompted by wanting the latest version of the fantastic App-Sales Mobile.

Anyway, rambling aside my message for this week is: sometimes trying something new is hard because it takes a refocus, sometimes it’s just not as easy to set up as possible.  If anyone reads this thing, feel free to leave your own comments about installs or set-ups that were way harder than they needed to be, and how you eventually conquered them.

Inputs and Outputs

A good friend and mentor of mine has convinced me to try  a suggestion of his to “get creative”.  I, in turn, convinced a good friend of mine to join me in the challenge.  Hopefully this is going to make quite a change to the way I view and discuss things – especially here on my well-hidden little blog :)

The basic idea is this: Get right-brained.
Every day I spend at work is a day I’m programming and thinking in the logical, problem-solving part of my mind – the left-side of the brain.  While this works fine for coding, social interaction is a creative activity – it uses the right-side of the brain – and trying to delve into an interesting conversation after a day of coding can range anywhere from difficult, to impossible for me to embrace.

So, to help me be something more of a social animal – I need to get some practice in right-braininess: get the creative juices of my mind flowing, as it were.  To do this, I need to differentiate between inputs and outputs in my life.DominicProcopio_Wxfield_base_switchboard_1955__2_

Inputs are essentially anything which I absorb, watch, view or somehow experience in a passive way.  TV, movies, video games*,  fiction books, browsing the interweb and listening to boring people talk are all inputs.  Inputs are good for expanding knowledge, awareness and understanding.  But they do nothing to help me understand myself or to create new things.

Outputs, on the other hand, are things I have an active hand in.  They include things that I can create directly: painting, blogging, writing, journaling, sketching – or in my case, stick-figure doodling :).  They also include things where I’m expressing or using my body somehow, such as exercise, dancing, jogging, singing, talking to people etc.

Inputs let me understand the world – outputs let me understand myself.  So over the next 2 weeks myself and my awesome friend will be doing the “Input-matching challenge”: for every input we give ourselves, we’ll create an output to match it.  If it’s a book, TV show, video game etc – we write a review.  If it’s knowledge (*ahem*Wikipedia-whore*ahem*), we journal it.  We can offset it with anything from singing, to swing dancing, to writing, to larking about in our underpants.  It’s just gotta be an output.

Wish us luck!

* Sure, games are interactive, but the player interacts as a character, in a designers world, following a scripted storyline etc.  Almost all (that I know of) are escapist and therefore not a proper output – in fact, that’s half the reason they’re fun :)

On styling and sauces

This post is really sort of a rehash of a conversation I had with a friend the other day.  I’ve recently become somewhat enamoured with the idea of a raw food diet.  That is, making sure as much of a  picture from http://healing.about.com/od/healernetwork/ig/Pictorial-Site-Index/Raw-Food-Diet.htmmeal as possible is uncooked fruit, veg, bran, wheat etc.  Obviously the two main issues with this diet are meat and white bread – two of my favourite cooked foods!  So I excuse them, because not eating meat is just stupid, and white bread tastes nice (and wheat bread tastes like sucking on sand).  And to any vegans I may have just insulted by claiming not eating meat is stupid, I apologise: I’m sorry that you’re stupid :)

So while I’m happily munching away on my raw carrots, lettuce etc (with a nicely grilled steak on the side), my friend heads out to a 10 course degustation dinner for two (all expenses courtesy of his work the lucky bastard).  And it makes me think: it’s all well and good to be reverting to hunter-gatherer cuisine Bear Grylls-style, but then what has been the point of the last several hundred years of evolution in our cooking abilities.  As far as I remember, Fred Flintstone never had a George Foreman grill.  And as I’m a firm believer in there not being such a thing as a step backwards, I set myself to musing to how to integrate these two ideas.

What I decided on was that flashy cooking is like styling a basic in dancing.  It’s fun, it’s showy, it adds something unique – but only if image from http://euro-quest.tripod.com/prague_swing_lindy_hop_dance_classes/ you don’t do it every time.  If a styled basic becomes your default it doesn’t look cool anymore, it looks like you’re a retard that can’t dance a basic properly.  If you keep always styling your basics, you end up being confusing and unpredictable.  But if you have a clean basic and throw a style in every now and again, it creates this ‘WOW’ factor.  Flashy cooking is like that.  Things like sauces, char-grilled vegetables, cheeseburgers, cabanossi and degustation menus – those sorts of things that couldn’t possibly count as a part of every healthy hunter-gatherer’s food sources – they’re styling.  Always eating cheeseburgers trains your body to be shit at digesting stuff (no pun intended).  Always cooking in strange and different ways (like I’ve been doing most of my life) throws your body’s energy levels into confusing and your sleep cycles all over the place.  But with a clean basic – raw food and meat – then adding all these extras every now and again is fantastic.

Succeeding to fail

If you try to fail, and succeed: what have you done?

It’s one of my favourite rhetorical questions, and one that I’m reminding myself of a lot more now that I’ve returned to practising Parkour.

The human body is, without any doubt, the most amazing machine ever invented.  It’s like a great big physical neural network – whatever I put into it, it takes it on board and changes next sleep.  A good friend once told me “whatever you’re doing right now – whether it’s running, swimming, sitting or lying down – that’s what you’re training your body to do from now on”, and the words are very true.  This leads me into the topic I’m musing on this week: the idea of failure, and how it’s not always such a bad thing.

Yoda says: “Do, or do not.  There is not try”, and we live those words in parkour.  Every jump, a catch and vault must be fully committed to, it’s the only way to truly push our own boundaries.  In the absence of try though, what does exist is “fail”.  It’s amazed me how the parkour community – as well as a lot of other online communities – seem to have moved to concept of fail into a noun in its own right (to get an idea of what I’m talking about, check out any online forum like Sydney Parkour and do a search for fail: you come up with terms like “you’re full of fail”, “there’s fail in the water”, “the bitter taste of fail”, and even “the AIDS crabs live on fail”).  In parkour especially though, fail has another meaning – a good one.  Failing at something doesn’t just mean I didn’t succeed at it.  It means I tried my all, fully committed, pushed my limits, and didn’t succeed at it.  Not succeeding is the least of my worries – being fully committed, pushing my limits and trying my all is the key: those are the actions that improve my technique, increase my confidence, and most importantly – prompt my body to add enough flexibility/muscle mass etc. to get me closer every time.
In parkour, fail doesn’t just mean fail.  It means pushing yourself one step closer to success next time.

The human body truly is an amazing machine, and pushing it to success – even if I might get a bit of fail on me in the process – is easily the most amazing thing I’ve ever felt a part of.  It leads me to thinking that the human mind can’t be that different: that even if I can’t find that special solution, that phrase that’s just right, visualise that outcome or imagine the next step – so long as I’m trying my best, fully committing, and pushing my limits it doesn’t matter.  I’m not failing to be successful, I’m succeeding to fail.

Physically or mentally, are you truly pushing your limits?  Embrace the fail :)

What is Value?

I’ve had these words written on a post-it on my work computer, and a scrap of paper blu-tacked to my home computer desk, for almost a year now.  “What is Value?”

When I first put them up at the recommendation of David Deangelo,  I didn’t really understand what they meant and as I write this blog I still don’t.  The point of putting the words up is not to know the answer, but to always be asking the question from different contexts, first by asking what is valuable: “What is valuable to me?”,  “What is valuable to her?”, “What is valuable to my boss?”; then by asking what being valuable, or not being valuable means, to simply ask: “What is value?” To me?  To her?  To my boss? etc.  It was an idea that really appealed to me, and as I recently got reminded of the concept I wanted to share some musings on it.

The muse, in this case, was Batman.  Or, to be more specific, my housemate playing Batman: Arkham Asylum.  I watched him struggling and swearing and restarting his way through one of the final minion battles – one that I found disappointingly easy – and realised that over the course of the game, he never became particularly skilled at the controls.  To me, a game like Arkham Asylum (which if you haven’t played yet – go get it right now!) offers a window to perfection: it’s technically possibly to go through the entire game without Batman taking a single hit, or at least only taking a few grazing body punches.  To me that makes the game so much more believable that it becomes valuable to me to get skilled enough at the controls to play a believable game.

Of course, my housemate doesn’t feel the same way, and only ever became skilled enough at the controls to get through the parts he needed to.  And it reminded me to ask myself: “What is Value, to him?”

What is Value to you?