4 ms·
Usually what you want is a style guide. eg https://google.github.io/styleguide/javaguide.html https://google.github.io/styleguide/javaguide.html Some times yo
by proverbialbunny 8y ago
Usually what you want is a style guide.
eg https://google.github.io/styleguide/javaguide.html https://google.github.io/styleguide/javaguide.html
Some times you have to build your own, or borrow from other kinds of sources like: https://cloud.google.com/apis/design/naming_convention https://cloud.google.com/apis/design/naming_convention
- hyperpape 8y agoYeah, 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."