|
|
|
|
|
by alpaca128
1021 days ago
|
|
> New languages are still using “&&” and “||” as if it’s 1975 Because it's consistent and people don't want to relearn minor details each time they switch. And Python has a lot of those little differences. Though the "and" and "or" keywords are among the few things I actually like. > meanwhile for the most part anyone can understand Python syntax What matters more to me is how the syntax works in the long term. I have no trouble reading and writing a lot of Rust code, but even after years with Python I still can't remember the difference between "[-1:]", "[1:]", "[:1]" etc for slicing lists/strings. Recursive list comprehensions with their lack of parentheses are unreadable to me to this day (e.g.: `[item for sublist in list_of_lists for item in sublist]`).
Python is very easy and quick to pick up, really productive for prototyping, but I don't consider its syntax to be its big advantage. |
|
> Recursive list comprehensions with their lack of parentheses are unreadable to me to this day (e.g.: `[item for sublist in list_of_lists for item in sublist]`)
1. there's no recursion here
2. it's literally just a double nested loop flattened (i.e. exactly matching the semantics) to be on the same line instead of indented and on two lines:
is the same as like why would you need parens when you know the for starts the next nested loop.