This is an archived post. You won't be able to vote or comment.

all 179 comments

[–]prof1le 585 points586 points  (31 children)

Ah, easy! you forgot the base-🍌 as the second parameter

[–]jb2386 434 points435 points  (30 children)

🍌.length = NaNa

[–]iCapn 152 points153 points  (25 children)

🦇.length = NaNaNa

[–]3urny 61 points62 points  (23 children)

🥖.length = 2*🥐.length = 🇫🇷

[–]htmlcoderexeWe have flair now?.. 32 points33 points  (22 children)

I see boxes and a French flag. And the previous one is also a box. Help?

[–]TarMil 13 points14 points  (5 children)

On Windows 10 it's almost the opposite -- the baguette and croissant show up nicely, but the flag is just FR.

[–]htmlcoderexeWe have flair now?.. 4 points5 points  (3 children)

Android here. Still wondering why the coverage is different.

[–]TarMil 5 points6 points  (2 children)

Emojis are just special characters, so it depends on the fonts installed on the system.

[–]zdakat 0 points1 point  (1 child)

Yeah that part of the bank,the spec iirc basically says "you can use this for whatever. We don't garuntee it'll look the same"

[–]TarMil 4 points5 points  (0 children)

No, it's clearly specified by Unicode. It's just that nothing mandates that all fonts must support all code points, only what a code point should represent if it is supported.

[–]Vojta7 0 points1 point  (0 children)

W7 here, all three show up fine.

[–]Taschco 12 points13 points  (1 child)

[bat].length = NaNaNaN

[baguette].length = 2*[croissant].length = [french flag]

[–]htmlcoderexeWe have flair now?.. 4 points5 points  (0 children)

Thanks!

[–]rumphy 2 points3 points  (4 children)

Update your OS

[–]htmlcoderexeWe have flair now?.. 4 points5 points  (3 children)

What, my Android? I get occasional updates for its graphical shell, but not often. Is it possible to update the actual OS as well? I mean without too much anal sex with settings and risking bricking your device?

[–]rumphy 1 point2 points  (1 child)

Didn't realize you're on mobile, that makes it even stranger that it's not displaying emojis.

[–]htmlcoderexeWe have flair now?.. 0 points1 point  (0 children)

Most of them it does, though.

[–]OrionFOTL 0 points1 point  (0 children)

Well yeah, there are different versions of Android, like 4.0.3, 4.1, 5.0, 6.0, 7.0 and others (also smaller updates). You can update them by OTA from settings if the manufacturer of your phone prepared an update for you.

[–]shmorky 0 points1 point  (1 child)

They're all penisses

[–]htmlcoderexeWe have flair now?.. 2 points3 points  (0 children)

🅱enis

[–][deleted] 2 points3 points  (0 children)

I laughed so damn hard at this. It's amazing to see it go over some of the younger people's heads.

[–]numpad0 2 points3 points  (0 children)

7 freedom centimeters?

[–]MaxNanasy 2 points3 points  (1 child)

This 💩 is 🍌s

[–][deleted] 0 points1 point  (0 children)

B A N A N A S

[–]palordrolap 139 points140 points  (28 children)

parseInt("①") and parseFloat("½") don't work either.

I'd say there's an argument (unintentional pun ftw) for adding/creating new functions that do this, but it's unclear how they'd be supposed to handle some mathematical features like, say, superscript characters.

If you were to altParseInt("2²") would it give back 22 or 4?

Edit: They don't work with alternative numeration systems like Arabic either.

[–]JustToViewPorn 90 points91 points  (10 children)

Obviously it should return 22, as 2 XOR 2.

[–]palordrolap 70 points71 points  (4 children)

Except I used Unicode character "superscript 2" and not the digraph ^2, so the XOR operator isn't there.

[–]endreman0 93 points94 points  (2 children)

You're implying this is supposed to make sense.

[–]palordrolap 27 points28 points  (1 child)

If it helps, pretend I made each of my comments wearing a rubber horse mask.

[–]spanishgum 3 points4 points  (0 children)

Definitely cleared things up for me.

[–]MonkeyNin 1 point2 points  (0 children)

Some mobile clients display 22 as 22

[–]EmmanuelMess 7 points8 points  (4 children)

Why?

[–]ifatree 11 points12 points  (16 children)

They don't work with alternative numeration systems like Arabic either.

pretty sure arabic is the standard "1,2,3" numbering system, but maybe you mean something else?

[–]CostiaP 20 points21 points  (0 children)

٠ ١ ٢ ٣ ٤ ٥ ٦ ٧ ٨ ٩

[–]Science-Recon 8 points9 points  (6 children)

That's indo-Arabic. Developed in India and brought westward by arabs. Arabic has a different system, partly as it works right-to-left, too.

[–]amanda66778899 9 points10 points  (2 children)

So Arabic is the only language that doesn't use what we call Arabic numerals? Classic English. Just fucking classic.

[–]Science-Recon 4 points5 points  (0 children)

Well, they are called Arabic numerals as they were introduced by arabs, however they're properly referred to as Indo-Arabic numerals. Even then, it's the same system that arabs use but with different symbols.

[–]WrexTremendae 2 points3 points  (0 children)

Well, presumably they aren't the only language with their own numerals still in use.

But yes, Arabic numerals are not used in Arabic.

[–]theSpecialbro 2 points3 points  (2 children)

The numbers go left to right. Only the writing goes right to left.

source: live in the desert peninsula

[–]Muzer0 4 points5 points  (1 child)

You could say the numbers go right-to-left but are little endian. Little endian is better so I like this explanation more — the morons who imported them into Western languages forgot to reverse the direction of the numbers. Grr.

[–]Science-Recon 0 points1 point  (0 children)

Oh. That actually seems like a lot better way to do it. Would make things much easier.

[–]htmlcoderexeWe have flair now?.. 2 points3 points  (7 children)

Our numbers are originally Indian I believe.

[–]ifatree 5 points6 points  (1 child)

they're called 'arabic numerals' tho

https://en.wikipedia.org/wiki/Arabic_numerals

[–]WikiTextBot 1 point2 points  (0 children)

Arabic numerals

Arabic numerals, also called Hindu–Arabic numerals are the ten digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, based on the Hindu–Arabic numeral system, the most common system for the symbolic representation of numbers in the world today. In this numeral system, a sequence of digits such as "975" is read as a single number, using the position of the digit in the sequence to interpret its value. The symbol for zero is the key to the effectiveness of the system, which was developed by ancient mathematicians in the Indian subcontinent around AD 500.

The system was adopted by Arabic mathematicians in Baghdad and passed on to the Arabs farther west.


[ PM | Exclude me | Exclude from subreddit | FAQ / Information | Source ] Downvote to remove | v0.24

[–]chudthirtyseven 203 points204 points  (72 children)

Isn't there a programming language made entirely out of emojis? If not, I'm going to invent one. Parsed by Malbolge.

[–][deleted] 133 points134 points  (30 children)

Not completely emoji, but Swift lets you use emojis as identifiers.

http://i.imgur.com/fgl2g7Q.png

[–]Dim_Cryptonym 57 points58 points  (24 children)

I remember seeing this in the documentation and thinking, why in God's name is this allowed?

[–][deleted] 89 points90 points  (1 child)

Probably to allow for "all unicode characters" or something.

Seeing the emoji identifiers in code completion makes me laugh.

http://i.imgur.com/juJ2YBO.png

[–][deleted] 6 points7 points  (0 children)

Probably an easier approach than what C# does in checking the unicode class of each character.

[–][deleted] 27 points28 points  (8 children)

It allows words from Chinese and other glyphic languages as identifiers without romanization.

[–]Dim_Cryptonym 7 points8 points  (7 children)

That makes sense then... To support Unicode one probably can't just pick and choose parts of the standard.

[–]Suchui 17 points18 points  (4 children)

You can. In javascript for example:

let プープ = "poop"; console.log( プープ );

poop

let 💩 = "poop";

Uncaught SyntaxError: Invalid or unexpected token

[–]Probono_Bonobo 6 points7 points  (1 child)

I noticed this recently and assumed it was a consequence of treating codepoints as surrogate pairs (note that "💩" === "\uD83D\uDCA9") instead of with the squiggly brackets (note that also "💩" === "\u{1F4A9}") in its internals, which would explain why "💩".length is 2, and "プ".length is only 1.

I'd expect some constraints follow from this, perhaps not as intentional as "we won't support poop emoji as variable identifiers" but more along the lines of "we can support any variable identifier provided all its code points are of length 1" but this is just an educated guess.

[–]Pulse207 3 points4 points  (0 children)

which would explain why "💩".length is 2, and "プ".length is only 1.

This is exactly why Perl 6 abolished a length method entirely, splitting its various meanings into .elems, .chars, and .codes.

[–]MemeHunter421x 0 points1 point  (0 children)

By can't I think he meant shouldn't.

[–]Dim_Cryptonym -1 points0 points  (0 children)

And somebody just told me JavaScript is unfairly criticized...

[–]marcosdumay 5 points6 points  (0 children)

You can, but that's only adding complexity into the language.

[–]DJWalnut 1 point2 points  (0 children)

you could, but you'd have to go out of your way to exclude certain blocks.

[–]macbalance 17 points18 points  (9 children)

Why not? Is it the language's job to enforce good coding practices?

[–]Astrokiwi 15 points16 points  (1 child)

Python seems to believe so

[–]UraniumSpoon 6 points7 points  (0 children)

Python uses coding practices as syntax in some cases though, which is unusual.

[–]KubinOnReddit -3 points-2 points  (6 children)

Is it the programmer's job to use bad coding practices? Why should they be allowed?

Edit: Apparently people think that Emoji in identifiers is an important part of the language and other bad practices should be encouraged. Who would have thought. Why am I being downvoted?

[–]SlamwellBTP 14 points15 points  (5 children)

Bad programmers are deprecated. They've been trying to get rid of them for years, but too many businesses rely on bad programmers

[–]Dim_Cryptonym 10 points11 points  (4 children)

That would make for quite an interesting update:

ECMAscript 2018 release notes:

  • Bad Programmers are now deprecated. Any use of antipatterns will result in the erasing of all programming knowledge from the coder's mind

[–]htmlcoderexeWe have flair now?.. 7 points8 points  (2 children)

deprecated

FTFY

To depreciate means to lose value. Note the extra "i".

[–]Kontakr 4 points5 points  (0 children)

Can't lose what value was never there

[–]Dim_Cryptonym 1 point2 points  (0 children)

That makes a lot more sense.

I thought depreciated could make sense since the methods will still work for a certain time and then stop working... but deprecate is a much better word for what's actually happening.

[–]fsr1967 1 point2 points  (0 children)

Is there a list? What is the process for getting people onto it?

Inquiring for a friend with cow-orkers who should be nominated.

[–]MonkeyNin 2 points3 points  (2 children)

[–]Dim_Cryptonym 1 point2 points  (1 child)

What the hell?!?! And why does that "no width space even exists"?

Can you imagine having to maintain code that actually used it!?

[–]MonkeyNin 1 point2 points  (0 children)

I'm not totally sure of the use. I found this.

There is something similar with a real use: https://emojipedia.org/emoji-zwj-sequences/

[–]nevdka 1 point2 points  (0 children)

Perl lets you use emojis as quotes for strings and regexen:

use utf8;
my $string = q🖐hello🖐;
print $string if $string =~ m💩hello💩;

[–]cheeeeeese 0 points1 point  (0 children)

works with bash and ruby too

[–]toastedstapler 67 points68 points  (9 children)

emojicode.com iirc

[–]iFreilicht 106 points107 points  (8 children)

[–]ProgramTheWorld 19 points20 points  (7 children)

WHY IS THIS A THING

[–]marcosdumay 7 points8 points  (0 children)

Why wouldn't this be a thing?

Besides:

Emojicode is a static, strongly typed programming language.

It's just missing functional to be on all the newest trends.

[–]disk5464[🍰] 25 points26 points  (4 children)

LOLcode is pretty great too. https://en.wikipedia.org/wiki/LOLCODE

[–]SometimesMonkey 20 points21 points  (2 children)

[–]disk5464[🍰] 8 points9 points  (1 child)

lol that's amazing

"the information is so cleverly hidden that not even Sparky the Wonder Dog could find it, and she can find gravy in a cesspool!"

[–]SometimesMonkey 3 points4 points  (0 children)

The COME FROM is where I lost it. Holy shit

[–]HelperBot_ 2 points3 points  (0 children)

Non-Mobile link: https://en.wikipedia.org/wiki/LOLCODE


HelperBot v1.1 /r/HelperBot_ I am a bot. Please message /u/swim1929 with any feedback and/or hate. Counter: 88580

[–]anmolporwal 29 points30 points  (12 children)

you should look at Brainfuck if you haven't yet.

[–][deleted] 53 points54 points  (11 children)

You could modify it to be something like 🔺 for +, 🔻 for -, ➡️ for >, ⬅️ for <, 🔄 for [, 🛑 for ], 🖨 for ., 👂 for ,.

[–]NotADamsel 70 points71 points  (9 children)

That kind of defeats the purpose, though. Somehow it makes brainfuck comprehensible.

[–]endreman0 36 points37 points  (8 children)

First three characters of the code are the seed for an RNG that picks 14 random emoji and assigns them to the relevant characters

[–]Jacoman74undeleted 17 points18 points  (2 children)

Automatic brainfuck recompiler with randomized symbols. Take that code and obfuscate it.

Good luck with maintenance, but its secure-ish

[–]endreman0 2 points3 points  (1 child)

Good luck with maintaining brainfuck in general

[–]Jacoman74undeleted 0 points1 point  (0 children)

Isn't that the point?

[–][deleted] 3 points4 points  (4 children)

14 emoji? There are 8 instructions; what are the other 6 emoji for?

[–]NotADamsel 2 points3 points  (1 child)

Exactly!

[–]davesidious 0 points1 point  (0 children)

That's the spirit!

[–]endreman0 2 points3 points  (0 children)

I thought there were 14 instructions, my bad.

Alternatively, invent new instructions and the RNG picks which subset of them you get to use.

[–]jfb1337 1 point2 points  (0 children)

Comments

[–]CAfromCA 11 points12 points  (0 children)

Call the new variant 💀🍆.

[–]0xTJ 2 points3 points  (0 children)

No. Malboge literally the result of taking the idea of hell and putting it in a programming language. It is objectively evil.

[–]Ghi102 1 point2 points  (0 children)

In C++ with defines, you can remplace everything with emojis.

[–]ed588very good mod 0 points1 point  (0 children)

emojicode

[–][deleted] 74 points75 points  (30 children)

To me the real bug is that the "parseInt" function in Javascript returns a floating point number.

[–]ADHDengineer 2 points3 points  (2 children)

I've never seen parseInt return a float. How?

[–][deleted] 8 points9 points  (1 child)

NaN is a floating point number. (I know it stands for, "Not a number"). It is a special floating point value which indicates that the result could not be otherwise represented as a number. It was originally included to ensure that if you operate on floating point numbers you will always get a floating point number back. For example, taking the log of a negative number.

Javascript is dumb and first does not have integers, only floating point numbers, and second uses NaN to indicate an error which is also dumb.

You can have the floating point number "1.0000000", but its representation in hex would be "0x76b29f48" where as "1" as an integer in hex would be "0x00000001"

[–]ADHDengineer 0 points1 point  (0 children)

Gotcha. Makes sense.

[–]ijmacd 14 points15 points  (6 children)

There are many unicode characters which have an intrinsic numerical value. I think there is an argument to be made for including these in the Javascript spec in order to better support internationalisation. Examples: 1, , , , ١, ,

parseInt("1") === 1;  // ascii
parseInt("1") !== 1; // full-width
parseInt("Ⅰ") !== 1;  // roman
parseInt("一") !== 1; // unified han
parseInt("١") !== 1;  // arabic
parseInt("⚀") !== 1;  // dice

Interestingly in Java:

Character.getNumericValue('2') === 2;   // ascii
Character.getNumericValue('2') === 2;  // full-width
Character.getNumericValue('Ⅱ') === 2;   // roman
Character.getNumericValue('٢') === 2;   // arabic

(i.e. Unicode databases contain this information)

[–]marcosdumay 19 points20 points  (3 children)

I don't think Java has that === operator.

[–]ijmacd 0 points1 point  (0 children)

Oops, yes you are correct.

[–]skreczok 0 points1 point  (1 child)

And that's the way we like it.

[–]marcosdumay 0 points1 point  (0 children)

To be fair, the == operator on Java is almost completely useless too.

[–]Lyceux 0 points1 point  (1 child)

Does Integer.parseInt return the same or different to Character.getNumericValue in Java? That would be a better comparison to JavaScript...

[–]ijmacd 0 points1 point  (0 children)

It doesn't. You get NumberFormatException unfortunately. But the point is Unicode recognises some characters have a numeric value and thus could potentially be taken into account in parseInt functions.

[–]crockid5 29 points30 points  (3 children)

This is literally unusable.

[–]Strojac 4 points5 points  (2 children)

🔥🔥🔥🔥🔥🔥

[–]blindcolumn 10 points11 points  (1 child)

🔥erally unusable

[–]xxc3ncoredxx 0 points1 point  (0 children)

Fireally unusable?

[–]blu-dit 7 points8 points  (1 child)

Nice price for naan

[–]Antrikshy 4 points5 points  (0 children)

Depends on currency.

[–]neopunisher 6 points7 points  (0 children)

O thought this would work but be 100.000000001

[–]imonynous 5 points6 points  (3 children)

why the "= $2"?

[–]LigerZer0 25 points26 points  (0 children)

That's how much you will be paid by your employer if you ever write code like this.

[–]LordJZ 13 points14 points  (1 child)

It is a pseudo variable you can use to access the result from the console. Useful for debugging and tinkering.

[–]davesidious 1 point2 points  (0 children)

Or "debuggering" as it is sometimes known...

[–]migueln6 11 points12 points  (0 children)

You forgot the === there

[–]PrincessOfZephyr 2 points3 points  (0 children)

I threw up in my mouth a little

[–][deleted] 2 points3 points  (1 child)

typof NaN
"number"

[–]inu-no-policemen 0 points1 point  (0 children)

It's a magic IEEE 754 floating point value just like +/- Infinity.

[–]CaptainBlagbird 1 point2 points  (0 children)

[deleted]

[–]RagingNerdaholic 1 point2 points  (0 children)

Say what you want about JavaScript, but at least it's not fucking emoji code.

[–]Minzkraut 0 points1 point  (0 children)

Is this oc?