Boost logo

Boost :

Subject: Re: [boost] [Hana] Informal review request
From: Louis Dionne (ldionne.2_at_[hidden])
Date: 2015-03-22 02:23:01

Edward Diener <eldiener <at>> writes:

> [...]
> The point of my comment was to encourage not to you names like
> 'foldl/foldr' at all in your programming endeavors. Shorthand names
> rather than descriptive names always seems to me a bad way to program.
> No doubt I am sometimes guilty of it myself but the use of short but
> cryptic mnemonics always seems to me to be bad. Ages ago when memory was
> scarce and disk space was scarce the micro-computer world may have had a
> use for these short mnemonics, as in Unix/Linux etc., but nowadays I see
> no use for it. C++ very smartly has not pursued the cryptic mnemonics of
> C as a rule and I see little reason why good C++ programmers should ever
> follow the cryptic menemonics path anymore. It only makes functionality
> harder to understand and remember.

I understand your point, and I mostly agree with it. Even though I do not
consider foldl/foldr to be cryptic, some other names following the same
pattern give me nightmares (strto{k,d,f,l,ld,ll,ul,ull}, seriously?).
So I think I understand how you can feel about fold{l,r}.

However, for the case of `foldl` and `foldr` precisely, those functions
are very well known in the functional programming community (see [1] for
example). I think this constitutes a good motivation for using those names.
This does not change the fact that fold/reverse_fold aliases will be
provided for those that want it. I'll try to add them tomorrow.



Boost list run by bdawes at, gregod at, cpdaniel at, john at