News for hackers. Stuff that matters.
Re:A Philosophy of Software Design by agumonkey on Wednesday October 25, 2023 @04:15PM (#38017740)
good point but it's culture dependent

i had people telling me

   d = {i:str(i) for i in range(10)}
was too hard to read, preferring

    d = {}
    for i in range(10):
        d[i] = str(i)
Re:A Philosophy of Software Design by conkeisterdoor on Wednesday October 25, 2023 @05:20PM (#38018551)
I also strongly prefer the dictionary comprehension and find it much more readable - for whatever my 2c is worth.
Re:A Philosophy of Software Design by agumonkey on Thursday October 26, 2023 @03:27AM (#38022751)
to me it's even beyond readability, it's a close oneliner scope.. less opportunity to insert some weird statement / bug in it

but anyway, to some senior engineer, the dict comprehension is a chore