Is there more idiomatic way to write ```editText.l...
# codereview
e
Is there more idiomatic way to write
Copy code
editText.length() in 2 until maxEditLength
?
Maybe at least
Copy code
editText.length() in (2 until maxEditLength)
b
IMO it’s much easier to read with the parenthesis. Also I would consider using
editText.size
instead of
editText.length()
but I guess that is up to personal preference as long as it is consistent within the project/team.
a
so if
editText.length()
is 6 and
maxEditLength
is also 6, you want the condition to return
false
? that’s a bit confusing why not make
maxEditLength
inclusive and use
editText.length() in 2..maxEditLength
?
e
@arekolek thank you for the finding bug!
👍 2