Which of these forms is least bad? https://gist.github.com/sgrif/38f5e9dc49fed32bc300d7a374a144ba …
-
-
Replying to @sgrif
I like either the first or the last one, as they both express that the two variables are related to each other (the conditional expression and what happens inside of it will change at the same time). Not sure if that's accidental, but if it isn't I think it's a nice property.
1 reply 0 retweets 0 likes -
Replying to @as__cii
Yeah, the third one is "cleanest" by the metrics I normally use, but I find it the hardest to read/follow by a significant margin
1 reply 0 retweets 2 likes -
Replying to @sgrif
Yeah, that's why I ended up voting for "Mutable State". Either way, it seems like a choice that you can easily change in the future if e.g. there's a third variable you need to assign, or something. In that case, I go with mutable state without question.
1 reply 0 retweets 2 likes
I probably should have had a fourth option that was immutable bindings with explicit assignments for each to `None` in one of the branches.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.