https://kotlinlang.org logo
#announcements
Title
# announcements
l

lovis

09/18/2017, 9:20 AM
the issue here is the name
list
.
x
,
y
, or
foo
would be equally informative….
c

Czar

09/18/2017, 9:25 AM
that's an issue, but not the issue, plus this is an example, I also name my example variables like this when showing code for illustration. And it's not the issue because with
attendeeNames: List<String
it would've been the same, when both fun param and member property have the same name.
l

lovis

09/18/2017, 9:35 AM
exactly - either don’t name them the same or use
this
. if you’re at the bottom of your function and forgot that you local is called the same as your field, your function is too long. could be e.g.
newAttendees
or
replacement
or something
my point is that naming beats syntax highlighting 🙂
…and using the
field
reference in setters should be mandatory
2 Views