ottobre 2011 Blog Posts

What’s New in JavaScript Programming (ECMAScript 5)

The last update (December 2009) of the JavaScript dynamic typed language (ECMAScript 5)  evolve the language one step in the direction of the good parts. The goals of this language update: Don’t break the web Improve the language for the users of the language Third party security (mashups) No new syntax And a non-goal was “protect stupid people from themselves” Here a complete list of the improvements: ECMAScript 5: What’s New in JavaScript Programming Douglas Crockford explains the improvements in this presentation: ECMAScript 5: The...

TDD & Design: quotes & ideas

TDD does not drive towards good design, it drives away from a bad design. If you know what good design is, the result is a better design  -  Nat Pryce TDD doesn't drive good design. TDD gives you immediate feedback about what is likely to be bad design  -  Kent Beck Writing tests is another way to look the code and locally understand it and reuse it, and that is the same goal of good OO design. This is the reason of the deep synergy between testability and good design  -  Michael Feathers 2 interesting questions then 1)    Why a team when writing...

JavaScrip: closure scope and other ideas

Interesting to know about the scope of variables  that: In Javascript there is no block scope, it means that a variable declared in a block (as a for body or an if body) belong to the containing function scope. In this example you see that all function created and stored in functs[] indeed refer to the same value of sWithBlockScope: http://www.pastie.org/2694945 Here all the function created and stored in functs[] are created inside a function scope from the function makeFunction  so each...

Scrum is officially Open for Modification and Extension

Jeff Sutherland and Ken Schwaber, Scrum's creators, are inviting practitioners from around the world to contribute to Scrum proposing and integrating changes and extensions to Scrum. So now there is a formal process that make available a public mechanism for providing feedback on the Scrum Guide and a model for proposing extensions to the basic framework. I see the feedback in this mechanism as a 2 way communication channel. It means that proposing a change or extension can be a learning experience and an interesting exercise. Can be an opportunity to learn how to modify Scrum without lowering potential productivity and quality...

Javascrip: objects creation and inheritance

Many many different ways for doing similar things. Let's see if I remember how ... 1) Create object with dynamically added members, and prototypal inheritance from that object: - http://pastie.org/2661313 2) Create object with function constructor, and parasitic inheritance from that object: - http://pastie.org/2661334 3) Create object with object literals, and prototypal inheritance from that object: - http://pastie.org/2661348 4) Create object with prototype, and pseudoclassical inheritance from that object: - http://pastie.org/2681962 5) Create object with Powerconstructor pattern (a.k.a. module pattern), and parasitic inheritance from that object: - http://pastie.org/2661396 Personally I find the syntax of 1), 3) and 4) unnecessarily complicated and tricky. I like the syntax of 2) and...