News for hackers. Stuff that matters.
Re:Kobayashi’s Maid Dragon Translation Notes by Lammy on Thursday December 16, 2021 @01:13AM (#29575494)
Kobayashi is also canonically a Python programmer, so this doubly fits on HN :) https://i.imgur.com/oxjqM1A.png
Re:Kobayashi’s Maid Dragon Translation Notes by Hamuko on Thursday December 16, 2021 @01:21AM (#29575547)
Re:Kobayashi’s Maid Dragon Translation Notes by 5e92cb50239222b on Thursday December 16, 2021 @05:26AM (#29576864)
Damn kids, get off my issue tracker!

https://github.com/webpy/webpy/issues/420

Re:Kobayashi’s Maid Dragon Translation Notes by NoGravitas on Thursday December 16, 2021 @08:18AM (#29577808)
420, nice.
Re:Kobayashi’s Maid Dragon Translation Notes by onurtag on Friday December 17, 2021 @08:34AM (#29591854)
I recognize that code.
Re:Kobayashi’s Maid Dragon Translation Notes by smukherjee19 on Thursday December 16, 2021 @09:23AM (#29578378)
Nice! In case anyone is wondering what those Japanese comments say:

# Check if the IP address has changed

""" Generate a random session ID """

Seems accurate. :)

Re:Kobayashi’s Maid Dragon Translation Notes by Bendy on Thursday December 16, 2021 @03:31AM (#29576258)
I discovered the cPickle module thanks to this show.
Re:Kobayashi’s Maid Dragon Translation Notes by trinovantes on Thursday December 16, 2021 @02:11AM (#29575844)
I like how the function names are in English but comments are in Japanese

Don't most modern compilers allow utf-8 characters in symbol names?

Re:Kobayashi’s Maid Dragon Translation Notes by YouMeWeThem on Thursday December 16, 2021 @02:20AM (#29575894)
I'm a programmer in Japan. This is completely normal.

It looks ridiculous to have English syntax mixed in with Japanese variables, not great for legibility.

Re:Kobayashi’s Maid Dragon Translation Notes by makeitdouble on Thursday December 16, 2021 @05:11AM (#29576781)
UTF-8 is allowed, but it's a trap.

Nowadays it's less of an issue, but back in the days windows, mac and linux all used different default encodings. This meant that opening and saving the source file in one of the system could mess it all depending on the editor and how careful the devs are.

Also, there is the canonical writing issue, where you can write different utf-8 strings that all end up displayed the same. It's not an issue if it's just display text, it's a different story if you have a method that doesn't get called because the byte sequence was different, or more subtly hash indexes that seem to match but actually don't.

BTW there are companies that write some of the UT methods right in Japanese, as it matters less, and it's quite fun as there is less restrictions on what can be put in the identifier (full-width parenthesis, spaces, comma etc, are allowed in that context)

Re:Kobayashi’s Maid Dragon Translation Notes by Lammy on Thursday December 16, 2021 @02:23AM (#29575906)
Re:Kobayashi’s Maid Dragon Translation Notes by WGH_ on Saturday December 18, 2021 @02:31PM (#29607740)
Just for the record, in Russia, we write all identifiers in English and practically all comments in (sometimes broken) English as well. Russian comments seem heavily discouraged, but hey, it's possible there're places where there're not.
Re:Kobayashi’s Maid Dragon Translation Notes by Zababa on Thursday December 16, 2021 @05:41AM (#29576948)
In France it's common to have code in English and comments/documentation in French. Code in French is very rare.
Re:Kobayashi’s Maid Dragon Translation Notes by 5e92cb50239222b on Thursday December 16, 2021 @05:20AM (#29576834)
I am not from Japan, but do work in two languages other than English (both official here). This is pretty typical actually. English names for identifiers (sometimes badly translated or simply transliterated), local languages for comments.
Re:Kobayashi’s Maid Dragon Translation Notes by jcun4128 on Thursday December 16, 2021 @04:59AM (#29576709)
I always like pausing code stuff I see in shows to see if it's legit or random garbage. For example recently in the Netflix Cowboy Bebop they had this bootloader that appeared to be a mix of JavaScript, PHP and Python.

Also great show (KMD) last season's OP was great.

Re:Kobayashi’s Maid Dragon Translation Notes by arrakeen on Thursday December 16, 2021 @01:24AM (#29575561)
i could've sworn i saw kobayashi using a kana keyboard in one episode and thought that would be difficult to program with. does anyone here know if kana keyboards just have hiragana overlaid over the qwerty layout?
Re:Kobayashi’s Maid Dragon Translation Notes by Lammy on Thursday December 16, 2021 @01:34AM (#29575625)
QWERTY JIS layouts are common, yeah. Just hit the 英数 key! https://upload.wikimedia.org/wikipedia/commons/2/21/MacBookP...