R.Tanaka.Ichiro's Blog

主にC# な話題です

目次

Blog 利用状況

ニュース

Link

Author

Contact

History

Accessories

書庫

for文のループ変数のi

http://blogs.wankuma.com/ognac/archive/2010/02/14/186060.aspx
for文のループ変数のiは、iterationのi (?) (Ognacの雑感)

int 型の i


だと思ってました。

DISK-BASIC の頃から

FOR I=0 TO 9
  PRINT I
NEXT I
S$="AIUEO"

のように変数の型の先頭を変数名にしていたので、そういうものだと思っていました。

投稿日時 : 2010年2月15日 15:18

Feedback

# re: for文のループ変数のi 2010/02/15 16:02 はつね

BASICでそうなってるのもFORTRAN由来。

# re: for文のループ変数のi 2010/02/15 16:07 επιστημη

FORTRANではI~Nで始まる変数は暗黙的にINTEGERだったことから慣習的に。
で、「IはintegerのI」説が有力です。

# re: for文のループ変数のi 2010/02/15 16:13 trapemiya

やっぱiはスマートでなんかバランスがいいし。そういうセンスが万人受けしたんじゃないですかね。
でもなぜだろう? iじゃなきゃ気持ち悪い・・・。なぜだろうこの感覚? ある意味iはすごい。

# re: for文のループ変数のi 2010/02/15 16:14 trapemiya

forとiのようにお似合いだよ。って披露宴のスピーチで使えるかもしれない。

# re: for文のループ変数のi 2010/02/15 18:07 ground

最初はindexのiだと思ってました。

# re: for文のループ変数のi 2010/02/15 19:51 アクア

Indexのiだと思っていたのですが違うの?

# re: for文のループ変数のi 2010/02/15 22:02 gushwell

最初に習ったのがFORTRANなので、もう当たり前のように
I J K を使ってます。

# re: for文のループ変数のi 2010/02/15 22:06 ognac

一文字変数の文化もFortran発ですよね。

# re: for文のループ変数のi 2010/02/16 13:49 みきぬ

> 一文字変数の文化

昔は絶対的にメモリが少なかったので…

・大きな(複雑な)プログラムが書けないので、1文字でも十分判別できる
・長い変数名を使うとそれだけソースファイルも長くなるので、メモリが足りなくなる
・言語によっては、変数名の先頭2文字しか認識してくれない(x01 と x02 が同じと見なされる)

というわけで、長い変数名をつけるという発想がなかったんじゃないかな。

# re: for文のループ変数のi 2010/02/16 14:39 R・田中一郎

なるほど、FORTRAN が最初なんですね。
授業で組んだ経験しかありませんが、言われてみれば・・・

# YBpoOtSemfxdLeKEr 2011/11/13 12:45 http://oemfinder.com

PcWGMf Gripping! I would like to listen to the experts` views on the subject!!....

# xFryFukkDU 2011/12/17 19:10 http://www.summitmowers.com

The Author is crazy..!

# ZwcSefWAqtg 2011/12/17 19:48 http://www.coursditalien.com

Are you interested in webmaster`s income?!...

# WmVrSEGaxd 2011/12/18 21:04 http://blackflats.info/

I am getting married on the 15th of November. Congratulate me! Then will be here rarely!...

# EbBQIFuKXwNvIXwjzOJ 2011/12/22 20:20 http://www.defenselawtucson.com/

Thanks for the news! Just was thinking about it! By the way Happy New Year to all of you:DD

# tPfptaQJFKNnLSuX 2011/12/22 20:23 http://losangeles.completeaccesssolutions.com/

The author deserves for the monument:DD

# WnYqWXSduCRby 2011/12/22 20:26 http://www.drmichelegreen.com/

As I have expected, the writer blurted out..!!

# sMVnERQaYXVTJPY 2011/12/22 20:30 http://chicago.completeaccesssolutions.com/

It`s really useful! Looking through the Internet you can mostly observe watered down information, something like bla bla bla, but not here to my deep surprise. It makes me happy..!!

# HpswZXDhAWrhpS 2011/12/22 20:33 http://houston.completeaccesssolutions.com/

I decided to help and sent a post to the social bookmarks. I hope to raise it in popularity!!....

# sYtvDCvokFyezWXcUjV 2011/12/22 20:36 http://www.myencinitasmovers.com/

Post brought me to think, went to mull over!!....

# IqOVSdOjWqYfgLO 2011/12/22 20:40 http://www.myoceansidemovers.com/

Good day! I do not see the conditions of using the information. May I copy the text from here on my site if you leave a link to this page?!....

# ozutGEkNcodKqiRLBQV 2011/12/22 20:43 http://www.mychulavistamovers.com/

Unbelievable. Class..!!

# ocOWVOvXWrXuPa 2011/12/27 19:41 http://www.tat2x.com/

Yeah !... life is like riding a bicycle. You will not fall unless you stop pedaling!!...

# OYBEYKEDzpMW 2011/12/29 21:00 http://www.healthinter.org/health/page/lumigan.php

Yeah, in my opinion, it is written on every fence!!...

# eSLFXISJgRdoAch 2012/01/07 9:33 http://www.luckyvitamin.com/m-207-optimum-nutritio

Gripping! I would like to listen to the experts` views on the subject!!...

# gzOXxXzUNyI 2012/04/27 23:52 http://shopinq.com/

L7V9yK Im grateful for the blog article.Much thanks again. Keep writing.

タイトル  
名前  
Url
コメント