Saturday, November 30, 2013

What was it like to learn how to code?

About a year and a half ago, I seriously started learning how to code.  I had no formal training, but had picked up some programming knowledge since graduating from undergrad.  Now in business school, I had the idea that I could program a game instead of a normal summer internship.  I'd learn more about technology, put my previous gaming experience to use, and might even make a few dollars.

I remember visiting a friend's gaming startup.  One of the engineers asked me what I planned to do over the summer.  I - hesitantly, I'm sure - answered that I was going to create my own simple tactical RPG. But oh, by the way, I didn't even know how to code.  I was learning as I went along.  He looked at me like I was crazy.

But the thing is - I did it!  I built Solarian Tactics on a shoestring budget and actually shipped something.  This summer, I released a sequel of sorts, Sol Heroes, based on my learnings from the first experience.  Tens of thousands of people have played my games.  And while it's nothing compared to what we would have considered a success when I was at Playfish, sometimes I am still shocked to think that more people have touched this product I made than I will probably get to know in my entire life.

So how does it feel to have my year and half of coding experience?

Mostly it feels like I am doing something wrong.
I always have this nagging feeling that I am doing something wrong.  In the beginning, I had some amazingly ignorant comments in my code like //What is an instance variable?

But even now, I sometimes worry that the entire architecture of my game is fundamentally screwed up or that I have misunderstood something all this time.

When someone asks me how I wrote the artificial intelligence for my game, I still chuckle to myself.  To me, I felt like I wrote some horribly inefficient code and plugged in some probably stupid variables, not something that I can dare call an "AI algorithm."

I fought a lot more with libraries than I expected
I used an open source framework, Cocos2D, to help run my game.  There were a lot of questions I had that I couldn't easily find the answer for - could I use Cocos2D with storyboards? Does it make sense to use CCBatchNode when I just have 10 sprites?  I was simultaneously shocked that the documentation could be so bad, and amazingly thankful that someone took the time to make the framework available to me free of charge.

There was a time when Sol Heroes was crashing more than once a day for each user it had. Someone left a review of my app with the title "Terrible Coding" and I felt my users had finally figured me out.  The issues turned out to be related to how I misunderstood Cocos2D.  And I felt I spent days searching Google and Stack Overflow for my obscure error.  It didn't feel productive at all - I wasn't writing any code and I also wasn't learning something useful about the library.  I just went down different rabbit holes hoping the problem went away.  I finally fixed that particular problem - and I'll leave this graph here since I'm damn proud of it - but it was painful.

It was times when I could just write code that I felt most productive - for example, ironically, the "AI Algorithm" that I created.

I'm afraid of updating anything
In this last year, I learned to be afraid when updating anything (I suspect "real programmers" would not feel this way).   For example, I updated my iPhone to iOS 7 when it came out.  This simple change led to a series of pain.  First, I realized that I could no longer test my game on my phone through Xcode.  I had to update Xcode.  So I went ahead and tried to do that.  I realized I had to pay $20 for the Mountain Lion upgrade to my Mac OS before I could update Xcode.  I paid and upgraded to Mountain Lion.  Now, I updated to Xcode 5.  Unfortunately, Xcode 5 is really meant to only work with iOS 7.  My whole games UI was based on iOS 6.  So I had to look up some clever ways to support both iOS 6 and 7 on StackOverflow.  Okay, now that I did that, I realized iOS 7 displays fonts differently than iOS 6, so I needed a solution to that... and it went on and on.

It's satisfying to ship something
Despite all of these hiccups, I had a great time making these games.  It was satisfying to have an idea of what feature I want to make and then just be able to make it.  I could see feedback from users, good or bad, once it was released.  It is fun to open up my iPhone and show people what I made.

If I step back, it was satisfying not just release games, but to take on a big technical challenge like learning how to code a game without any experience.  A part of me never thought I could actually actually do it (though I obviously decided to try!).  And I think I demystified for myself a lot of what it means to program something.

Overall, I expect in the future I'll be less afraid to tackle new technical challenges.

2 comments:

online courses said...
This comment has been removed by a blog administrator.
Cho co said...

There are Business Intelligence companies in India who sell software to Indian corporates to monitor open source emissions. There are database providers in India, artificial intelligence certification