3 ms·
"I do understand that this might not be the case for other people, but that doesn't make the one option 'more expressive' then the other." Look, I like the com
by edanm 15y ago
"I do understand that this might not be the case for other people, but that doesn't make the one option 'more expressive' then the other."
Look, I like the comprehensions better. I also think if you polled a large group of programmers and asked them what the code does, more of them will understand the comprehension than the map. Does that mean it's more expressive? I don't know, know one here agrees on a definition for expressiveness. But that's at least one positive (IMO) of comprehensions.
Also, stacking multiple comprehensions together is much easier (cartesian multiple style). E.g.: (i,j) for i in list_1 for j in list_2.
This is much easier to write and understand with comprehensions.
* Note - I know comprehensions from Python, let me know if the cartesian multiple example doesn't work in CoffeeScript.
- catshirt 15y agowell, i prefer left to right and "map". clearly it's subjective.
- jessedhillon 15y ago> more of them will understand the comprehension than the map What? Not if you poll programmers who had to go through SICP or take a real CS curriculum.