Hacker News new | ask | show | jobs
by Mikeb85 1413 days ago
Fair enough but while I've used list comprehensions or similar constructs while doing stats, never seen it in game code.

Usually it's just incrementing things in a loop, rather than creating lists...

Like why wouldn't you just do:

for x in range(20):

  if x % 2 == 0

    print(x)
Or push it to a list or something. The specific type of list transformation that comprehensions make slightly easier isn't common in game code and doesn't make things more readable versus for loops.
1 comments

I was pointing out how much Python like code it is possible to write in modern C++, everything else is irrelevant.