Victories and defeats in computer programming

Latest Escapades

  • February 03, 2016

    Optimizing Wildfly + Angularjs Single Page Applications For Faster Load Time

    The rise in capabilities of browsers and the prevalence of mobile apps javascript engine has fundamentally altered the way we create websites. Not too long ago, we used to have most of our presentation logic reside in server side applications built on PHP or ruby or java. Today, the cloud world is moving to a place where we write JSON endpoints in server side application and most of the presentation logic is handled by the client. After Moore’s law, we now have a new internet law “Any application that can be written in JavaScript, will eventually be written in JavaScript”. A look at the repositories @ GitHub will prove that Javascript is the most popular language, and single page applications rule the roost. Today javascript is no longer content with just the view layer of the web; it transcends the boundary of Model and Controller. Nodejs, angularjs and reactjs have stolen a march over conventional jquery+server side HTML websites. When we created gozoomo, we wanted to give the best end-user experience for our customers. For gozoomo.com, our production servers were most a set of JSON endpoints and a place to serve static files. But using this stack also has a cost. We had a simple angular stack. Consequently, our servers render HTML with an empty body. After the browser loads the javascript libraries, it fetches the appropriate JSON. Similar to the problems faced by twitter, many of our users did not engage with our website as they did not want to wait for the entire javascript page to load before seeing a single character of what gozoomo is all about. Google page insights had a very sorry picture to tell us. Google pagespeed insights for mobile Google pagespeed insights for desktop

  • February 22, 2014

    Dealing with unwanted versioning in mongoosejs

    Mongodb and expressjs connected via mongoosejs is the default choice of stack for many a developers who are building applications on nodejs. I went with the mob and I have nothing to regret. Having spent a significant part of my life writing untestable jquery code, I knew I did not want to deal with it any more.I went with the new kid in the block angularjs.

  • February 18, 2014

    How I solved my first server crash @ lab.sokratik.com

    Our first beta product http://lab.sokratik.com uses two nodejs servers, one of them is a binaryjs socket which is a wrapper around amazon s3, the other powers all the html you see on your browser. This is an expressjs application sitting behind nginx and talking to browser and mongolab. The server architecture is based on mean . If you are writing a new application, I would strongly recommend building your code on top of mean. Having spent considerable time writing javascript, I zeroed in on angularjs for my frontend framework. Without going into merits of why chose this technology over other, I can say that any angularjs application talks in the language of json. My experience with server crashes also dictated that I use forever. When a server goes down even more important than finding why it went down is to bring the server up.