Whither Tango?

Adam D. Ruppe destructionator at gmail.com
Sat Feb 20 09:39:42 PST 2010


On Sat, Feb 20, 2010 at 10:41:33AM -0600, Andrei Alexandrescu wrote:
> Some arond here seem to be very comfortable about it. Anyway, let's find 
> another one (can't be "reverse").

inReverse() is the best that comes to my mind. I see a lot of the range
functions as adjectives rather than verbs or nouns in the way they work,
something that might be useful to keep in mind when naming them.

retro() is perfect in that sense, IMO. inReverse is a close synonym.

> It's shorter and apparently there's no trouble in understanding it.

Understanding words is relatively easy; the human brain can make sense
out of a lot of gibberish.

In this case, the trouble would be when writing it. With a consistent
pattern, you always spell words the same way and use the same
capitalization, making writing it easy. Same argument order helps here too.

rel2abs is easy to read, but if you don't use it often, your first guess
would be to follow the same pattern as the rest of the lib, which is more
like relToAbs.

Not a big deal, but an annoyance.

PHP is inconsistent in every way here, and is one of the biggest problems
I have with it - not a small statement, considering PHP's wealth of problems!

I write str_replace and it works. Next line, I do str_tolower... and it doesn't
work. Now I have to look it up in the docs - is it strtolower? str2lower?
tolower? toLowerCase? Too many to guess and check.


Just a pain in the ass. D avoids it mostly, but should strive to avoid it
entirely. rel2abs is a tiny, minor example, but we don't want to let it grow
into a bigger mess down the line. Best to change it now while we easily can.

> Andrei

-- 
Adam D. Ruppe
http://arsdnet.net



More information about the Digitalmars-d mailing list