|
Boost : |
From: Kevlin Henney (kevlin_at_[hidden])
Date: 2001-08-01 10:30:10
> From: Dave <dave_at_[hidden]>
>Someone wrote,
Me :-)
>>As the base natural language of C++ and Boost is English, I personally
>>prefer to stick to the more easily communicated form, whether written
>>or spoken, where the adjective precedes the noun -- it's a const int not
>>an int const.
>
>I prefer to think of code as poetry rather than prose :-)
I don't because that would be a category error -- unless you are
thinking of bad poetry (which, given the citation below, you clearly
aren't) or the IOCCC (http://www.ioccc.org).
Leaving aside issues of structure they are worlds apart in intent.
Procedural code is unambiguous, expresses imperative intent, is
constrained by a formal grammar, has a human and machine audience, is
driven by different requirements, appeals to different aesthetics, etc.
I would hate for poetry to be so constrained, or for code not to be.
> Better than all measures
> Of delightful sound,
> Better than all treasures
> That in books are found,
> Thy skill to poet were, thou scorner of the ground!
>
> -excerpt from "To a Skylark",
> -Percy Shelly
>
>You can't appeal to English sentence structure to dictate the order
>of C++ declaration specifiers.
Not entirely, but overuse of such analogies is dangerous, which is why
I'm generally reluctant to use them... except where it impacts
unnecessarily on spoken or written English. However, it is worth noting
that "delightful sound" does at least conform to my preference for
"const int" ;-)
>In the cases where C++ allows discretionary ordering of declaration
>specifiers, can we not also allow the programmer the same discretion?
[...]
>It is not clear to
>me why we need to enforce a stricter ordering of declaration
>specifiers than what C++ allows.
I'm in agreement, which is why I am against mandating one order when
there are two clearly viable and supported alternatives. My only
suggestion for a recommendation in this area is that a given body of
code should be consistent within the choice that it makes.
Kevlin
____________________________________________________________
Kevlin Henney phone: +44 117 942 2990
mailto:kevlin_at_[hidden] mobile: +44 7801 073 508
http://www.curbralan.com fax: +44 870 052 2289
Curbralan: Consultancy + Training + Development + Review
____________________________________________________________
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk