Timeline for When should a method of a class return the same instance after modifying itself?
Current License: CC BY-SA 3.0
7 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Sep 2, 2014 at 18:59 | vote | accept | Martin Braun | ||
| Sep 2, 2014 at 15:56 | comment | added | Reactgular | @modiX if my answer is correct, then please accept it as the answer. The other stuff you're seeking are opinions on how to use chaining, and there is no right/wrong answer for that. That really is up to you to decide. Maybe you are worrying too much about small details? | |
| Sep 2, 2014 at 7:12 | comment | added | Martin Braun | While this answer helps me a lot to understand the possibilities of chaining, I still lack on the decision when to use chaining at all. Sure, consistency is the best. However, I'm refering to the case when I modify my object in the function and return this. How can I help the users of my libraries to handle and understand this situation? (Allowing them to chain methods, even when it's not required, would this really be okay? Or should I only stick to one way, require changing at all?) | |
| Sep 2, 2014 at 7:03 | vote | accept | Martin Braun | ||
| Sep 2, 2014 at 7:14 | |||||
| Aug 19, 2014 at 15:38 | comment | added | Reactgular | @amon you misread what I said. I said it's more popular when intellisense is common for a language. I never said it was depended upon the feature. | |
| Aug 19, 2014 at 15:25 | comment | added | amon | I really don't understand why you recommend method chaining depending solely on Intellisense-like autocomplete support. Method chains or fluent interfaces are an API design pattern for any OOP language; the only thing that autocomplete does is preventing typos and type errors. | |
| Aug 19, 2014 at 14:14 | history | answered | Reactgular | CC BY-SA 3.0 |