std.path.setExt
Wyatt via Digitalmars-d
digitalmars-d at puremagic.com
Wed Jun 24 14:06:11 PDT 2015
On Wednesday, 24 June 2015 at 20:19:49 UTC, Marc Schütz wrote:
> On Wednesday, 24 June 2015 at 14:01:32 UTC, Wyatt wrote:
>> I don't think I'd interpret these two names as having the same
>> functionality in the first place. I'd probably learn their
>> equivalence completely by accident and only remember it by
>> rote.
>
> Interesting. But once you know that, it's easy to tell which is
> which, no?
Is it, though? I mean I _guess_ setExtension() sounds more
eager? Familiarity removes my ability to make a first-time
judgement.
But by the time I've learned of their equivalence and that one is
lazy and the other is not, the API has already "lost" as far as
I'm concerned. Maybe this can be mitigated with really good docs
that lists paired functions together so it's at least easy to
find them.
Or here's a thought: Since we apparently want to minimise/kill
eagerness, can we detect usage of eager functions and catch/flag
them? Similar in ideal to Adam's (brilliant) wrapper thing, but
with tooling. A @lazy attribute (analogous to @nogc), or a
switch, or dfix rules, or something. I don't know.
-Wyatt
More information about the Digitalmars-d
mailing list