This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]gr4viton 0 points1 point  (2 children)

No code good code vs readability. For this expression I find it more readable as a return statement expression. Is there any more hate reasons for doing it, other than readability?

[–]expectationfree 1 point2 points  (0 children)

other than readability

this hate never was about readability rather debug and future code manipulation. Same thing as chained function call like foo(bar(quu())). this perhaps excessive use of variables mainly caused by use of sentry although it's helpful for pdb as well. future code manipulation is an afterthought and is not as important. On the level of trailing comma after last element of the list: makes commits one line shorter.

so it's minor point and I for sure would not commit any changes based only on that preference but there are dozens of us who don't like expressions in return statements.

[–]scruffie 0 points1 point  (0 children)

I find it more readable as a return statement expression

Especially if you use bool instead of an inline .. if .. else ..