I would never do `response = response.json()`. I use it when it's effectively the same type, but with further processing which may be optional.
I would never do `response = response.json()`. I use it when it's effectively the same type, but with further processing which may be optional.
Depends on how clear it is.
I usually write code to help local debug-ability (which seems rare). For example, this allows one to trivially set a conditional breakpoint and look into the full response:
The fact that the first response is immediately overwritten proves to the reader it's not important/never used, so they can forget about it, where a temp variable would add cognitive load since it might be used later.and I think is just as clear as this:
This motivated by years of watching people through code, and me working with deeply non-software engineers, and is always very much appreciated.If you need to add an intermediary variable, name it as clearly as possible: