this post was submitted on 22 Nov 2023
294 points (100.0% liked)

196

16293 readers
37 users here now

Be sure to follow the rule before you head out.

Rule: You must post before you leave.

^other^ ^rules^

founded 1 year ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] frezik@midwest.social 33 points 10 months ago (3 children)

People used to argue that Python was incredibly readable. Then I started seeing shit like this.

[–] stebo02@sopuli.xyz 25 points 10 months ago (1 children)

I'd say this is pretty readable

[–] frezik@midwest.social 7 points 10 months ago (1 children)

It jams far too much on one line. Break it up. It's a mistake I see a lot on Python.

[–] stebo02@sopuli.xyz 3 points 10 months ago (1 children)

but if you do it as a for loop it would be slower

[–] frezik@midwest.social 2 points 10 months ago (1 children)

Unless you're looping over more than a million elements, that's a poor excuse.

[–] stebo02@sopuli.xyz 3 points 10 months ago

or you're doing this a million times

[–] addie@feddit.uk 14 points 10 months ago

I think that Python has a bit of a 'Microsoft Word' thing on the go. You know how your own docs are completely editable and print fine, but everyone else's are a complete fucking disaster and pressing a single key will screw up the formatting of the whole document? Your own Python code is full of sensible idioms and pragmatic naming conventions, but everyone else's was plainly written while on mushrooms.

[–] lunarul@lemmy.world 11 points 10 months ago

I don't know python, but it's clear what that line does