From: Robert Klemme Date: 2008-07-27T20:04:47+09:00 Subject: Re: inline comments in future release? On 25.07.2008 00:30, Mike Schwab wrote: > fair point, it can make things hard to read if you're not careful > > my main concern is that so much code goes uncommented, and the rdoc > comments being outside the body of the method contributes to an attitude > that allows this. > > so many of the quality ruby libraries are so flexible and so meta that > it would be great to have more blow-by-blow explanations sometimes! That's more a question of programmer discipline than of having inline comments available. I doubt there is much good code around that actually comments /in line/. If you have an expression that large that you need to individually comment on parts then you probably either choose bad variable names or crafted a too complex expression in the first place. Note also that you can break up expressions in a way that you can use line comments to comment parts if you wish so: robert@fussel ~ $ ruby < x = 1 + # basic offset > 10 + # another unimportant number > 123 # the final value > puts x > XXX 134 robert@fussel ~ $ A similar thing can be done with regular expressions using /x switch. Kind regards robert