Richard Gomez
12/10/2021, 4:53 AMFleshgrinder
12/10/2021, 7:05 AM1 <= score && score <= 4
Richard Gomez
12/10/2021, 7:15 AMRichard Gomez
12/10/2021, 7:15 AM1 <= score && 4 >= score
, so while <=
may be technically correct, I think >=
would be more visually intuitive. 😅
if (1 <= score) {
if (4 >= score) {
var10000 = Severity.LOW;
return var10000;
}
}
Emil Kantis
12/10/2021, 7:44 AM1 <= .. 4 >=
looks way worse imoRichard Gomez
12/10/2021, 8:04 AM1 >= .. <= 4
or even make both inlays on the left side >= 1 .. <= 4
.
The way that it currently reads (to me) is:
score is less than or equal to 1 OR score is less than or equal to 4.
Perhaps it's just me, but I think it's awkward for two reasons.
1. The current inlay implies that ".." is a placeholder for score
, but 1 <= score <= 4
isn't generally how you'd express that logic in Kotlin so it isn't as intuitive as seeing it in something like Python.
2. Thinking about the underlying logic in this way slightly defeats the abstraction of range expressions. score in 1..4
means "is score between a range starting with 1 and ending with 4", but with the inlays it reads as something like "is score in a range starting with less than or equal to 1 and less than or equal to 4".
I'm a fan of using inlays to clarify whether "between" is inclusive or exclusive. I just think it be further improved. 🙂Fleshgrinder
12/10/2021, 8:21 AMFleshgrinder
12/10/2021, 8:27 AMkqr
12/10/2021, 11:48 AMkqr
12/10/2021, 11:48 AMRichard Gomez
12/10/2021, 7:53 PMedwinRNDR
12/12/2021, 8:40 AM