Anything is arcane and unreadable if you don’t understand the concept behind it. As it turns out, the concept behind this, $/ join: ($- split: ‘1969–07–20’) reverse, is quite simple to understand.

In Smalltalk, characters are signified by the dollar sign. How else would you signify the slash character? ‘/’ wouldn’t work because that’s a string!

In Smalltalk, the syntax boils down to sending messages to objects. The character object $- is sent the keyword message #split:. This says use the character to split the string argument into an array. Seems very straightforward.

Next, the unary message #reverse says to reverse the order of substrings in the array.

Finally, the character object $/ is sent the keyword message #join:. This says use the character to join the array of substrings to produce a new string.

When you understand the concept behind it, it is immensely readable.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store