Open LinqLover opened 3 years ago
The arguments known to me are as follows:
^ self
at the end of methods. We introduce a separator on a last statement that is not a return to demonstrate this.Personally, I currently always omit dots for last statements, on both methods and blocks. The dot, for me, acts as a separator between visible statements.
I, however, do not have a very strong opinion here. I would leave the issue open for a bit for other people to voice their opinions and see if we can find a consensus on what should be adopted.
con/pro: blocks are difficult here. Following the logic that we introduce the separator because there is an invisible return following we do not place a dot in a block's last statement. If we follow the logic that only a return statement is not terminated by a dot, we should place a dot after a block's last statement.
My logic is a bit different here: There should be always exactly one dot, and if we consistently use a dot after each statement, this rule will always be satisfied, for instance:
initializeFoo
foo := myArray at: 1 ifAbsent: [self error].
(By the way, this also matches common interpunctuation rules for quotations from British "logical" English or also German grammar. For American English, however, things are more complicated, so their grammar might be a worse reference ... 😅)
@tom95 Here is another argument for PRO:
#acceptWithPrettyPrint
#22, you will never need to add the last dot manually again) and 2) gives a chance to make the diffs for Monticello/Squit cleaner.
It makes me cry if my methods do not always end with a dot unless the last statement is a return node ... 😢