4 ms·
I can't answer for the parent poster, but one thing specifically irked me about Python and that was the variable scoping rules and the lack of forced declaratio
by drblast 16y ago
I can't answer for the parent poster, but one thing specifically irked me about Python and that was the variable scoping rules and the lack of forced declaration.
The result was that any misspelling of variables could result in extremely difficult to find bugs. This was a final straw that pushed me over the "I don't really care for the syntax of this language much" cliff.
Not a showstopper, but combined with a number of other small complaints, Python "rubbed me the wrong way" too. Yeah, significant whitespace alone isn't a problem. Lack of variable definition by itself isn't a big deal. Explicit "Self" as a parameter is kind of annoying but makes sense. The lame anonymous functions that don't have the full power of the language are ugly. Taken together those are enough to turn me off to the language.
BUT, Python has a few killer features like great libraries, flexible built in data structures, and an excellent foreign function interface. If I needed a scripting language for a native-code app it would be one of the top choices.
By the way, my experience with Python is a few years old, I don't know if anything's changed with the new version.
Edit to add: Other dynamic languages have various solutions to the variable declaration problem, usually involving a parser or compiler warning when you use an unbound variable. Python's syntax would have to change to make that possible, I think.
- rbanffy 16y ago> any misspelling of variables could result in extremely difficult to find bugs Weird. Unless all you do is to attribute them values, Python will complain when you try to use a name that's not in the current namespace. > The lame anonymous functions I too complained a lot about them. In the end, all I had to do was to declare the function in the closest scope and pass it to whatever would use the anon function. No big deal. > warning when you use an unbound variable Python throws an error when you try to use an unbound name. Python is not BASIC.
- MichaelSalib 16y agoThe lame anonymous functions that don't have the full power of the language are ugly. Tis true, python lambdas are lame, but in practice, their use has been mostly superceded by list (and now set and dictionary) comprehensions. Edit to add: Other dynamic languages have various solutions to the variable declaration problem, usually involving a parser or compiler warning when you use an unbound variable. Python's syntax would have to change to make that possible, I think. I don't understand. If you mistype a name, you'll get an error when you run the code.
- dagw 16y agoIf you mistype a name, you'll get an error when you run the code. Depends on the context of the typo. I've had errors along the lines of bar=False ... bat=True ... if bar: print "Hi" And wondered why "Hi" was never printed. Of course the problem is hardly unique to Python.