3 ms·
Yeah, guides that cover what the Google Java guide does (capitalization, where verbs go) are plentiful. The example that sent me down this rabbit hole was with
by hyperpape 8y ago
Yeah, guides that cover what the Google Java guide does (capitalization, where verbs go) are plentiful.
The example that sent me down this rabbit hole was with in Java. I believe that:
foo.withBar(bar)
mostly is, and only should be used with immutable APIs (or maybe a builder method), but I've never been able to find a source that says it. I believe this is a sort of convention, but one I haven't seen stated.
- derefr 8y agoI think that's a https://en.wikipedia.org/wiki/Fluent_interface https://en.wikipedia.org/wiki/Fluent_interface, which usually only comes up in the context of functional programmers doing OOP. It's not so much a matter of style, as that certain paradigms live only within certain communities who happen to also have/use other styles and paradigms exclusively, so you never see the paradigm used without its "friends." It might be clearest to state in anthropological terms: .withWhatever() is an "idiom of a particular colloquial dialect of the language, spoken by a subpopulation."