3 ms·
I would say that Python has a feeling of inconsistency at times compared to other scripting languages. I don't mean this as a criticism. I like and use Python a
by 16s 14y ago
I would say that Python has a feeling of inconsistency at times compared to other scripting languages. I don't mean this as a criticism. I like and use Python a lot for work and personal projects. Here's an example of what I mean by inconsistent:
len(a_string)
a_string.lower()
a_string.upper()
So here, there's a global, generic function len() that returns the length of the string while in the other examples, the string has methods such as .lower() .upper() etc. Why not have a_string.length()? I understand that generic functions are more efficient and even proper in OO. It just causes the feeling of inconsistency when you use the language a lot or when you are teaching a child how to program and have to explain the difference and why some things are methods while others are not.
Also, some python idioms (such as slicing) are not intuitive for many use cases. Here's an example of the traditional way in which to reverse a string in Python by slicing:
a_string[::-1]
In Ruby, you type a_string.reverse() and that is much more intuitive to a child when compared to the slicing in Python.
Having said all of that, I love Python and use it daily and encourage others to do so as well.
I