Vladimir Dolzhenko
07/02/2021, 4:04 PM:4
is in 🧵 )Javier
07/02/2021, 4:10 PMJavier
07/02/2021, 4:10 PMVladimir Dolzhenko
07/02/2021, 4:13 PMephemient
07/02/2021, 4:14 PM0..-1
is different from 0 downTo -1
), 2️⃣ has confusing precedence, and 3️⃣/4️⃣ are too long (e.g. complex expression .. complex expression
). IntProgression (e.g. 0..10 step 2
) would be hard to fit in. I'm not sure how to resolve any of this.wasyl
07/02/2021, 4:37 PMchristophsturm
07/03/2021, 10:40 AMMarc Knaup
07/03/2021, 11:29 PM[ ] ( )
range notation. It’s most likely not useful to the average developer. So it’s just adding another potentially unclear notation to the existing potentially unclear notation.
It’s also very difficult to distinguish between the different bracket types unless you look really closely.
3️⃣ and 4️⃣ are quite verbose and disruptive. They work badly if there are multiple ranges. Even worse if range start and/or end are anything but a simple expression. Repeating the expression in the hint will blow up line length very quickly. 4️⃣ has the same issue as 1️⃣ regarding bad readability of the bracket types and that the average dev doesn’t know that notation.
2️⃣ works in terms of length. It’s way more subtle than the other ones. It also more clear to the average developer as it uses familiar comparison operators. I would however use <=
instead of ≤
. Developers are familiar with that operator in Kotlin. And <
and ≤
are very difficult to distinguish unless you look very closely or have amazing eye sight and display contrast.
Overall I’d say either 2️⃣ (with Kotlin operators) or none at all.ephemient
07/03/2021, 11:54 PMephemient
07/03/2021, 11:59 PM⋰
, replace downTo
with ⋱
, and modify the symbols to have solid/hollow ends as appropriate