Pronouncing while loops in programming


I am wondering how Japanese developers read aloud a piece of computer code to
other developers. Take the following C/C++ code for example

[code]

    int i = 0;
    while (i < 10) {
        foo(i);
        i++;
    }
    
[/code]

What is the natural way to read out this code? This is my attempt

[code]

    iは0。
    i小なり10だったら
      iを引数としてfooを呼び出す
      iをインクリメントする
    繰り返し
    
[/code]

Does it sound fine? Also, there is a possibly that the 繰り返し part might be
ambiguous since it might refer to the previous line or the second line. How to
fix that part?

* * *

Bonus: How to pronounce the above piece of code using お嬢様言葉? For a bit of
context, I read this [amusing
article](https://forest.watch.impress.co.jp/docs/serial/yajiuma/1419370.html)
about using Japanese in C++ and I am thinking about creating a compiler for
that weird programming language.

[code]

    iは0ですわ。
    もしi<10でしたら
      iを差し上げましてfooを実行させて頂きますのですわ
      iをインクリメントするのですわ
    繰り返し
    
[/code]

How does that sound? How to make it sound more お嬢様らしい?




It is not common practice to "translate" such codes into Japanese, at least
not among professionals. They just read this mostly in (katakanized) English,
token by token. Typically something like this:

[code]

    イント アイ イコール ゼロ
    ワイル アイ しょうなり じゅう (かっこ)
    フー アイ
    アイ プラスプラス
    (かっことじ)
    
[/code]

Few English-speaking developers read this code like "Declare an integer
variable i and assign zero to it" or "Call f with i as an argument" while
doing a professional code review, either.

かっこ and かっことじ are used when you really need to read parentheses out loud, but
they can be usually omitted. If you really need to distinguish, しょうかっこ refers
to `(`/`)`, ちゅうかっこ refers to `{`/`}`. セミコロン (`;`) is usually omitted for the
same reason, too.

お嬢様コーディング is an extension of 日本語プログラミング言語, which is a fairly rare attempt and
is considered useless by most developers. No one wants to type iをインクリメントする
instead of `i++`, so it is nothing more than a joke. (As a joke, I love 以上ですの
at the end of a loop, though.)

Related: [Standard mathematical operations, expressed in
Japanese](https://japanese.stackexchange.com/q/56962/5010)




It is not common practice to "translate" such codes into Japanese, at least
not among professionals. They just read this mostly in (katakanized) English,
token by token. Typically something like this:

[code]

    イント アイ イコール ゼロ
    ワイル アイ しょうなり じゅう (かっこ)
    フー アイ
    アイ プラスプラス
    (かっことじ)
    
[/code]

Few English-speaking developers read this code like "Declare an integer
variable i and assign zero to it" or "Call f with i as an argument" while
doing a professional code review, either.

かっこ and かっことじ are used when you really need to read parentheses out loud, but
they can be usually omitted. If you really need to distinguish, しょうかっこ refers
to `(`/`)`, ちゅうかっこ refers to `{`/`}`. セミコロン (`;`) is usually omitted for the
same reason, too.

お嬢様コーディング is an extension of 日本語プログラミング言語, which is a fairly rare attempt and
is considered useless by most developers. No one wants to type iをインクリメントする
instead of `i++`, so it is nothing more than a joke. (As a joke, I love 以上ですの
at the end of a loop, though.)

Related: [Standard mathematical operations, expressed in
Japanese](https://japanese.stackexchange.com/q/56962/5010)

