4 ms·
I just want to say that I've been learning Python as my first language. I've found it to be fairly intuitive and a lot of fun. Of course, learning any language,
by horsehead 14y ago
I just want to say that I've been learning Python as my first language. I've found it to be fairly intuitive and a lot of fun. Of course, learning any language, especially your first, is going to be difficult, though.
One of the drawbacks I've heard is that Python subscribes to the idea of doing something 'the right way,' although i've found a few times where i did something the 'not right way' and it was still functional (although maybe a little longer or not as clean as it could have been).
Edit: I've also been involved a little bit with Ruby lately, and it seems thre are a few similarities between the two. Though that could just be that there are many similarities between any two langauges, and I'm just not familiar enough with multiple languages to realize that :P
Still, it's an excellent first language, IMO
- fusiongyro 14y agoA lack of freedom can be a good thing in a first language. Of course, Python doesn't always have a "right way" or they wouldn't be on their fourth command line argument parsing library. ;) Ruby and Python will seem more similar after knowing a lot of languages. But they are different enough too. If it's not intimidating you it's probably a good second language.
- slurgfest 14y agoWhy do I keep reading about this? I don't see how any command line argument parsing library is relevant other than argparse. Do you have some concrete complaint about argparse? I am seriously wondering what I am missing, it seems so simple to me yet this seems to be a burning perennial complaint.
- gvalkov 14y agoWhy shouldn't they be relevant? Getopt is still very useful for short scripts and optparse does everything it was meant to do, even if it's not as full of features as argparse. Maybe argparse really should be the canonical choice, but I certainly wouldn't want to see the others gone. As for a minor complaint about argparse - setting up a custom help formatter [1] is not straightforward, not in the slightest in comparison to optparse [2] (which is much simpler, implementation wise). [1] http://hg.python.org/cpython/file/default/Lib/argparse.py#l144 http://hg.python.org/cpython/file/default/Lib/argparse.py#l1... [2] http://hg.python.org/cpython/file/2.7/Lib/optparse.py#l155 http://hg.python.org/cpython/file/2.7/Lib/optparse.py#l155
- fusiongyro 14y agoForgive me, I started with 1.5.2. Back then, you used getopt. Then came optparse. Then came argparse. So I guess there have only been three, unless there's a popular non-built-in option I don't know about. Now, I haven't had to maintain anything I wrote back then (not sure I ever even did use getopt) but if I'm sure if we looked we could find someone who has upgraded their option parsing twice. I'm being a little snarky. I'm really just trying to point out to the new user that the much-vaunted "TOOWTDI" concept is at best a policy decision and is to be taken with a grain of salt rather than treated like a straight-jacket. There's always more than one way to do something. Python just doesn't endorse the kind of free-for-all on every line that Perl does.
- antidoh 14y ago"The right way" is not always enforced by the language. It's often just conventions agreed to by the dominant community. "Pythonic" is a word that you'll hear a lot, if you haven't already.