Catches for traditional programmers when learning Python
After a lifetime of programming and compsci education, I’ve had some issues learning with Python. It screws me up in small ways. It’s a wonderful language, but dear god I wish these things were different.
- Missing the
++
operator. - Missing
foo.push
. I’ve spent my whole life being trained to usepush()
on lists, and now it’s just not there. This breaks a deeply-ingrained typing habit. - Seemingly random things are not object-oriented. Like
len(foo)
instead offoo.len()
. Ortype(foo)
instead of something likefoo._type()
. - I don’t know why tuples are needed. Not having to worry (too deeply) about immutable strings is one of the glories of modern programming languages. So why does Python need to use immutable arrays? I’d guess the answer is “optimization”, but that doesn’t seem to gel with the fact that we aren’t managing immutable strings.
Ridiculously minor issues:⌗
- I have to modify two things to change
import foo
tofrom foo import bar
. I wish I could just append text onto the end, likeimport foo specifically bar
. Vi has made me lazy like that.
Read other posts