std.string.entabber, detabber, left/right/centerJustifier, soundexer

Vladimir Panteleev via Digitalmars-d digitalmars-d at puremagic.com
Thu Jun 25 14:01:37 PDT 2015


On Tuesday, 23 June 2015 at 22:45:10 UTC, Vladimir Panteleev 
wrote:
> http://dump.thecybershadow.net/0362443dfcca30860db907e494831b79/names.diff

So, there is some discussion about these here already:

http://forum.dlang.org/post/ubfmdrorjtasgeungfin@forum.dlang.org

There seems to be varying opinion, so I'm going to formally 
nominate them for renaming and get more opinions.

Rationale:

The merits of the verb-noun form ("xxxer") is that there exists 
precedent (`joiner` and `splitter`), and that they do a good job 
at describing what actually happens under the hood.

The downside is that they simply don't sound as good as some of 
the other options when using it in the code. To reiterate on a 
point from an earlier post, I think that this:

writeln(str.lowerCased.detabbed.transmogrified);

sounds better than this:

writeln(str.lowerCaser.detabber.transmogrifier);

IMO, when naming things, generally we should lean towards 
representing semantics rather than mechanics (i.e. how is this 
function going to be used, rather than what this function does 
under the hood), as that will result in more readable code.

Anyway, this is extreme bikeshedding and I won't mind too much 
leaving these alone.

Proposed new names: entabbed, detabbed, 
left/right/centerJustified, soundexed. (Existing similar names: 
`indexed`, `transposed`)



More information about the Digitalmars-d mailing list