On Sep 12, 2012, at 2:28 PM, Ethan Merritt wrote:
>> Why are you dis-ing python? Seems everybody loves it...
>
> I'm sure you can google for many "reasons I hate Python" lists.
>
> Mine would start
> 1) sensitive to white space == fail
> 2) dynamic typing makes it nearly impossible to verify program correctness,
> and very hard to debug problems that arise from unexpected input or
> a mismatch between caller and callee.
> 3) the language developers don't care about backward compatibility;
> it seems version 2.n+1 always breaks code written for version 2.n,
> and let's not even talk about version 3
> 4) sloooow unless you use it simply as a wrapper for C++,
> in which case why not just use C++ or C to begin with?
> 5) not thread-safe
>
> you did ask...
>
> Ethan
>
While I agree generally with your points and try to avoid python if at all possible, I'm not sure about what you mean with point 5, since it's certainly possible to write threaded python scripts.
Another point that is purely personal taste is the language philosophy that there is one official way to do something in Python, as contrasted with Perl (which is my choice) where the language philosophy is that there are many ways of doing any given task and the language is not designed to force you into a particular way of doing it.
Ed adds:
> While indeed 1/3=0 (but so it will be in C), I think it's a bit of an overstatement that python code execution is "nearly impossible to verify".
> Another goal of python is to accelerate implementation, and dynamic/duck typing supposedly helps that. The argument is simply that weak typing favours strong testing, which should be a good thing.
Actually it's a bit of a hindrance. In Perl I can call the int function on anything and get a sensible answer. In python if you call int on a string that contains a floating point number the default behavior is that it will crash:
[woz:~] bennette% cat pytest.py
example_string = "10.3"
number = int(example_string)
[woz:~] bennette% /Library/Frameworks/Python.framework/Versions/2.6/bin/python pytest.py
Traceback (most recent call last):
File "pytest.py", line 2, in <module>
number = int(example_string)
ValueError: invalid literal for int() with base 10: '10.3'
That's brain dead. IMHO of course.
Cheers,
Eric
|