4 ms·
Fluent Interface
- gnoack 8y agoArguably, in many of the listed languages, similarly easy to read code can be achieved through different means. For example, in Python, it's often simpler to just use keyword arguments, possibly with default parameter values: def my_insane_constructor(a, b, c=1, d=False): # ... # Invoke it: my_insane_constructor("foo", b=42, d=True) As the article mentions, fluent interfaces become significantly simpler to implement with method cascading (https://en.wikipedia.org/wiki/Method_cascading https://en.wikipedia.org/wiki/Method_cascading), which most common languages don't have.