[ruby-core:113068] [Ruby master Feature#19567] Add Oxford Comma Support for better readability

Issue #19567 has been reported by tenderlovemaking (Aaron Patterson). ---------------------------------------- Feature #19567: Add Oxford Comma Support for better readability https://bugs.ruby-lang.org/issues/19567 * Author: tenderlovemaking (Aaron Patterson) * Status: Open * Priority: Normal ---------------------------------------- Ruby has regular commas: ```ruby [a, b, c] ``` Ruby has trailing commas: ```ruby [ a, b, c, ] ``` But I think both of these are hard to read compared to the Oxford comma. We should introduce the Oxford comma so that code is easier to read: For example: ```ruby def foo a, b, and c [a, b, and c] end p foo(1, 2, and 3) ``` As an added bonus, this feature also makes specifying musical beats quite natural, for example: ``` [1, and 2, and 3, and 4] ``` Just to make sure that everyone is pleased, you are allowed to mix the Oxford comma with trailing commas like this: ``` [ 1, and 2, and 3, and 4, ] ``` ---Files-------------------------------- 0001-Add-Oxford-Comma-support.patch (2.09 KB) -- https://bugs.ruby-lang.org/

Issue #19567 has been updated by hurricup (Alexandr Evstigneev). This looks a lot like perl. Moving towards normal-text-like programming language may be a dangerous way. Looks nice, but feels scary and unnecessary. ---------------------------------------- Feature #19567: Add Oxford Comma Support for better readability https://bugs.ruby-lang.org/issues/19567#change-102605 * Author: tenderlovemaking (Aaron Patterson) * Status: Open * Priority: Normal ---------------------------------------- Ruby has regular commas: ```ruby [a, b, c] ``` Ruby has trailing commas: ```ruby [ a, b, c, ] ``` But I think both of these are hard to read compared to the Oxford comma. We should introduce the Oxford comma so that code is easier to read: For example: ```ruby def foo a, b, and c [a, b, and c] end p foo(1, 2, and 3) ``` As an added bonus, this feature also makes specifying musical beats quite natural, for example: ``` [1, and 2, and 3, and 4] ``` Just to make sure that everyone is pleased, you are allowed to mix the Oxford comma with trailing commas like this: ``` [ 1, and 2, and 3, and 4, ] ``` ---Files-------------------------------- 0001-Add-Oxford-Comma-support.patch (2.09 KB) -- https://bugs.ruby-lang.org/

Issue #19567 has been updated by ko1 (Koichi Sasada). why not `, or` too? ---------------------------------------- Feature #19567: Add Oxford Comma Support for better readability https://bugs.ruby-lang.org/issues/19567#change-102607 * Author: tenderlovemaking (Aaron Patterson) * Status: Open * Priority: Normal ---------------------------------------- Ruby has regular commas: ```ruby [a, b, c] ``` Ruby has trailing commas: ```ruby [ a, b, c, ] ``` But I think both of these are hard to read compared to the Oxford comma. We should introduce the Oxford comma so that code is easier to read: For example: ```ruby def foo a, b, and c [a, b, and c] end p foo(1, 2, and 3) ``` As an added bonus, this feature also makes specifying musical beats quite natural, for example: ``` [1, and 2, and 3, and 4] ``` Just to make sure that everyone is pleased, you are allowed to mix the Oxford comma with trailing commas like this: ``` [ 1, and 2, and 3, and 4, ] ``` ---Files-------------------------------- 0001-Add-Oxford-Comma-support.patch (2.09 KB) -- https://bugs.ruby-lang.org/

Issue #19567 has been updated by luke-gru (Luke Gruber). What if there was a `american_english: true` magic comment that allowed this behavior? Then Ruby could support other English idioms and it would be extendible but British people could turn it off. ---------------------------------------- Feature #19567: Add Oxford Comma Support for better readability https://bugs.ruby-lang.org/issues/19567#change-102620 * Author: tenderlovemaking (Aaron Patterson) * Status: Open * Priority: Normal ---------------------------------------- Ruby has regular commas: ```ruby [a, b, c] ``` Ruby has trailing commas: ```ruby [ a, b, c, ] ``` But I think both of these are hard to read compared to the Oxford comma. We should introduce the Oxford comma so that code is easier to read: For example: ```ruby def foo a, b, and c [a, b, and c] end p foo(1, 2, and 3) ``` As an added bonus, this feature also makes specifying musical beats quite natural, for example: ``` [1, and 2, and 3, and 4] ``` Just to make sure that everyone is pleased, you are allowed to mix the Oxford comma with trailing commas like this: ``` [ 1, and 2, and 3, and 4, ] ``` ---Files-------------------------------- 0001-Add-Oxford-Comma-support.patch (2.09 KB) -- https://bugs.ruby-lang.org/
participants (4)
-
hurricup (Alexandr Evstigneev)
-
ko1 (Koichi Sasada)
-
luke-gru (Luke Gruber)
-
tenderlovemaking (Aaron Patterson)