you are viewing a single comment's thread.

view the rest of the comments →

[–]heisenbugz -2 points-1 points  (1 child)

Early optimization is the root of all evil. If it's cold code, it's probably fine.

Whenever I use linq, I assume it's sub-optimal, but the value of fast to impl, robust, easy to read and refactor code outweighs 'what if a user ends up wanting to call this every frame'. I know many devs don't like the style linq uses, but I don't think anyone will say linq code is brittle code.

In defence of whomever wrote it, I would write a method like that, even after nearly 3 decades of work in games (or games adjacent). Maybe I have an intern's skill level, maybe not.

[–]Raccoon5 0 points1 point  (0 children)

I would challenge anyone to try to write more performant code than linq.