Arc Forumnew | comments | leaders | submitlogin
1 point by rocketnia 5039 days ago | link | parent

"One thing that expressive languages like Ruby, Smalltalk, and Lisp teach us is that many 'design patterns' are actually language smells. The 'fluent interface' design patterns is just that: A sign that a language is missing a cascading message feature."

When a language has a (sub)community that uses so many side-effectful interfaces that cascading message syntax sounds like a relief, that community-wide design pattern might be the more appropriate thing to repair. :-p

Anyway, I use my own custom infix operator for such purposes: ;it.

  -- who needs this ---
  array
    .pop()
    .pop()
    .pop()

  -- when there's this --
  var it = array  ;it.
    pop()  ;it.
    pop()  ;it.
    pop();
Just kidding around. I haven't developed a pattern in these cases, probably because I program with few side effects and few OO interfaces and because I sooner or later bury any interface I'm working with under layers of my own.