People keep telling me I'm writing "C style iterators" in ruby, and that I'm supposed to do it this other way, without the i++ thing
===

The details here aren't important, it's just an example, all that matters is the i=0, i+=1 action

 
    def sortAndIndex
      #sorting keys
      @disco = Hash[@disco.sort]

      #basic setup for both input types
      @years = @disco.keys
      @albums = @disco.values
      sum = @years.count
    
      #setup for "albums" input
      @allalbums = []
      i = 0
      sum.times do
      thatyear = @years[i] + ", " + @albums[i]
      @allalbums << thatyear
      i += 1
    end

Now this does work, as should any other "i++" type ("C-style") iterator in ruby or most other languages. However, I keep hearing that ruby has this better way to do this, where basically I'd be passing a second parameter variable other than, here, 'a'.

What modifications would I make to do this and are there multiple "shortcuts" which ruby has involving these sorts of i++ ary[i] iterator problems?
