суббота, 27 июня 2015 г.

My route from eployee to business

Introduction

I think this story is pretty common in IT industry. You have relatively good job, work on some project, get your salary every month, but you don't feel happy. Seems like every day is the same, you're tired of routine, you don't grow as a specialist, use the same technologies, your tasks are pretty same every day. Basically, you feel like your clock is ticking and you're doing nothing.

Sounds familiar? Then I would like to tell you my story of how I managed to expand my mind, learned something new, created and published some small product and got a lot of experience, regrets and fun. This story is not about a success or fail. I can't actually decide if it was worth my efforts, but experience I got is priceless.
If you want to know the result I got in advance, check out this Github repo and probably this company homepage.

Few words about myself

I work in IT industry for 5 years. I started as PHP intern in small consulting company. After 3 months realized, that there I would not become expert and moved to one of the largest IT consulting companies in the country and worked there as Java developer. First, I was very excited about the processes and the people worked there. But I wanted to grow fast. And I definitely didn't mind to have more responsibility and work to achieve something. But in that company nobody was interested in me growing as fast as I wished. Actually I did relatively great and after two years became Tech Leader on a small but responsible project. But I felt like I don't learn something new. So when I found my own customer, that promised me over a year of full-time capacity, I wasn't thinking too long. I left the job and started working as an independent consultant. 

My customer was also a consultant. Sometimes he gave me projects, that I was able to delegate to my colleges and have additional income. I have also hired one guy to help me. My customer was 20 years older than me and was also great technical guru, so I learner a lot from him. Forgot to tell, I started to write front-end code in my customer's own framework based on Dojo. Initially I was very happy, but soon I faced the same problem as on my previous job. Even worse, when you're doing business, you can't say your client, that you don't like the project. When you work in some company, you can probably go to the manager and they will move you to another project, but here from my point of view it's not applicable. So I've got another sad period.

New horizons

At that time I was 100% sure that I need to try out something brand new for me. So I started thinking. I thought opposite, thought about new domains, but wanted to minimize the risks and achieve the goals in minimal possible amount of time. Okay, consulting is not the option - I've had a lot of it. Then it definitely should be some product. Not so big though. I need to finish and publish it. Also would be great it would not be another web application, I did a lot of them in the past. Hm... Then mobile application probably? But I've never made any of them. Moreover I need to learn Objective C if I would decide to do iOS app - that's a big educational risk, because I don't know objective C. Oh, then it definitely should be hybrid mobile application. Great! 

Then I needed to think about the goal of this application. At that time I was very excited about 2048 game. The simplicity and the ease of implementation bought me. It would be great to create something similar, thought I. So why not creating some mobile game. But I really don't like copy paste, so I decided not to create another clone and overthink the idea. My head was thinking about some similar things, objects etc. Then I looked at the Rubik's cube. That's it! Hybrid of 2048 and Rubik's cube.

So it was decided. Hybrid mobile application, something similar to both 2048 and Rubik's cube.

Prototyping

This was the first time in my life, when I started with prototype. I wanted to create something fast to show it my friends and ask for their opinion. During some of the weekends, I was thinking about the physics and was playing a bit with html. On monday I got something:


It took me 5 hours to implement this prototype including the time to think about the mechanics. I was really impressed and happy. Most of my friends liked it, because they know how hard it is to create something by yourself. I asked the guy I hired if he would like to help me with it. He was junior, so for him this was more like educational project, which I would curate. So he was fine with what I'm not paying him for it. He agreed and was really inspired that he could take part not just in the consulting, but in creation of some product. Since then we started implementing this. Right now I can say, that it took half a year for me (I will explain later, why it's not we) to finish it.

This only thing I was worried about is complexity of the levels. Was wondering if it's possible to increase it gradually, will it  be possible to create some level structure for user to be interested in continuing playing . But anyway I decided to start with it. Because at that time my main goal was learning.

Framework choosing 

I started development by choosing frameworks. As my main goal was to try something new, I decided to choose one of the most mainstream ones. JS frameworks was actually not that easy option. I kept in mind 3 ones: Angular, Backbone and React. At that time I haven't had experience with any of them. After reading several articles, as well as trying out some basic examples, I turned to the worst possible argument (if I would develop some big production system) - Github stars :). Never the less, Angular did great in my application and I think I will use it in some similar project in the future.

So when I started, I realized that there's only module dependency management system and nothing like AMD for the file structure. I don't like builds much, that inject scripts into the files under VCS, so my decision was to use Require.js to keep my project structure pretty. Honestly, I don't think, that it passed good, because there always were several annoying duplications. But at that time I haven't seen any good alternative.

As for css preprocessor, I used Less.js in the past, so I decided to try out Sass. And that's was it, I did the initial structure (which I refactored dozens of times ) and started writing code.

Design

Fortunately or not, I've had a girlfriend, and she were designer. Actually she didn't design for IT, but anyway I asked her to help me with it. She didn't liked my idea actually. As well she didn't tried to understand why it's important for me. Looking ahead, I can tell, that the cause because of which we parted in few months, was this game. She didn't believed in me and said that this game is crap. It probably is, but it's always pity, when these words are said by the people who seem to be important for you.

Anyway, she asked me for some kind of prototype on the paper, and as it was my part-time-for-fun project, the best time to do it was when I was riding to the picniс. I painted it on my legs :)


Nothing special really, but I wanted to get color scheme and relative sizes as well as some new ideas. Well, my GF didn't really hurried with this work. She said she was always tired, had bad mood etc. That's why several months passed since I got the PSD's :). Anyway that was fine.

Development

I started development with an attempt to understand how complex my game could be. I asked my employee to develop solution searcher. I suggested, that here could be applied Dijkstra's algorithm if you approximate the matrix and the possible shifts as graph, nodes and transitions. If you ever implemented it, you know that it's pretty simple, but performance is pretty bad. And after few days we got working solution searcher. It worked on a matrix sized 3x3, but when I tried to run it on 4x4 matrix it hanged. But anyway I was able to ask several of my questions:
  1. If I randomize the cells with different labels in 3x3 matrix, there's no guarantee, that resulting matrix could be solved.
  2. If 3x3 matrix could be solved, the minimal possible amount of shifts needed for it <= 8.
  3. The number of states, initial matrix could be shifted is very large.
In other words game did passed the POC. Initially the solver script was written in Javascript, but then I have rewritten it in Scala because of performance issues. But this proved another axiom: changing language would not be a solution of you problem, if you have slow algorithm.

I continued development for about a half a year, trying to combine it with my work, personal life. It could be done faster, for sure. But I wanted to make it good, make it in the way I would like it. My employee BTW lost his enthusiasm after he wrote that solver script, so I continued to pushing this project by myself.

Publishing and promotion

The game was accepted by Apple on my first attempt. I was very surprised and really happy, because I heard a lot about how it's hard to publish your application to app store. I released it on 1st February 2015. As you can see from downloads, it didn't get a lot of attention, and I probably here are reasons:
  1. I was worried more about technical stuff than about user would enjoying the game. That's probably because I am developer and I have never made any own products.
  2. I added interstitial ads. - As I worked more and more on the project, I realized, that I have had invested a lot of efforts in this project. I forgot why did I initially started it. I wanted to get something back.
  3. I didn't thought about promotion before I released this game. That's probably common issue, that almost everybody does in their first project.
Thanks to my friend, who works in facebook, I've had some free facebook ads, that gave me in general more than thousand users. Anyway, I was frustrated a bit, that my game didn't get audience.


Path to opensource

I forgot about the game for about a month. I was actually a little bit sad. I put on it, and it didn't worked out, - thought I. And then I started to think how this game can give me more dividends. I've never did a lot of opensource, but realizing the fact, that anyone, who knows something in development can actually go the the web version of my application and download sources, or even unpack the apk file, made me think about publishing the code of this game on Github. I don't lose anything, realized I. Even better, my code could probably help someone or even bring me some new relationship. In general, at that time I understood, that having great opensource profile is good for my career anyway.
So I published it. Moreover I liked opensource. I started doing some small opensource projects and it resulted in 2 commits to Angular.js project. Now I can proudly say, that everyone who uses angular 1.4 has my code running :).


Conclusion

So if you ask me, do I regret now, I will say: "Definitely no!". When thinking about how much have I done, I'm getting really proud of myself. For anyone, who tried to finish some project of his own it goes without saying. But did I actually achieved and learned?
  1. First of all, I made some project for my portfolio, that is in production.
  2. I have learned and got good experience in several new frameworks and tools. I have seen several new approaches and right now have my opinion on them.
  3. I have got invaluable experience in product development. Before this project I thought that technical stuff is more important.
  4. I have been through professional and personal struggles on my way to the goal. Right now I know what I'm capable of.
  5. I have earned $10 on advertising which I will spend on beer for me and my friends :).
Why did I wrote such article then? Can't answer for sure. One of the reasons is definitely to bring attention to me, my game, the things I do. That's for sure. But the other, and probably the most valuable part is to share my history with the people, that are bored on their job. For the people, that don't have ability to learn something new on their projects. You can always create some opportunity just for yourself. Go on and do something. You never know which horizons will you reach.


P.S. I did mentioned about the company at the beginning of this article. But this is another story :).


Комментариев нет:

Отправить комментарий