On 16 May 2016 at 14:13, sebb <seb...@gmail.com> wrote: > Looking for feedback on C-style and foreach() loops when using arrays. > [This email does not consider collections; please start another thread > if you want to discuss that.] > > TLDR; Always use foreach() with arrays unless you need access to the index.
+1 - even if C-style happened to be faster (which I think you argue it isn't), I would not think the majority of for-loops need that micro-optimization. Also note that in Java 8 (I know, I know.. we're still doing 6) you can do lots of things in parallel with Arrays (including Streams): https://docs.oracle.com/javase/8/docs/api/java/util/Arrays.html -- Stian Soiland-Reyes Apache Taverna (incubating), Apache Commons RDF (incubating) http://orcid.org/0000-0001-9842-9718 --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org