I participated recently on TopCoder Open 2013, which was open for Cloudspokes members for the first time. I learned a lot on the event, and I enjoyed it much! The participants were presented with the challenge of spinning a wheel with APIs on them, get three and use at least two for a crazy three-day nonstop coding. I was at first a bit disillusioned with mine, because I got Yelp, Docusign and FinancialForce, which seemed an odd choice together at first. However, somehow I managed to get something nice and achieved 2nd place, which was great. I was thinking on writing something to help other people through my experience for future hackatons, being it for TCO but applicable to any other contest. So I humbly present here my Ninja guide to hackatons!
Sit, relax, think
考山を移す - Nothing is impossible to those who have sufficient faith
My first reaction to the APIs I got was like “well, I’ve got no possibilities, so let’s enjoy DC and better luck next year!”. However, a few hours after spinning the wheel, I came up with some feasible ideas (Well, I must say we, credit to my girlfriend who really helped me here) that didn’t sound not so bad. So the tip here is not to be overwhelmed with the whole challenge, just relax, and start thinking. There is always a way to go through! After the brainstorming, I started proof of concept which guides us to the next point.
Start small, grow big
虎穴に入らずんば虎子を得ず - If you do not enter the tiger’s cave, you will not catch its cub
Even the most honored Sensei start small. I had never worked before with any of the APIs, so it was not clear at first what could be done with them. So I got a base project on a few minutes (we will talk about this later) and did three simple, really rudimentary web forms that were supposed to trigger the APIs in the most basic way and write some output to console. Just the fact that something was working, cheered me up and I got a nice point of view of what to do next.
Start with a supporting point
鳶が鷹を産む - A kite breeding a hawk.
On hackatons, time is money (literally) so you don’t want to go throwing shurikens all against your ninja path, just to your target. Don’t start from scratch and try always to have a really basic start point, even if it is just setting up a simple webserver with a page saying “Hello world”. I am a java guy, but I think new technologies like NodeJs can speed up development for prototyping, so I went with the MEAN stack project. You can have a working, database-connected app deployed to heroku in five minutes. Once you see the “this is the main page” message on heroku, morale goes up!
Do not reinvent the wheel, build the coolest car
亀の甲より年の功 - Years know more than books.
You should have tools in your ninja toolbelt which you could leverage on to do all the boilerplate code, so you can focus on the cool stuff you want to build. Nowadays, in the Github era, it is difficult not to find at least someone that have tried what you are trying to do, so look for code to reuse, and leverage on well know components. You need authentication? PassportJS got you covered. You are not an artist with css? Relay on Twitter Bootstrap. Just focus on the cool stuff your application is supposed to do.
There is always hope
七転び八起き - Fall down seven times, stand up eight
There would be some obstacles on your ninja path, that will drag you from achieving the final result. Just don’t let them drive you mad. Have you thought of all the possibilities? Is there an easier way to achieve your objective? At some point on the hackaton, I found myself installing custom libraries on heroku at 3AM to generate QR codes at the lowest level, which made me loose precious time with no result. But after relaxing for a bit I thought, “Hey, I’m in the cloud, why can’t I relay on it?” So I searched for QR generation APIs and was able to get the functionality I wanted in about 15 minutes. Sometimes is better to take one step back and think to get one further.
Divide and conquer
正田も積もれば大木を倒す - With many little strokes a large tree is felled
You will not see ninjas in action facing all enemies at the same time like in a Chuck Norris movie, instead, they take one target at a time with precision, then go to the next. You should write down in a paper all the targets you have, and start crossing them out once they are done. That way you will have a clear view on where are you in your path. Put the most important ones on the top of the list, the nice-to-haves on the bottom. I left some of the features I wanted on the application uncrossed, but I got a finished product, which is more valuable than a bunch of half implemented features.
So this are my thoughts, maybe they don’t fit everyone out there, but were for sure helpful to me. Let me know if this was useful to you!