Nicely written up. I'm still not convinced Python makes for a clear and readable language
I take posts like this and compare it to D. The last one on list comp was fun too.
Please stop posting these. They're not helpful to the people reading these articles and would serve to defeat your propose of promoting D by creating an association between D and these annoying first post on python articles.
If you really want D to succeed, simply evangelize it. Don't use it as a way to attack others.
I've chosen to reply with an article. This will make it more reusable.
The print statement is definitely not the reason why python would be considered a readable language
Not saying it was. Take a look at my list comprehension comparison. Again probably not why Python is considered readable (but still a touted powerful tool Python provides).
If you send me some readable Python, if it isn't too massive I could try and use it to make a compare.
Wasn't familiar with this Dlang until I crossed your comment.
If you think Python list comprehension is less readable we have very different personal preferences in terms of reading code...
Even basic functions. I mean, what does iota even mean? It's obvious what range means, even for someone that has never came across Python before.
Moving the discussion since my article is about comparison and this one is not.
Some of this stuff depends on features that aren't in older Python versions out of the box and you might need to do this if you're e.g. building a library that you want to support older Python versions.
from __future__ import print_function
Honestly I've almost never found any practical use for these things, format strings are much better for actually building output.
I think I've tried to use file=sys.stderr a few times.
Yeah, you’ve got a good point there. I’ll edit the post so that it says which versions of python this sort of functionality is compatible with. Thanks for the tip!
Change the post to reflect that it only works on Python 3.0 and up. Thanks again for the heads up!
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.