In the previous post, I covered how to avoid common pitfalls when using Promises. In this post, we’ll look at how Promises and JavaScript’s collection manipulation functions (read map
and reduce
) can be combined together to implement a few async control flow patterns. Continue reading
JavaScript Promises – Gotchas and Anti Patterns
tl;dr
- Flatten the Promise chain whenever possible
- Straighten multiple nested promises with q.all() and q.spread()
- Don’t break the Promise chain. Make sure that the last promise is returned to the caller.
- Don’t overuse deferreds. Use them to promisify callback functions. In case a function returns a promise, it’s just better to form a chain with that same promise.
The long version
Midas : On-the-fly Schema Migration tool for MongoDB released!
Indeed I feel happy to announce that we have released Midas, an on-the-fly schema migration tool for MongoDB.
This is a moment of rejoice for my team and myself here at Equal Experts India, where I am currently heading the RnD efforts.
This is our second open-source product after Tayra – an incremental backup and restore tool for MongoDB – was released last year. Continue reading
Using Groovy AST Transformations for DSL Manipulation
To give a context on this problem, on my current project in Equal Experts, I have created a embedded DSL that uses Groovy as the host language. This DSL closely resembles MongoDB lingo.
An example would be: Continue reading
Fun with Scala Implicits
On this current project of mine, I wanted to provide operations like adding / removing a field or adding / removing multiple fields to a BSON Object (from the BSON library – org.bson.BSONObject) along with operations like toBytes on it. Instead of creating a utils class that contains all these behaviors, I resorted to Scala’s Implicits. Continue reading
Global Day of Code Retreat 2013
Last Saturday (14th December 2013) was the Global Day of Code Retreat and I really enjoyed facilitating it in Equal Experts, Pune. Continue reading
Validations with Ember.js
These days, with the rise of the single page applications, there has been a steady rise in the number of complete websites that are built on a client side JavaScript framework.
At any given point of time, these sites have always had the need for validations that they need to run client side.
Recently, while working on a pet-project using Ember.js as the client side framework and jQuery for running my client side validations, I came across a rather interesting question.
How would you handle client side validations with a framework such as Ember.js? Continue reading
Ship It Day
Last week, EE India conducted its first ever Hackathon.
Titled Ship It Day, this code-fest challenged its participants to create, test and ship fully functional software within 24 hours…
Seems challenging? Interesting?? Fun???… Well it was all that… and how!!! Continue reading
Unit testing responsive apps with Cucumber Tags
“Unit Testing”, “Responsive Apps” and “Cucumber”…. do these dots connect ?
Recently we developed a customer facing Java web-app for one of our clients. It was targeted for multiple platforms & devices and therefore, had to have a responsive UI.
After some study on device types and browser support (for JS / HTML 5/ CSS 3) we decided to serve 3 variations of our UI based on device screen size and JavaScript / CSS support. Continue reading
Object Oriented Design…. think before you leap !!!
As I learn and discover more about functional programming each day, I personally feel that have I wasted these many years (over 15+) in working with objects and object orientation… It does leave me frustrated to an extent, but hey, its never too late to pick up things.
I just feel bad that with typical web apps what we really do is take the data, convert it to object hierarchy and graphs and eventually persist them in some Relational DB using an OR mapper; only to be read back as some view or to be iterated over a collection of objects for projections or aggregated views. Just makes me feel stupid….all these years, did I do that type of work and get paid? Continue reading