This compiles in XE8 and places a soccer ball in the caption of a VCL label. No special font required.

This compiles in XE8 and places a soccer ball in the caption of a VCL label. No special font required.

var Emoji⚽️ : string; 
begin   
  Emoji⚽️:= '⚽️';   
  label1.Caption :=  Emoji⚽️; 
end; 

Just because it works, doesn't make it a good idea.

Comments

  1. My evil streak has been planning the worse code ever - all variables are Unicode characters which are visually quite similar.

    Throw in some multi-variable "with"'s, lots of "goto"'s, some unwanted bugs features, all global methods (have I missed anything?) - it should be quite easy to fix...

    ReplyDelete
  2. We should hold a UTF-8 obfuscated competition.  The source code which can best tell the purpose of the code - using mostly non-letters, and that compiles and executes, wins :)

    ReplyDelete
  3. I discovered not all Emoji compile as identifiers. Not sure the pattern.

    What if change the font to Wingdings for the whole USE?

    ReplyDelete
  4. Lars Fosdal Is that a slippery slope we want to go on...? ;-)

    ReplyDelete
  5. This could be a innovative way to comment code! :-)

    ReplyDelete
  6. If by "innovative" you mean "annoying" then yes!

    ReplyDelete
  7. U+200F in the middle of some identifier wins the competition.

    ReplyDelete
  8. Hey, as long as code completion is working, it's all good.

    ReplyDelete
  9. Does this require Windows 8 / 10 for the emoji support? I tried XE8 on Win7 (with the Win8 backported emoji hotfix applied), and got only three unprintable characters, individually selectable.

    ReplyDelete
  10. Note bugs with bugs:
    // 🐜 here. CPU usage: 📈 and crashes on mobile 📵. 🔙🔚 still seems to work.

    ReplyDelete
  11. I don't think it is a bad idea using emoji as a basis for a variable / identifier or function name . Condenses visually a lot of concepts but how to be sure you have used the same concepts in your code.

    ReplyDelete

Post a Comment