Fluent programming interfaces

I've got a strong opinion on fluent APIs (yeah, nothing else, though).

Published on Monday, 19 September 2011

I've got a strong opinion on fluent APIs (yeah, nothing else, though). My opinion is that fluent APIs are for the weak-minded. I've always believed this, but today I had an epiphany: fluent APIs are for reformed VB programmers who miss the "using" statement!

That's right, they're frustrated by the lack of such a construct in more modern (and more hip) programming languages. They miss being able to write this:

with myvar
  method1
  method2
  method3
end with

Fluent APIs make up for this, allowing one to write:

myvar
  .method1()
  .method2()
  .method3();

Yay!