Wednesday, July 28, 2010

RSpec API - The Good and the Bad

The Good:

Operator Expressions : Good use of meta-programming

The Bad:

#1. Have method has bubble words and it complicates the API. It increases the noise in the code. Make the API minimal. (Bubble word - Words that does not do anything, but is used only for readability)

#2. Leaky API : render method is leaky because it depends on the argument passed in to the outer method. Basically it has parametric coupling. Developer has to *remember* the coupling in order to use the API.