My First love
During my undergraduate studies and when I was learning about programming, I was exposed to C++, Java and C. I did not mind C so much, C++ I did not like it at the time and I loved working with Java. Yes yes, I know it’s very verbose and all but hey you know what they say “love is blind”. Thankfully Java was something that I used in most(75+%) of the projects in my past jobs, hence I could still be in touch with my first love. However I was involved in 2 small projects which had me use Django(Python).
p.s. I did not like C++ until I worked with it extensively during my post graduate research on computer vision.
What project caused me to part ways with my first love?
Hmm where do I begin? ahh well, let’s start from the very beginning;
My love affair with Swift continued on and about 15 months later, my first iOS app (My Day To-Do) happened i.e. I released it. Why did it take so long? well I have already written about that in a few of my previous posts (here’s another one), so I will just avoid that discussion here.
Ok what does my app do? the full description on the app store paints a clearer picture of it. In summary, the primary goal of the app is to be something that can wake you up in the morning and tell you what you need to know for your day i.e. information relevant to you for the day. At this point, it does so by reading(speaking) out what you have to do (your tasks) for the day and what the weather is like where you live. I have been updating my app ever since it’s initial release and one of the updates required that I build a RESTful backend.
Building the RESTful backend
Naturally when I came across this problem my first instinct was to build a Java based RESTful backend, and that is exactly what I did. I had a working backend ready in no time, all seemed to work according to plan. Until….I thought about deploying my RESTful backend so my app can access the API, which meant I was looking for options to host Java web apps and I am on a tight budget so I couldn’t afford some of the more expensive hosting options. There was AWS and Heroku that I knew off at the time but none of the 2 seemed to be a suitable option,
- they both had a bit of a learning curve and
- their free options are not very suitable
At this point, I thought “hmmm can I build backend with some other tech that’s easily deployable?” which lead to another thought “well I have worked with Django before and it is very easy to get going with it and it maybe deployable to shared web hosting too?” The factors that I had to consider for this new tech were,
- How hard is it to deploy it?
- How hard is it to learn?
- How long will it take me to re-write my existing Java code in it?
I mean sure PHP can be easily deployed to shared web hosting but having worked with both PHP and Django in the past, I prefer Python more than PHP and building something in Rails was not an option – no way I am investing my time on learning that. Thus I re-wrote my simple Java backend in Django in relatively short time and I found and signed up with A2Hosting from the Django friendly web hosts page and BOOM! Problemo solved!! My backend was deployed and ready for my app to use.
Moral of the story
Let aside your personal bias and stop being a total nerd when a situation demands otherwise. I am really proud of myself for letting go of my nerd bias when a situation asked for it. At the time it was important for me to solve my problem in the most feasible way possible rather than keep coding in my favourite language and let it consume more of my time and resources. I mean one can argue that what if my app gets too big and it requires the API to be more complex than what I have now. Then I may not be able to make changes to the API to make it more complex to meet demands. My answer to that? well if my app gets too big, the following solutions are probable,
1) I have enough money to hire a programmer smarter than me to look after this
2) I have earned enough money to afford AWS or something like it