@PeterLudemann Sure, but under UFCS, x.foo() and foo(x) are equivalent, so importing a standalone function foo makes x.foo() available.
Wilfred Hughes
1 Comment
@wilfredh Disambiguation the Python way: Class.method?
It turns out that for large programs, fully qualified names help a lot with readability, even with IDEs that can do lookup. (Or partially qualified names)
"from mymodule import *" is forbidden in the Google style guide, instead do "import my module" and then "mymodule.foo()"
Uniform function call syntax (UFCS) is nifty: I can write foo(x, y, z) or http://x.foo(y, z).
Dot syntax for calls works incredibly well for IDE completion. Are there any languages that explicitly offer UFCS so the IDE experience is better?
Wilfred Hughes
Shared words: UFCS, foo, so, function
Score: 206.6
I'm writing a Path type in my programming language but not sure what methods belong on a Path.
Should I have some_path.read_string() or fs::read_string(some_path) instead?
I love .method() for IDE completion, but I don't want Path to be cluttered. I'm also trying to avoid UFCS.