4 ms·
Can you seriously say it's easier to write hard to read python than writing hard to read Rust or C++ ? Python is a remarkable language because it's just so cle
by 999900000999 5y ago
Can you seriously say it's easier to write hard to read python than writing hard to read Rust or C++ ?
Python is a remarkable language because it's just so clean.
I don't get this indent issue all of you keep complaining about, just use a good IDE.
- brandmeyer 5y agoDecorator over-use can lead to some difficult-to-read Python. Doing just about anything imperative at import-time makes it hard to reason about what happens when. Even experienced Python programmers can get tripped up by the import system's order of evaluation.
- Schroedingersat 5y ago> Can you seriously say it's easier to write hard to read python than writing hard to read Rust or C++ ? Dynamic typing and passing around *kwargs make this so trivial often the documentation doesn't even help and your IDE can't help you without executing the entire program.
- int_19h 5y agoThere are certainly some things about Python that make it easier to write hard-to-read code in it compared to Rust. One example is that booleans in Python are considered integers (0 and 1) for all purposes, including arithmetic: True+True produces 2 with no warning whatsoever. Even in C++, where this is also legal, you usually also get a warning. And conversely, Python is much more flexible when it comes to interpreting other things as booleans: on top of implicitly treating null pointers and integers as false like C does, Python does the same to empty strings and even collections. Then there's the part where "and" and "or" don't just return true/false, but rather the value of one of the operands, which needs not be a boolean. Sequence comprehensions are also a mighty tool for producing unreadable code if desired, especially if you nest them and/or use the conditional operator. This is more so in Python due to the unusually ordered syntax for both. Here's a fizzbuzz code golf example that combines these techniques: [f"{(not x % 3) * 'Fizz'}{(not x % 5) * 'Buzz'}" or x for x in range(1, 20)]
- 999900000999 5y agoOkay, but you have to try to make hard to read Python . I still can't get basic Rust examples to work and I've been programming for about 8 years. I understand why rust is harder than python, as a systems language needs to accommodate for different needs. I will admit using Python in a bigger application can be hell on earth since the type system is so loose.