Re: Naming things in Phobos - std.algorithm and writefln

2009-08-07 Thread Michel Fortin
On 2009-08-05 11:11:20 -0400, Daniel Keep daniel.keep.li...@gmail.com said: Java and, to a lesser extent, .NET have this serious problem where all of the names are needlessly long and verbose. This makes writing actual code tedious and annoying. No, I do not use an IDE and I shouldn't NEED

Re: Naming things in Phobos - std.algorithm and writefln

2009-08-05 Thread Daniel Keep
Michel Fortin wrote: In std.algorithm, wouldn't it be clearer if splitter was called splitLazily or splitLazy? splitter is a noun, but as a function shouldn't it be a verb. makeSplitter or toSplitter perhaps? This is a specious argument. splitter's only purpose is to return an instance of a

Re: Naming things in Phobos - std.algorithm and writefln

2009-08-05 Thread Robert Fraser
Michel Fortin wrote: As you know, I tried to write some guidelines[1] for naming things in D. Those guidelines looks well at first glance, but then you look at Phobos and you see that half of it use some arbitrary naming rules. Take writefln for instance: following my guidelines (as they are

Re: Naming things in Phobos - std.algorithm and writefln

2009-08-05 Thread Michel Fortin
On 2009-08-05 03:29:11 -0400, Daniel Keep daniel.keep.li...@gmail.com said: Michel Fortin wrote: In std.algorithm, wouldn't it be clearer if splitter was called splitLazily or splitLazy? splitter is a noun, but as a function shouldn't it be a verb. makeSplitter or toSplitter perhaps? This is

Re: Naming things in Phobos - std.algorithm and writefln

2009-08-05 Thread Michel Fortin
On 2009-08-05 03:49:34 -0400, Robert Fraser fraseroftheni...@gmail.com said: Michel Fortin wrote: As you know, I tried to write some guidelines[1] for naming things in D. Those guidelines looks well at first glance, but then you look at Phobos and you see that half of it use some arbitrary

Re: Naming things in Phobos - std.algorithm and writefln

2009-08-05 Thread Don
Michel Fortin wrote: In std.algorithm, wouldn't it be clearer if splitter was called splitLazily or splitLazy? splitter is a noun, but as a function shouldn't it be a verb. makeSplitter or toSplitter perhaps? And what about the array function? Wouldn't it be clearer if it was toArray so we

Re: Naming things in Phobos - std.algorithm and writefln

2009-08-05 Thread Sjoerd van Leent
Michel Fortin Wrote: As you know, I tried to write some guidelines[1] for naming things in D. Those guidelines looks well at first glance, but then you look at Phobos and you see that half of it use some arbitrary naming rules. Take writefln for instance: following my guidelines (as they

Re: Naming things in Phobos - std.algorithm and writefln

2009-08-05 Thread Andrei Alexandrescu
Michel Fortin wrote: Alternatively, writefln could be an exception to the rules, but then the exception would need a better rationale than it shouldn't look like Java. I mean, if Phobos makes unjustified exceptions to its naming conventions here and there for no good other reason than it looks

Re: Naming things in Phobos - std.algorithm and writefln

2009-08-05 Thread Daniel Keep
Michel Fortin wrote: On 2009-08-05 03:29:11 -0400, Daniel Keep daniel.keep.li...@gmail.com said: makeSplitter is OK, but needlessly verbose. I think when you have a function whose only purpose is to construct something, or is strictly or conceptually pure, it's OK to use a noun for its

Re: Naming things in Phobos - std.algorithm and writefln

2009-08-05 Thread Lars T. Kyllingstad
Michel Fortin wrote: I'm tring to see how I can adapt the guidelines to accept this function (writefln) and I can't see any sensible rule I could add. Any idea? Alternatively, writefln could be an exception to the rules, but then the exception would need a better rationale than it shouldn't

Re: Naming things in Phobos - std.algorithm and writefln

2009-08-05 Thread Jeremie Pelletier
Andrei Alexandrescu Wrote: Michel Fortin wrote: Alternatively, writefln could be an exception to the rules, but then the exception would need a better rationale than it shouldn't look like Java. I mean, if Phobos makes unjustified exceptions to its naming conventions here and there

Re: Naming things in Phobos - std.algorithm and writefln

2009-08-05 Thread Andrei Alexandrescu
Jeremie Pelletier wrote: Andrei Alexandrescu Wrote: Michel Fortin wrote: Alternatively, writefln could be an exception to the rules, but then the exception would need a better rationale than it shouldn't look like Java. I mean, if Phobos makes unjustified exceptions to its naming

Re: Naming things in Phobos - std.algorithm and writefln

2009-08-05 Thread Sergey Gromov
Wed, 05 Aug 2009 17:29:11 +1000, Daniel Keep wrote: Michel Fortin wrote: In std.algorithm, wouldn't it be clearer if splitter was called splitLazily or splitLazy? splitter is a noun, but as a function shouldn't it be a verb. makeSplitter or toSplitter perhaps? This is a specious argument.

Re: Naming things in Phobos - std.algorithm and writefln

2009-08-05 Thread Andrei Alexandrescu
Sergey Gromov wrote: Wed, 05 Aug 2009 17:29:11 +1000, Daniel Keep wrote: Michel Fortin wrote: In std.algorithm, wouldn't it be clearer if splitter was called splitLazily or splitLazy? splitter is a noun, but as a function shouldn't it be a verb. makeSplitter or toSplitter perhaps? This is a

Re: Naming things in Phobos - std.algorithm and writefln

2009-08-05 Thread Bill Baxter
On Wed, Aug 5, 2009 at 2:40 PM, Andrei Alexandrescuseewebsiteforem...@erdani.org wrote: Sergey Gromov wrote: Wed, 05 Aug 2009 17:29:11 +1000, Daniel Keep wrote: Michel Fortin wrote: In std.algorithm, wouldn't it be clearer if splitter was called splitLazily or splitLazy? splitter is a

Re: Naming things in Phobos - std.algorithm and writefln

2009-08-05 Thread Michel Fortin
On 2009-08-05 18:12:16 -0400, Bill Baxter wbax...@gmail.com said: On Wed, Aug 5, 2009 at 2:40 PM, Andrei Alexandrescuseewebsiteforem...@erdani.org wrote: Sergey Gromov wrote: Wed, 05 Aug 2009 17:29:11 +1000, Daniel Keep wrote: Michel Fortin wrote: In std.algorithm, wouldn't it be clearer

Re: Naming things in Phobos - std.algorithm and writefln

2009-08-05 Thread Jarrett Billingsley
On Wed, Aug 5, 2009 at 7:00 PM, Michel Fortinmichel.for...@michelf.com wrote: Also, with implicit casts we wouldn't even need to bother about having a different names for lazy and non-lazy results, we could just do:        string[] parts = str.split(); and it would implicitly convert the

Re: Naming things in Phobos - std.algorithm and writefln

2009-08-05 Thread Steven Schveighoffer
On Wed, 05 Aug 2009 18:47:35 -0400, Michel Fortin michel.for...@michelf.com wrote: On 2009-08-05 17:40:34 -0400, Andrei Alexandrescu seewebsiteforem...@erdani.org said: Sergey Gromov wrote: Wed, 05 Aug 2009 17:29:11 +1000, Daniel Keep wrote: Michel Fortin wrote: In std.algorithm,

Re: Naming things in Phobos - std.algorithm and writefln

2009-08-05 Thread Andrei Alexandrescu
Michel Fortin wrote: On 2009-08-05 17:40:34 -0400, Andrei Alexandrescu seewebsiteforem...@erdani.org said: Sergey Gromov wrote: Wed, 05 Aug 2009 17:29:11 +1000, Daniel Keep wrote: Michel Fortin wrote: In std.algorithm, wouldn't it be clearer if splitter was called splitLazily or

Re: Naming things in Phobos - std.algorithm and writefln

2009-08-05 Thread Michel Fortin
On 2009-08-05 19:16:17 -0400, Jarrett Billingsley jarrett.billings...@gmail.com said: On Wed, Aug 5, 2009 at 7:00 PM, Michel Fortinmichel.for...@michelf.com wr ote: Also, with implicit casts we wouldn't even need to bother about having a different names for lazy and non-lazy results, we could

Re: Naming things in Phobos - std.algorithm and writefln

2009-08-05 Thread Michel Fortin
On 2009-08-05 20:08:43 -0400, Andrei Alexandrescu seewebsiteforem...@erdani.org said: But then I thought D2 was about making things better without worrying too much about backward compatibility. I find it dubious that we are ready to do a breaking language change about how properties work,

Re: Naming things in Phobos - std.algorithm and writefln

2009-08-05 Thread Benji Smith
Daniel Keep wrote: That way, if someone writes logging functions one day that takes formatted strings in the same way, he can reuse the convention: log logLine logFormat logLineFormat instead of log, logln, logf, and logfln. If you create a hash function, you can reuse the

Re: Naming things in Phobos - std.algorithm and writefln

2009-08-05 Thread Daniel Keep
Benji Smith wrote: ... The thing about one-letter abbreviations is that they mean different things in different contexts. An f might mean formatted in a writefln function, but it means file in an ifstream and floating point in the fenv module. I don't think this applies. Firstly, I was

Naming things in Phobos - std.algorithm and writefln

2009-08-04 Thread Michel Fortin
In std.algorithm, wouldn't it be clearer if splitter was called splitLazily or splitLazy? splitter is a noun, but as a function shouldn't it be a verb. makeSplitter or toSplitter perhaps? And what about the array function? Wouldn't it be clearer if it was toArray so we know we're preforming a