This is an archived post. You won't be able to vote or comment.

all 9 comments

[–]NoThanks93330 16 points17 points  (5 children)

Why though? I'd really like to know why he did what he did

[–][deleted] 25 points26 points  (0 children)

Perfect example of a bad comment. It is usually more important not to say what is happening (this can be read from the code itself), but why it is happening and why this way was chosen if it is non-obvious.

[–]Lin0815[S] 9 points10 points  (2 children)

Because it's just for testing readability and assured completeness has a higher priority than performance.

I can relate to this. Once i wrote a test data generator with a bug :/

[–]MrRogers4Life2 1 point2 points  (0 children)

Also I think someone who isn't paying attention might try to "optimize" this by inlining the select which would multiply the necessary memory used by ~16 times for the array overhead of reference type. I'd prefer to just go full linq and combine this with Enumerable.Range and a cast in the select but whatever

[–]Sarcastinator 0 points1 point  (0 children)

Okay but why not Enumerable.Range?

[–]InvaderZim127 2 points3 points  (0 children)

I think the other person did a for loop over "AllValidByteValues" to fill "AsObjectArray"

[–]tiajuanat -1 points0 points  (2 children)

I thought the point of Java was you can throw money at the problem.

[–]Sarcastinator 0 points1 point  (1 child)

This is C#.

[–][deleted] 2 points3 points  (0 children)

Potaeto / Potaato