Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


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




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: