guber@lemmy.blahaj.zone to Lemmy Shitpost@lemmy.world · 5 months agoproportional reactionlemmy.blahaj.zoneimagemessage-square15linkfedilinkarrow-up11arrow-down10
arrow-up11arrow-down1imageproportional reactionlemmy.blahaj.zoneguber@lemmy.blahaj.zone to Lemmy Shitpost@lemmy.world · 5 months agomessage-square15linkfedilink
minus-squarefour@lemmy.ziplinkfedilinkEnglisharrow-up0·5 months agoWhat I like about using if and else for that is that you’re already using those keywords for branching in other parts of the code. Though my least favorite is probably Python’s: x = "foo" if y > 5 else "bar" It just seems backwards to me
minus-squarethebestaquaman@lemmy.worldlinkfedilinkarrow-up0·5 months agoWhile Python’s version does feel a bit backwards, it’s at least consistent with how list comprehensions are set up. They can also feel a bit “backwards” imo, especially when they include conditionals.
minus-squarefour@lemmy.ziplinkfedilinkEnglisharrow-up0·5 months agoList comprehension is another thing I don’t like about Python :) There’s more of those, but one thing I do like about Python is that I get paid for writing it, so I try not to complain too much
minus-squarekryptonianCodeMonkey@lemmy.worldlinkfedilinkarrow-up0·5 months agoI love list comprehension. Best part of the language, imo. To each their own.
What I like about using
ifandelsefor that is that you’re already using those keywords for branching in other parts of the code.Though my least favorite is probably Python’s:
x = "foo" if y > 5 else "bar"It just seems backwards to me
While Python’s version does feel a bit backwards, it’s at least consistent with how list comprehensions are set up. They can also feel a bit “backwards” imo, especially when they include conditionals.
List comprehension is another thing I don’t like about Python :)
There’s more of those, but one thing I do like about Python is that I get paid for writing it, so I try not to complain too much
I love list comprehension. Best part of the language, imo. To each their own.