What romanization scheme is used by programmers?


I noticed that in [this book on bioinformatics with Ruby (the programming
language!)](http://rads.stackoverflow.com/amzn/click/4563078093)
(Rubyではじめるバイオインフォマティクス―生物系のためのプログラミング入門), the authors sometimes used romanized
Japanese in code examples. For example it sometimes uses `hairetsu_1` for the
variable name of an array (that'd translate as `array_1`).

When not programming in English, do Japanese programmers use a consistent
romanization scheme, and if so, which one?




I agree with Matt that there's no fixed standard about which romanization
scheme to use. My guess is that it depends on the project, author, term and
the author's swing of mood at the moment, just as in [any other context of
Japanese
romanization](http://en.wikipedia.org/wiki/Romanization_of_Japanese#Non-
standard_romanization).

`[Personal point-of-view]` If _I_ were to use a Japanese variable name, I'd
use Hepburn-style romanization, because it feels more phonetically consistent.
However, when typing hiragana/kanji text through an IME, I mostly use Nihon-
shiki to save keystrokes. `[/Personal point-of-view]`

Now be warned, my point-of-view can be biased, especially the first part,
according to my work-partner. Let me share his story here.

I first asked him why his code is entirely in English, although he's not very
fluent in it. He answered:

> That's because at the first company I worked for, about ten or more years
> ago, the predominant attitude toward Japanese naming in source code was
> "embarrassing." (はずかしい)
>
> To be precise, there were two groups of programmers in the game industry
> then: (1) Those who habitually used Japanese. (2) Those who thought it
> embarrassing. I don't know but there seemed to be a trend going against
> using Japanese among the younger programmers around that time.

Me: Were there any fixed way to romanize those Japanese variables? Like `tsu`
vs `tu`?

> Yeah, they used `tu` [Nihon-shiki] exclusively. I think that's all they
> knew, what they learned at school. [*]

Me: But what about `fuga`, as in `hoge`, `fuga`, `piyo`? (Common
[metasyntactic
variable](http://en.wikipedia.org/wiki/Metasyntactic_variable#Japanese) names
among Japanese programmers.) Shouldn't it be `huga`, if you want to be
consistent?

> Ah, these came from an entirely different class of programmers, those who'd
> been in the field for ages, near-bilingual, programming-language-lovers.
> They know English, they're very careful about spelling. We [game
> programmers] didn't know or care about these meta-vars. We'd just use `a` if
> we needed a placeholder.

So to recap, any of the following can affect the choice of romanization
scheme: perceived phonetical consistency, keystroke efficiency, local culture,
school curriculum, or convention. (Again be warned that this nice-looking
summary is the result of a survey with a sample count of only 2.)

[*] Kunrei-shiki, a variant of Nihon-shiki, in fact, is the one taught in
elementary schools. ref:
[wikipedia](http://en.wikipedia.org/wiki/Romanization_of_Japanese#Kunrei-
shiki)




I agree with Matt that there's no fixed standard about which romanization
scheme to use. My guess is that it depends on the project, author, term and
the author's swing of mood at the moment, just as in [any other context of
Japanese
romanization](http://en.wikipedia.org/wiki/Romanization_of_Japanese#Non-
standard_romanization).

`[Personal point-of-view]` If _I_ were to use a Japanese variable name, I'd
use Hepburn-style romanization, because it feels more phonetically consistent.
However, when typing hiragana/kanji text through an IME, I mostly use Nihon-
shiki to save keystrokes. `[/Personal point-of-view]`

Now be warned, my point-of-view can be biased, especially the first part,
according to my work-partner. Let me share his story here.

I first asked him why his code is entirely in English, although he's not very
fluent in it. He answered:

> That's because at the first company I worked for, about ten or more years
> ago, the predominant attitude toward Japanese naming in source code was
> "embarrassing." (はずかしい)
>
> To be precise, there were two groups of programmers in the game industry
> then: (1) Those who habitually used Japanese. (2) Those who thought it
> embarrassing. I don't know but there seemed to be a trend going against
> using Japanese among the younger programmers around that time.

Me: Were there any fixed way to romanize those Japanese variables? Like `tsu`
vs `tu`?

> Yeah, they used `tu` [Nihon-shiki] exclusively. I think that's all they
> knew, what they learned at school. [*]

Me: But what about `fuga`, as in `hoge`, `fuga`, `piyo`? (Common
[metasyntactic
variable](http://en.wikipedia.org/wiki/Metasyntactic_variable#Japanese) names
among Japanese programmers.) Shouldn't it be `huga`, if you want to be
consistent?

> Ah, these came from an entirely different class of programmers, those who'd
> been in the field for ages, near-bilingual, programming-language-lovers.
> They know English, they're very careful about spelling. We [game
> programmers] didn't know or care about these meta-vars. We'd just use `a` if
> we needed a placeholder.

So to recap, any of the following can affect the choice of romanization
scheme: perceived phonetical consistency, keystroke efficiency, local culture,
school curriculum, or convention. (Again be warned that this nice-looking
summary is the result of a survey with a sample count of only 2.)

[*] Kunrei-shiki, a variant of Nihon-shiki, in fact, is the one taught in
elementary schools. ref:
[wikipedia](http://en.wikipedia.org/wiki/Romanization_of_Japanese#Kunrei-
shiki)

