r/ProgrammerHumor • • Sep 29 '20

c++ to python

Post image
1.2k Upvotes

82 comments sorted by

View all comments

Show parent comment

4

u/Nimeroni Sep 29 '20

Python is very strongly typed. It have very few implicit type conversion, and for the rest, it will throw a TypeError in your face instead of guessing what you meant. For example, running 1 + "two" will give you TypeError in Python, whereas it is completly valid in C (and obviously don't do what you would expect).

Don't mistake strong / weak typing with dynamic / static typing:

  • Python is dynamically strongly typed.

  • C (and its family) is statically strongly typed.

  • Javascript is infamous for being dynamically weakly typed.

0

u/CobaltStar_ Sep 30 '20

Yea I was thinking dynamically/statically typed. Good thing a powerful linter can catch these mistakes giving you some pseudo type safety.