DEV Community

Discussion on: List Comprehension in D

Collapse
 
jessekphillips profile image
Jesse Phillips

@byrro , in response to dev.to/byrro/comment/j0om

Are you seriously going to stop at iota? I rarely utilize this in real world code, it is generally used in examples as a quick way to get a range.

Note that terminology here is different in D. Python uses 'range' as a sequence of numbers, D uses "a set of different things of the same general type."

Is 'Cartesian product' easy to read for someone who has never crossed path with this operation? No, but it does give terminology to read about what it does. Whereas

[(i,j) for j in range(2) for i in range(2)]

Don't get me wrong, you could easily provide a library function in Python, name it and do this under the hood, it is not like the library implementation is some kind of English statement about the desired outcome.

I'm not saying these are the things which make or break Python's readability, but it does contribute to it not being able to have the throne of readability.

Collapse
 
byrro profile image
Renato Byrro

You seem to love Dlang and that's totally fine.

But the way you're expressing yourself is not helping to convince others about Dlang, if that's your goal. It's not just me.

I'm a fierce defender of freedom of private initiative and expression. But we've got to think about what is our goal and how to better get there.

If I may suggest an idea, why not approach the issue like: "if you love Python XYZ feature, then you'll love Dlang even more"? That would be more appealing for people to try Dlang.