Python is supposed to be an easy language to learn and develop in, but I find myself spending even more time and becoming way more frustrated in writing nontrivially-sized python applications since it’s a lot harder and time-consuming to test and debug. The lack of compile-time type safety makes it so I don’t really have a clue what each function/class does unless I constantly look back and forth at the documentation. Not only that, I run into so many small errors that would be so easy to fix if the compiler had detected them from the beginning and told me “No, you can’t do that. Here, do this instead” rather than letting me find all these errors doing runtime (and that’s if I find errors; for all I know, my program could be riddled with errors and I wouldn’t know until I try out several possibillities or write a million unit tests).

I don’t mind writing out the types of the symbols I use since I can simply use autocompletion in my code editor and type inference in such languages as Rust or Kotlin. Types are great in general because they give me certain guarantees/constraints about my program and force me think about optimization and system design ahead of time.

I suppose Python’s dynamic typing/lack of type-safety is convenient for very small applications (basically scripts) where you’re dealing with a bunch of primitives or lists, but for any larger application, static typing should be a must-have. I don’t think the 10% less code you write is worth the pains of the time-consuming debugging process or incredibly inefficient runtime/space-usage.

Basically all my complaints towards Python could also be directed towards Javascript.

  • @Restioson
    link
    25 years ago

    You can use have type hints btw.

    • @pingveno
      link
      55 years ago

      I like type hints, but they can be more trouble than they’re worth to get right when working with a lot of libraries. Take a Django project. When using class-based views, I have to track down the correct types, which are often undocumented. Some types are also impossible to express or clumsy, like JSON or its generics support.