The emoji problem (2022)
41–50 of 71 posts
Re: The emoji problem (2022)
#42It's year 2025, why doesn't the author use actual fruit emoji for variable names?
While current year is 2025, the year the language was made in probably isnt
Re: The emoji problem (2022)
#43It's year 2025, why doesn't the author use actual fruit emoji for variable names?
Re: The emoji problem (2022)
#44Re: The emoji problem (2022)
#45Earlier quoted context omitted.
While current year is 2025, the year the language was made in probably isnt
Good or not, many languages choose not to support emoji, even newer ones. The reasons are complicated but, many people prefer unicode normalization so that different forms of what appear to be the same word are considered the same word. People argue whether or not this is important but it can certainly be argued that it would be frustrating to get an error like let café = 1; café += 1; // error, unknown identifier '…
Re: The emoji problem (2022)
#46Earlier quoted context omitted.
When trying to understand complex C codebase I've often found it helpful to rename existing variable as emojis. This makes it much easier to track which variables are used where & to take in the pure structure of the code at one glance. An example I posted previously: https://imgur.com/F27ZNfk Unfortunately most modern languages like Rust and JS follow the XID_Start/XID_Continue recommendation (not very well-motivate…
wouldn't writing a parser of sorts that would replace emojis with a valid alphabetical string identifier be trivial?
[1] https://github.com/microsoft/TypeScript/blob/81c951894e93bdc...
Re: The emoji problem (2022)
#47Re: The emoji problem (2022)
#48Earlier quoted context omitted.
While current year is 2025, the year the language was made in probably isnt
The early pages of the Swift docs show you can use emojis as variable names, and iirc that was the very first page in the Swift 1.0 handbook. I have a theory that the language design was originally motivated by emojis, because there were also interesting choices around strings, like originally having no ".length" method.
Easter egg: The example is named dogcow, after a 90s Mac icon, designed by Susan Kare, which later became a small mascot: https://512pixels.net/dogcow/
Regarding .length: Effectly that is just the result of Unicode, there is no one-to-one equivalent between characters code points, the code units in an encoding and the resulting grapheme clusters. That is in effect a result of the complexity of the world's alphabets, including Emoji.
Re: The emoji problem (2022)
#49Dumb question, but how do you know it's smallest?
https://www.quora.com/How-do-you-find-the-positive-integer-s...
Re: The emoji problem (2022)
#50Using other constants in place of the ‘4’ can lead to some _really_ gigantic smallest solutions: https://observablehq.com/@robinhouston/a-remarkable-diophant...