for loops take a variable and do something whenever that variable is within a certain range, they also always have a loop counter which makes me think that while loops came first
Actually, we began with jump instruction in machine code and assembly language. Then early languages like Fortran introduced looping constructs that made looping easier (see the Loops section here: http://en.wikibooks.org/wiki/Fortran/Fortran_control). The Do loop in Fortran is more like the for loop in JavaScript, so I think the while loop came later.
Actually, we began with jump instruction in machine code and assembly language. Then early languages like Fortran introduced looping constructs that made looping easier (see the Loops section here: http://en.wikibooks.org/wiki/Fortran/Fortran_control). The Do loop in Fortran is more like the for loop in JavaScript, so I think the while loop came later.
ReplyDelete