Boost logo

Boost :

Subject: Re: [boost] lhs/rhs ([Review] Type Traits Extension ending tomorrow)
From: Max Sobolev (macsmr_at_[hidden])
Date: 2011-03-22 10:15:58


On 21.03.2011 16:10, Robert Jones wrote:
>> On Mar 21, 2011, at 4:52 AM, Max Sobolev wrote:
>>
>> I /hate/ lhs/rhs identifiers :( (despite my respect to people that use it
>> (Scott Meyers etc.) :))
>>
>
> How curious... despite all their demonstrable short comings (similarity,
> redundancy, etc), I think
> that pair of identifiers are some of the best, most instantly recognisable
> and understandable identifiers
> ever coined! Each to their own I guess.

it's fine for asm, ........but in C++ we probably should write:

Type operator + (Type const& left_hand_side,
                  Type const& right_hand_side) { . . . }

(So far I don't confide that "left hand side" is a right decryption for
/lhs/)

These argument names are too verbose and /_hand_side/ prefixes are
redundant here. We've got:

Type operator + (Type const& left, Type const& right) { . . . }

left/right are too simple :( but not horrible names. Articulation of
/lhs/ and /rhs/ is much longer then /left/ and /right/ words, because
former consists of 3 syllables (l - h - s), and later consists of 1 only.

i use left/right argument names for binary operators as free functions,
and /other/ for unary member functions (+ cctor) with an argument of
class type (This later is a boost convention).

-- 
- Do you speak English? Мужик с глубоким вздохом: - Yes I do. А хули толку?

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk