glenkpeterson
06/14/2021, 10:38 PMif ( !parts.hasGroup ||
(parts.groupId != group.id) ) {
But Kotlin/IntelliJ Style Inspection wants me to write, which obscures the "not" and the parenthesis:
if (!parts.hasGroup ||
(parts.groupId != group.id)) {
Or maybe:
if (
!parts.hasGroup ||
(parts.groupId != group.id)
) {
Which is huge, but readable. I guess I don't think this if condition deserves so much emphasis compared to the code it contains. I'd like to be able to write the first without error, or understand why my spaces are bad here.Michael Böiers
06/15/2021, 6:06 AMisNotGroup(id)
.ribesg
06/15/2021, 9:49 AMif (!parts.hasGroup || parts.groupId != group.id) {
One goal of having a Kotlin style is that most Kotlin developers would be used to read Kotlin code with this style. I don’t see the point in altering it too much, and these additional spaces/parenthesis feel like too much.
I would also wrap that condition in a function or en extension, but that’s not the subject here