Live data from Hacker News

Jezen/is-thirteen: Check if a number is equal to 13

github.com

11–20 of 57 posts

Re: Jezen/is-thirteen: Check if a number is equal to 13

#12

My first reaction was, "Haha. That's fun code-as-parody." Then I looked at the unit tests. [1] Now my reaction is more like, "Your commitment to this bit is both admirable and slightly disturbing." [1] https://github.com/jezen/is-thirteen/blob/master/test.js

I think that's the point the parody is making. A simple "piece" of code can have thousands of edge cases that a normal developer doesn't think about. That's the advantage of the UNIX-style "everything does one thing and does it well" philosophy that Node mirrors.

Re: Jezen/is-thirteen: Check if a number is equal to 13

#13

My first reaction was, "Haha. That's fun code-as-parody." Then I looked at the unit tests. [1] Now my reaction is more like, "Your commitment to this bit is both admirable and slightly disturbing." [1] https://github.com/jezen/is-thirteen/blob/master/test.js

> tap.equal(is("B").thirteen(), true); // B looks like 13

Re: Jezen/is-thirteen: Check if a number is equal to 13

#14
This is a great example of why it is important to use modules. If I were to try implementing this myself, I might have thought to check for the Chinese string "十三", but I doubt I would have known to check for the uppercase version of the Chinese string "拾叄".

More seriously, does anyone know what "uppercase" means in Chinese? Do they literally have two (seemingly unrelated) forms for each of their characters?

Re: Jezen/is-thirteen: Check if a number is equal to 13

#15

My first reaction was, "Haha. That's fun code-as-parody." Then I looked at the unit tests. [1] Now my reaction is more like, "Your commitment to this bit is both admirable and slightly disturbing." [1] https://github.com/jezen/is-thirteen/blob/master/test.js

I think that either [1] That IS the joke, or [2] the issues are where the good jokes lie. Maybe the real joke is in the commits?

Re: Jezen/is-thirteen: Check if a number is equal to 13

#19

This is a great example of why it is important to use modules. If I were to try implementing this myself, I might have thought to check for the Chinese string "十三", but I doubt I would have known to check for the uppercase version of the Chinese string "拾叄". More seriously, does anyone know what "uppercase" means in Chinese? Do they literally have two (seemingly unrelated) forms for each of their characters?

Only numerals have upper cases to prevent tampering. For example, you can alter 一(one) to 十(ten) pretty easily, but not 壹 to 拾.

Re: Jezen/is-thirteen: Check if a number is equal to 13

#20

This is a great example of why it is important to use modules. If I were to try implementing this myself, I might have thought to check for the Chinese string "十三", but I doubt I would have known to check for the uppercase version of the Chinese string "拾叄". More seriously, does anyone know what "uppercase" means in Chinese? Do they literally have two (seemingly unrelated) forms for each of their characters?

There is no uppercase character in Chinese.

The Chinese characters are unicode strings.

The answer would be the same about an uppercase emoji.

Post reply on HN