sebb schrieb am Mo., 16. Mai 2016 um 15:14 Uhr:
> 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 th
On 17 May 2016 at 06:04, Eric Barnhill wrote:
> I have a related story. There is a class in commons-math 4.0 called
> IntegerRange. Stylistically I much prefer Iterating over such a range than
> C style loops and was ready to convert. However I found it many times
> slower, at least in not terribl
Sorry one further comment.
While I like iterators stylistically, in the design process I have
generally chosen to stick with C style loops.
This is because, often later in the design process, I decide I want access
to the index after all for some reason, and at point it is easier to call
the inde
I have a related story. There is a class in commons-math 4.0 called
IntegerRange. Stylistically I much prefer Iterating over such a range than
C style loops and was ready to convert. However I found it many times
slower, at least in not terribly rigorous home micro-benchmarking.
Any good reason wh
On 16 May 2016 at 14:13, sebb 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
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.
==
There are two main ways to iterate over an ar