From: "sawa (Tsuyoshi Sawada)" Date: 2013-02-03T14:29:37+09:00 Subject: [ruby-dev:46907] [ruby-trunk - Feature #7639] More freedom for location of comments Issue #7639 has been updated by sawa (Tsuyoshi Sawada). I would like to add another argument for such feature. It is common that you put each step of a chain in a new line. During debugging, it frequently happens that you want to comment out particular lines within a chain. You have no problem when the period is at the end of a line. Below is an example of commenting out `method2`: [1, 2, 3]. method1. # method2{...}. method3(arg1, arg2){...}. method4{...} But if you had the periods at the beginning of a line, you cannot do this. The following will not be interpreted with the intended result. [1, 2, 3] .method1 # .method2{...} .method3(arg1, arg2){...} .method4{...} Just for the purpose of commenting out `method2`, you would have to temporarily move the period from the front of `method3` to the end of `method1` as so: [1, 2, 3] .method1. # .method2{...} method3(arg1, arg2){...} .method4{...} This pretty much discourages programmers to write with the period at the beginning of a line in the first place. It appears to me that such inflexibility with the location of comments makes the feature of allowing the period at the beginning of a line useless. ---------------------------------------- Feature #7639: More freedom for location of comments https://bugs.ruby-lang.org/issues/7639#change-35794 Author: sawa (Tsuyoshi Sawada) Status: Open Priority: Normal Assignee: matz (Yukihiro Matsumoto) Category: core Target version: Next Major When we chain methods with the period at the end of each line, we can put comments in between the lines: [1, 2, 3]. # First, we do blah blah method1. # Second, we do blah blah method2. =begin Third, the following line does this and that ... =end method3 but when we have the period at the beginning of the line, putting comments in similar positions returns an error: [1, 2, 3] # First, we do blah blah .method1 # Second, we do blah blah .method2 =begin Third, the following line does this and that ... =end .method3 # => Error It is confusing that putting comments between lines in a method chain is sometimes allowed and sometimes not. I think it would be convenient if comments are allowed in these positions even when the following line starts with a period, and I request this as a feature. Currently, it returns an error, which means that, if such syntax were allowed, there would be no conflict with the existing syntax. Furthermore, putting the period at the beginning of a line is suited for method chains because the period will visually work as bullets, and it makes more sense to have comments right before those lines. -- http://bugs.ruby-lang.org/