```view.findViewById<AppCompatTextView>( ...
# announcements
n
Copy code
view.findViewById<AppCompatTextView>(
    R.id.strike_price
)?.let {
    it.text = price.toString()
}
Would you
nit
this, or request changes? 1️⃣ nit 2️⃣ request changes, unnecessary use of
let
2️⃣ 12
3️⃣ 1
s
I detest these
Copy code
method {
   singleLine
}.somethingElse {
    againSingleLine
}
I much prefer:
Copy code
view
    .findViewById<AppCompatTextView>(R.id.strike_price)
    ?.text = price.toString()
n
agreed, would would you
nit
it or request changes
n
My guess is that maybe they didn't understand that you can do
it?.text = ...
l
Depends on if the view is always present or not
i
I would request a change — specially since it’s a textview you’re getting; fat chance of putting more stuff in the
let
block later. Since it’s very cut and dry — it’s literally an unnecessary code block — it’s best not to allow the codebase to get littered by these.
👍 2
now, on the other hand, I’d look at the context in the code; the customs of the codebase make it easier to scan, and they should be respected. If there are many similar snippets all over, either open a ticket for those to be brought in line with “don’t use let”, or for everything to go to the “possibly unnecessary let” style
👍 1