Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Weird and The Wonderful
  4. for(int i=0; i<size; i++)

for(int i=0; i<size; i++)

Scheduled Pinned Locked Moved The Weird and The Wonderful
csharpc++javaquestion
67 Posts 44 Posters 4 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A AspDotNetDev

    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.

    Thou mewling ill-breeding pignut!

    L Offline
    L Offline
    Lutoslaw
    wrote on last edited by
    #61

    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

    A 1 Reply Last reply
    0
    • L Lutoslaw

      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

      A Offline
      A Offline
      AspDotNetDev
      wrote on last edited by
      #62

      I've never had a need to go past "c".

      Thou mewling ill-breeding pignut!

      L 1 Reply Last reply
      0
      • A AspDotNetDev

        I've never had a need to go past "c".

        Thou mewling ill-breeding pignut!

        L Offline
        L Offline
        Lutoslaw
        wrote on last edited by
        #63

        You should be women, and yet your beards forbid me to interpret that you are so.[^]. Awesome.

        Greetings - Jacek

        1 Reply Last reply
        0
        • T tumbledDown2earth

          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?

          J Offline
          J Offline
          John Hunley
          wrote on last edited by
          #64

          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.

          1 Reply Last reply
          0
          • T tumbledDown2earth

            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?

            M Offline
            M Offline
            MacSpudster
            wrote on last edited by
            #65

            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!

            1 Reply Last reply
            0
            • R Rob Grainger

              Sorry, I still don't see the humour! (Sound of tumbleweed blowing)

              M Offline
              M Offline
              mc42
              wrote on last edited by
              #66

              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.

              R 1 Reply Last reply
              0
              • M mc42

                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.

                R Offline
                R Offline
                Rob Grainger
                wrote on last edited by
                #67

                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.

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups