this post was submitted on 12 Jun 2023
67 points (98.6% liked)

Programmer Humor

32412 readers
848 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
top 8 comments
sorted by: hot top controversial new old
[–] abclop99@beehaw.org 8 points 1 year ago
a = a ^ b
b = a ^ b
a = a ^ b
[–] pewpew@feddit.it 3 points 1 year ago (1 children)

So you are asking the user to do it

[–] branchial@feddit.de 1 points 1 year ago

What do you think captcha is other than computers manualizing tasks.

[–] bauklotz@feddit.de 1 points 1 year ago (1 children)
[–] 1stTime4MeInMCU@mander.xyz 1 points 1 year ago

That's like the canonical "swap two pointers" trick

[–] MyNameIsRichard@lemmy.ml 1 points 1 year ago

Using an organic processor

[–] pec@sh.itjust.works 1 points 1 year ago

Storing the value in the user instead of RAM!

[–] jnovinger@programming.dev 1 points 1 year ago

I raise you

@lambda _: _()
def result() -> int:
    global a; global b; a, b = b, a

hat tip to @sisyphean@programming.dev via Cursed Python