Day 9, dancer party sprint continued

Life was fairly easy today. The instructions were very vague about what we were supposed to do, so the amount of work was up to us. Tuhin and I had a blast. We created a “dotting with friends” where mouseover attracts all the dots on the screen, single click repels them and double click makes them into a perfect circle. It was a cool game and Tuhin was really addicted to play around with it.

Other lessons learned:

– About “this”. Any function that accept a call call, the “this” binding is likely to be lost inside the call back. For example:


//this is not good

setTimeout(this.stepfunc, 5000)

//this is good

var that = this;

setTimeout(function(){

that.stepfunc();

}, 5000);

– About re-use functions from the super class:


BlinkyDancer.prototype.step = function(){

Dancer.prototype.step.call(this);

}

– Marcus said we should try implementing particle simulators in the future.

– He also said that the commit message should be about the interface, not about the implementation. Basically, tells “func1() is now doing this” instead of “func1() is using x and y”.

Advertisements
Standard