this post was submitted on 27 Aug 2024
4 points (100.0% liked)

Programmer Humor

32000 readers
1744 users here now

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

Rules:

founded 5 years ago
MODERATORS
 
top 10 comments
sorted by: hot top controversial new old
[โ€“] [email protected] 1 points 3 weeks ago

Be the operator overload you wish to see in the world

[โ€“] [email protected] 1 points 3 weeks ago (1 children)
[๐ŸŒฝ].pop() == ๐Ÿฟ
[โ€“] [email protected] 1 points 3 weeks ago* (last edited 3 weeks ago)
"๐Ÿšด".push() = "๐Ÿšฒ๐Ÿคธ"
[โ€“] [email protected] 1 points 3 weeks ago* (last edited 3 weeks ago)

but

"๐Ÿ™‚".reverse() == "๐Ÿ™ƒ"

[โ€“] [email protected] 0 points 3 weeks ago* (last edited 3 weeks ago) (1 children)

Also, it should turn an error into an empty but successful call. /s

[โ€“] [email protected] 0 points 3 weeks ago (1 children)

Calling reverse() on a function should return its inverse

[โ€“] [email protected] 1 points 3 weeks ago
isprime.reverse(True)
// outputs 19 billion prime numbers. Checkmate, atheists.
[โ€“] [email protected] 0 points 3 weeks ago

":-)".reverse() == ")-:"

Close enough

[โ€“] [email protected] 0 points 3 weeks ago (1 children)

Then โ€œbโ€ backwards would have to be โ€œdโ€

[โ€“] [email protected] 1 points 3 weeks ago

"E".reverse() == "โˆƒ"