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

196

18073 readers
988 users here now

Be sure to follow the rule before you head out.


Rule: You must post before you leave.



Other rules

Behavior rules:

Posting rules:

NSFW: NSFW content is permitted but it must be tagged and have content warnings. Anything that doesn't adhere to this will be removed. Content warnings should be added like: [penis], [explicit description of sex]. Non-sexualized breasts of any gender are not considered inappropriate and therefore do not need to be blurred/tagged.

If you have any questions, feel free to contact us on our matrix channel or email.

Other 196's:

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] frezik@midwest.social 34 points 2 years ago (3 children)

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

[–] stebo02@sopuli.xyz 27 points 2 years ago (1 children)

I'd say this is pretty readable

[–] frezik@midwest.social 8 points 2 years 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 4 points 2 years ago (1 children)

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

[–] frezik@midwest.social 3 points 2 years ago (1 children)

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

[–] stebo02@sopuli.xyz 5 points 2 years ago

or you're doing this a million times

[–] addie@feddit.uk 16 points 2 years 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 12 points 2 years ago

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