From: Gavin Sinclair Date: 2003-07-22T21:21:55+09:00 Subject: Re: Keyword "with" On Monday, July 21, 2003, 10:29:20 PM, Michael wrote: >> It won't help readability, as the construct x+=1 is rarely, if ever, >> used in readable Ruby code. > Out of curiosity, do you have any numbers to back this up? Or is your > assertion that "+= 1" _makes_ code unreadable? Neither, and certainly not the latter. It's just that I rarely see "+= 1" in any Ruby code, readable or otherwise. There may be some programming domains where it's needed, but they're (I assert) rare. Nearly every reason for using "x++" in C-like languages is redundant in Ruby because of iterators, and rich data-processing methods in the standard library. Occasionally I count things explicitly. More often, I gather the data I need and call #size. I certainly program in limited domains, however. Obviously, from the messages in this thread, it is in reasonably common use. The files under /usr/local/lib/ruby/1.8 on my machine yield 155 uses of /[+-]= *1/, most of which, at a glance, appear stylistically justified. Gavin