40 points

โ€œ๐Ÿ™‚โ€.reverse() == โ€œ๐Ÿ™ƒโ€

permalink
report
reply
10 points

Then we need reverseX and reverseY

permalink
report
parent
reply
9 points

๐Ÿ™‚.reverseX = ๐Ÿ™‚

permalink
report
parent
reply
12 points

Has someone made a library for that?

permalink
report
reply
44 points

Use a dynamically typed language and you wonโ€™t have to: just override the default reverse() method on strings like a Real Programmer!

Unintended consequences you say? Nonsense! What could possibly go wrong?

permalink
report
parent
reply
27 points

Iโ€™m tempted to publish an NPM package to do so as a joke, but I fear that itโ€™d get used seriously

permalink
report
parent
reply
7 points

Where does it end though? Itโ€™s a bit like infinite craft - but instead of combining resources youโ€™d have to find an inverse for every emoji

permalink
report
parent
reply
6 points

Lua could possibly do this

permalink
report
parent
reply
58 points

Imagine, if you will. A world where string reverse changes the character codes of the string.

What beauty, what wonder would such a world have?

Destruction and despair. Developers unsure why their programs donโ€™t respond correctly. Ships run aground on islands already overcrowded with those who were shipwrecked before. Signal antennas pointed towards the sun with itโ€™s constant noise. Spacecraft whose exhaust melt to slag populated cities as people briefly scream their final terrors of pain and suffering.

This, is a world we should not want to live in. A world you can only find, in the Twilight Zone.

permalink
report
reply
5 points

Nah, this couldโ€™ve been possible with some clever fuckery in defining those emojisโ€™ unicode content, like with flags that are not a single point but three independent ones, allowing you to do this:

"๐Ÿ‡ง๐Ÿ‡ฌ".reverse() == "๐Ÿ‡ฌ๐Ÿ‡ง"
"๐Ÿ‡ฌ๐Ÿ‡ช".reverse() == "๐Ÿ‡ช๐Ÿ‡ฌ"
permalink
report
parent
reply
2 points

THANKS. I didnโ€™t get the flag joke at first @sukhmel@programming.dev

permalink
report
parent
reply
5 points

โ€œAโ€.reverse() === โ€œAโ€

permalink
report
reply
4 points

"A".reverse() == "โˆ€"

Where is your god now?!

permalink
report
parent
reply
7 points
File "<stdin>", line 1
    "๐Ÿ‘‰".reverse() = "๐Ÿ‘ˆ"
    ^
SyntaxError: cannot assign to function call
permalink
report
reply
15 points

It is a font that changes == to one long equals sign.

permalink
report
parent
reply
4 points

Oh my bad, that idea didnโ€™t cross my mind.

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'str' object has no attribute 'reverse'
permalink
report
parent
reply

Programmer Humor

!programmer_humor@programming.dev

Create post

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics

Community stats

  • 7K

    Monthly active users

  • 730

    Posts

  • 11K

    Comments