for(int i=0; i<size; i++)
-
We programmers are a self-centered bunch. It's never about the other person, it's always "I I I" this, "I I I" that. jk, jk. lol. Hmmm... I suppose the letters in preference would have to be: ijklo. An expanding counter-clockwise spiral starting with "i"! From this, we can ascertain the correct letters to use for each new level of loop nesting: ijklouhmpygntfbrdvescwaxqz. Any other order is incorrect.
-
AspDotNetDev wrote:
From this, we can ascertain the correct letters to use for each new level of loop nesting: ijklouhmpygntfbrdvescwaxqz.
How deep did you go into the spiral? I usually stop on the 'g'.
Greetings - Jacek
I've never had a need to go past "c".
-
I've never had a need to go past "c".
-
I am sure this was one of the hello-world codes for many of us ... But I wonder why the letter "i" .. I mean why on earth? With "a" the leading character why "i" ... After sometime I found out that Fortran language (which was/is historically used for scientific calculations) use "i" as a starting character for all integer type variables, and the quickest varible to write would be "i" Most authors and coders continued to use "i" even in C and then to C++ and then to C#, Java etc ... Is this an interpretation?
I personally use x (and y and z for nested loops - if you nest more than two levels, you need to redesign), I make it unsigned (unless there's a specific reason to use signed) because that more accurately models the real world, and I use the prefix form of the increment operator because it's potentially more efficient. So my canonical form of that construct would be:
for (unsigned x = 0; x < size; ++x)
And yes, some of my co-workers make fun of me. The ones who spend twice as much time debugging their code as I do debugging mine.
-
I am sure this was one of the hello-world codes for many of us ... But I wonder why the letter "i" .. I mean why on earth? With "a" the leading character why "i" ... After sometime I found out that Fortran language (which was/is historically used for scientific calculations) use "i" as a starting character for all integer type variables, and the quickest varible to write would be "i" Most authors and coders continued to use "i" even in C and then to C++ and then to C#, Java etc ... Is this an interpretation?
I use
for (int r = 0; r < size; i++)
because 1) "r" is directly next to "t" when I type "int_[spaceBar]_r", typing flow is much nicer; 2) "r" is on my left-hand vs. the right-hand, so when I type "someArray[r]" I type faster as my fingers type in sync with one another; seriously, try it for a week and you'll see it flows much better; 3) "r" means "repeat" (or "record") in my brain 4) using i reminds me of when I flunked Spanish... example: iFlunked! 5) I got sick of iThisCrap, iThatCrap, iWTF; .... - even though I actually originated using "i[SomeWord]" during my Apple dayz ... yes, iCreatedThisMess ... r u kidding me? no, i am not!
-
Sorry, I still don't see the humour! (Sound of tumbleweed blowing)
Since I, j, k, l are int by default, a variable named God would, by default, be a 'real' number - ie, floating point. You'd have to declare the variable God to be an integer in order for it to be taken that way. Yes, this is probably a good candidate for the most delayed response ever.
-
Since I, j, k, l are int by default, a variable named God would, by default, be a 'real' number - ie, floating point. You'd have to declare the variable God to be an integer in order for it to be taken that way. Yes, this is probably a good candidate for the most delayed response ever.
mc42 wrote:
Yes, this is probably a good candidate for the most delayed response ever.
It did take me a while to get the context there. Thanks for explaining. It does tickle me that an Imaginary being defaults to Real, while i is definitely not imaginary. Mathematicians would shudder. (Edited for grammar)
"If you don't fail at least 90 percent of the time, you're not aiming high enough." Alan Kay.