News for hackers. Stuff that matters.
Re:Animating URLs with JavaScript and Emojis by benguild on Wednesday April 17, 2019 @03:16AM (#19680458)
This reminds me of putting marquees in the window.status like 20 years ago
Re:Animating URLs with JavaScript and Emojis by Tade0 on Wednesday April 17, 2019 @05:18AM (#19680975)
The spirit is there definitely.

My take is that it's only a matter of time before emojis creep into every area where text is used.

Let's hope they won't ever become a mainstream part of programming languages.

Re:Animating URLs with JavaScript and Emojis by Lukas_Skywalker on Wednesday April 17, 2019 @06:27AM (#19681290)
I created a small library for Ruby/Rails that aliased a few methods with emojis. You could remove database objects by using the gun emoji, or trim a string with the scissors emoji.
Re:Animating URLs with JavaScript and Emojis by ioulian on Wednesday April 17, 2019 @09:06AM (#19682160)
This is pretty neat! Although, if I did it in my company, I would be packing my things very fast.
Re:Animating URLs with JavaScript and Emojis by Tade0 on Wednesday April 17, 2019 @01:04PM (#19684349)
I guess yours are at least, in a way, semantic.

I've seen attempts where any connection between the symbol and what the method was doing was purely coincidental.

Re:Animating URLs with JavaScript and Emojis by dguo on Wednesday April 17, 2019 @10:02AM (#19682629)
Check out Emojicode: https://www.emojicode.org/

"Emojicode is an open-source, full-blown programming language consisting of emojis."

Re:Animating URLs with JavaScript and Emojis by aasasd on Wednesday April 17, 2019 @11:24AM (#19683371)
Tell ya what, there's a Lisp dialect made with emojis.
Re:Animating URLs with JavaScript and Emojis by enriquto on Wednesday April 17, 2019 @06:54AM (#19681407)
> Let's hope they won't ever become a mainstream part of programming languages.

knowing a few people in this world, I am sure that this will certainly happen way before you can have variables named α, β, γ

Re:Animating URLs with JavaScript and Emojis by ForHackernews on Wednesday April 17, 2019 @07:58AM (#19681726)
You can already use Greek letter variable names in Python: https://stackoverflow.com/questions/17043894/what-unicode-sy...

I've used θ in code dealing with angles before.

Re:Animating URLs with JavaScript and Emojis by codedokode on Wednesday April 17, 2019 @12:59PM (#19684299)
That's a bad idea. How are other developers supposed to type this character (unless they are from Greece)?
Re:Animating URLs with JavaScript and Emojis by roblabla on Wednesday April 17, 2019 @03:15PM (#19685539)
keep it in the copy paste buffer, obviously /s.

For an even more extreme version, look at Perl6's atomic operators: https://docs.perl6.org/language/unicode_ascii#Atomic_operato... (or any other operators on this page for that matter).

IMO, it's not a "bad idea". Code is meant to be read, not written. If it renders the code more readable, then that's a win. But obviously, whether those symbols actually make the code more readable is debatable.

Re:Animating URLs with JavaScript and Emojis by enriquto on Thursday April 18, 2019 @03:08AM (#19689283)
> whether those symbols actually make the code more readable is debatable.

In general, it would be rather silly to use greek letters for variable names. Yet sometimes, they tend to make numerical code much more readable when you are copying a mathematical formula verbatim.

Compare using "πθ" versus "M_PI*theta" several times on the same formula, for example.

Re:Animating URLs with JavaScript and Emojis by enriquto on Thursday April 18, 2019 @01:22AM (#19688924)
I'm not from Greece and I can type any character I need to. It's just a matter of thinking very hard about it, and then the character "pops".
Re:Animating URLs with JavaScript and Emojis by tripzilch on Thursday April 18, 2019 @08:23AM (#19690451)
What do you mean? Remembering the compose key sequence?
Re:Animating URLs with JavaScript and Emojis by enriquto on Wednesday April 17, 2019 @08:34AM (#19681948)
yes, I want to use them in C. It is possible with clang but, unfortunately, not with gcc. I also want to be able to type them into TeX, both in math mode and in text mode, without much fuss.
Re:Animating URLs with JavaScript and Emojis by dubya on Thursday April 18, 2019 @08:45AM (#19690554)
\theta doesn't seem that bad. Typing something like \kissyface or \poop seems better than clicking around or typing a numeric code, albeit with the usual name guessing problem.

On OS X, and I assume others, you can add items to be automatically replaced, so something like "!t" could become a unicode theta if you want.

Re:Animating URLs with JavaScript and Emojis by conanite on Wednesday April 17, 2019 @11:05AM (#19683179)
HN strips out emoji... but this works in ruby (replace "<emoji>" with a smiley for example)

    def <emoji>
      puts "helloworld"
    end
<emoji>

> helloworld

Re:Animating URLs with JavaScript and Emojis by RandallBrown on Wednesday April 17, 2019 @10:25AM (#19682821)
Swift lets you use any unicode characters, so emoji are perfectly valid variable names.

I've seen some "cute" github projects that use them, but they're obviously not for real life use since emojis are tough to type.

Re:Animating URLs with JavaScript and Emojis by intuitionist on Wednesday April 17, 2019 @04:00PM (#19685942)
Purescript does the same thing (some people like using Unicode symbols for “forall” and function arrows) and it’s also led to amusing github goofs: https://github.com/i-am-tom/purescript-prelewd
Re:Animating URLs with JavaScript and Emojis by pault on Wednesday April 17, 2019 @09:04AM (#19682143)
In the book Diamond Age by Neal Stephenson the future working class are functionally illiterate so everything is communicated by emoji. Funny, but also a little bit frightening.
Re:Animating URLs with JavaScript and Emojis by tormeh on Wednesday April 17, 2019 @09:37AM (#19682403)
Eh, emoji is just pictographic script anyway.
Re:Animating URLs with JavaScript and Emojis by reaperducer on Wednesday April 17, 2019 @05:36AM (#19681072)
Let's hope they won't ever become a mainstream part of programming languages.

If you consider Amp mainstream, or a programming language, it’s already too late.

Re:Animating URLs with JavaScript and Emojis by tracker1 on Wednesday April 17, 2019 @12:56PM (#19684276)
Agreed... though, I'd imagine the mostly us-ascii centric programming model might be harder for some foreign languages. The worst, for me, as an example is when I see a special non-us character for JS examples as the assigned variable for a library.

edit: on the flip side, it's pretty cool for passphrases (where allowed)

Re:Animating URLs with JavaScript and Emojis by wongarsu on Wednesday April 17, 2019 @10:16AM (#19682742)
The most-used emojis are designed as a language of emotions, making them ill-suited for most programming projects. But that doesn't mean that there aren't emojis that would be very useful in programming. Emojis just aren't used because we lack good input methods for them (outside of smartphones)
Re:Animating URLs with JavaScript and Emojis by sfoley on Wednesday April 17, 2019 @09:49AM (#19682508)
It’s too late. My company has a database where the name is the sunglasses emoji.
Re:Animating URLs with JavaScript and Emojis by toastking on Wednesday April 17, 2019 @09:29AM (#19682330)
I remember a few years back a common hackathon project was to use lex and yacc to make emoji languages. It was always cool to see what people do with that. Maybe there will be an APL or something with emoji.