function (╯°□°)╯︵┻━┻(){throw new ┻━┻;}
class ┻━┻ extends Exception {public function __construct() {parent::__construct("Please respect tables! ┬─┬ノ(ಠ_ಠノ)");} public function __toString(){return "┬─┬";}}
// try/catch
try { (╯°□°)╯︵┻━┻ (); } catch ( ┻━┻ $niceguy) {echo $niceguy->getMessage();}
// ok now lets see an uncaught one
(╯°□°)╯︵┻━┻
();
It doesn't work in Python: It includes the official Unicode classification, and does not accept any characters that are not classified as "letters" or "numbers". You can still use similar looking characters for confusing behavior, like "a" (U+0061 LATIN SMALL LETTER A) and "а" (U+0430 CYRILLIC SMALL LETTER A).
>>> apple = 3
>>> аpple = 4
>>> аpple
4
>>> apple
3
>>>
Why are there two different character codes for what is essentially the same human-readable symbol? For the sake of ordered completeness or was the cryllic character code set an extension and the designers were not aware of the symbol already existing?
A symbol is not the thing the symbol represents. Or form is not function. In some type styles, lower-case L looks the same as the number 1. Should they be treated the same? (Trivia: some older typewriters omitted the 1 key.)
In this case the Cyrillic lower-case a capitalizes to a different glyph than the Latin a. If there were only one a codepoint it would be impossible to properly capitalize Cyrillic text. This is a problem for Armenian (or is it Georgian?) that has a dotless i which capitalizes to I. But Unicode screwed up and gave just a single upper-case Latin I. So when lower-casing it goes to i with a dot.
It has to be backwards-compatible with character sets like this.
It's kind of convenient for the characters in your alphabet to appear in alphabetical order, not all the ones that look like Latin letters first followed by all the rest.
Lowercase "B" is "b", but lowercase "В" is "в", and lowercase "Β" is "β".
Unicode actually did try to unify 'the same human-readable symbol' between Japanese and Chinese to save space. It didn't work very well, it wasn't round-trip compatible with the text people already had, it upset people when Japanese characters appeared in Chinese fonts, and generally everyone hated it. They've backpedaled by now, but now the Japanese see Unicode as 'un-Japanese' and avoid using it.
No reason it shouldn't be - "ಠ" is U+0CA0 KANNADA LETTER TTHA. If you were in Karnataka, and wanted to write code in your native language, you would be pissed if you couldn't use your native alphabet for identifiers.
I think I tried that, but I want my AdBlock to not block anything, until I blacklist a website. Is that possible on uBlock? I didn't think so, or maybe I'm blind.
There are only three emoji there. The boxes in between them are skin-tone modifiers, a new kind of Unicode combining character which only Apple supports so far.
One emoji (Emojus?). The rest are all just squares.
Seriously, I feel like I'm in the only one that can't see these. And yes, I have installed Code2000/whatever font is supposed to support them. The only thing that did is make the squares look smaller.
get rid of that, it's a horribly designed extension that causes each page load to increase your CPU usage by like 100X and will hang each text heavy page on load for a second or 2.
I remember reading how firefox has some kind of override for when a font doesn't support a certain character, or something like that. It was even worse on my old computer, whenever people typed stuff like
t͙͓̍̔͡h̹̥̪̩͎̍̐i̒̊̒͛̃͒s̮̮̯̯͇̺͊ͨ̐̾́̚
it would show up as squares with a regular letter here and there.
While I appreciate your post, I must admit that all I see are a series of boxes (which looks more like when I try to take a multiple choice test...). Could you post a picture for those of use who can't see emoji?
Charles Schultz used to talk about how much joy he received from his ability to convey a range of emotions just by drawing a loop and a few well-placed lines, dots or swirls.
The neck and arms connect to the circle slightly off-center. I also think the circle is a bit imperfect, but even a perfect circle may work as long as you connect the neck behind the face.
The last time I looked at a Linux kernel driver it was filled with functions that were basically simple if statements. If this condition then write a value to this memory location. Easy, right?
The condition expression was 15 lines filled with ternary operators, function calls, and assignment to variables used later in the condition. Maybe even some commas too.
I imagine it was done to take advantage of some gcc optimization of registers for temporary values. But did it ever make my head hurt.
: fizz 1+ ." fizz " ;
: buzz 1+ ." buzz " ;
: fizzbuzz 1+ ." fizzbuzz " ;
: n 1+ dup . ;
: bange n n fizz n buzz fizz n n fizz buzz ;
: bang bange n fizz n n fizzbuzz ;
0 bang bang bang bang bang bang bange drop cr bye
A friend of mine once did a LaTeX document and compiled it. It didn't look how he wanted it so he asked me to look at it. 152 errors in a two page document. I still have flashbacks.
This is how I feel when I read some of my co-workers' code. None of us were hired for our programming skills, but our job involves a lot of programming...so this was the inevitable result.
This feels like the kind of person who wrote accounting code for a corporation thirty years ago and is now unfireable because no-one else can understand his work.
107
u/MOON_MOON_MOON What if we tried less power? Apr 17 '15
You can in Swift! My loop counters are penguins.
155
u/purefloat Cueball Apr 17 '15
Fun fact: "ಠ_ಠ" is a perfectly acceptable variable name in Javascript.
83
u/engineeringChaos How hard is rocket science anyway? Apr 17 '15 edited Apr 17 '15
How many crying emoji are there?
😢😂😭😪😥😰😅😓😿😹
If we count sad ones,
😩😫😞😣😔😨😩😫😖😤
Which coincidentally looks like me when I try to do my matlab homework
Edit: http://imgur.com/DbHpFGG for everyone who cannot see this
63
u/eisbaerBorealis Beret Guy Apr 17 '15
...I'm really impressed that Randall can take a circle and convey to me that the circle is facing right in the third panel. I think it's the subtle chin.
Oh, and I want to start using emojis in my code.
28
u/IAMA_dragon-AMA The raptor's on vacation. I heard you used a goto? Apr 17 '15
Somewhere in my Java code for a simple Minesweeper clone, there's a ternary operator with ternary operators on both sides of the colon.
Past me decided to comment it with "because fuck you, that's why."
46
u/xkcd_bot Apr 17 '15
Mobile Version!
Direct image link: Code Quality
Mouseover text: I honestly didn't think you could even USE emoji in variable names. Or that there were so many different crying ones.
Don't get it? explain xkcd
20
u/aMusicalLucario Apr 17 '15
A friend of mine once did a LaTeX document and compiled it. It didn't look how he wanted it so he asked me to look at it. 152 errors in a two page document. I still have flashbacks.
11
u/GoogleIsYourFrenemy Double Blackhat Apr 17 '15
You can probably use emoji in Java if you tell the compiler to expect UTF-8
I'll check it out tomorrow.
10
u/TheBananaKing Apr 17 '15
Someone needs to create a programming language using nothing but emojis and Unicode-art.
7
u/[deleted] Apr 17 '15
This is oddly condescending.
12
u/[deleted] Apr 17 '15
Relevant Abstruse Goose
5
u/katihathor Apr 17 '15
hehe emoji variable names ftw :)
4
u/Jellye Apr 17 '15
This is the first time I feel sincerily compelled to print a comic and carry it with me.
3
u/kirun Apr 17 '15
I showed some of my code to #ruby once. They said it was like I was trying to write Python in Ruby.
I've never used Python apart from a few minutes in the REPL.
2
u/jsmooth7 Apr 17 '15
This is how I feel when I read some of my co-workers' code. None of us were hired for our programming skills, but our job involves a lot of programming...so this was the inevitable result.
2
u/[deleted] Apr 17 '15
This feels like the kind of person who wrote accounting code for a corporation thirty years ago and is now unfireable because no-one else can understand his work.
2
u/[deleted] Apr 18 '15
Our style guide is to follow what everyone else did.
What everyone else did isn't consistent.
Am I screwed?
2
u/[deleted] Apr 19 '15
Sometimes ditching style guide turns out to be awesome. Here is an implementation of K in C written as K.
https://github.com/kevinlawler/kona/blob/master/src/r.c
1
u/W1ULH Beret Guy Apr 17 '15
love that last one...
0
u/[deleted] Apr 17 '15
[deleted] — view deleted comment