The 'continue' keyword in Java (and probably in many other programming languages) is used to skip further execution of the current iteration.
Why was the name 'continue' chosen? Why not something more straightforward like 'skip' ?
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or specific expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, see the FAQ for guidance.
While most likely not a very big difference and programmers would have been able to handle it just the same:
"continue" makes it clear that the loop will go on processing data (stop the details, continue the loop), while "skip" could be thought of as terminating the loop totally (like break in C++). It's one of those cases where it can be difficult to find the "perfect" name for some functionality. Ruby and Perl use "next" in similar situations which to me seems a slightly better choice.
|show 2 more comments|
I guess it might have to do with history of programming languages.
To ask why it is continue in Java is to ask why it is continue in C++, which is to ask why it is continue in C, Algol etc.
To my knowledge, Fortran was the first to have a CONTINUE statement, actually a no op. It was just there to make it possible to place a (numeric) label used in goto or other constructs like:
The first line introduces a do loop that, when completed, continued execution at label 42.
I always thought of it as just continuing processing data and therefore it was named "continue". I have never seen anyone have issues with the choice of the continue keyword not being straightforward enough.