2 added 705 characters in body
source | link

Write unit tests. They are also useful for typed languages, but in dynamic typed languages such as Python or Smalltalk unit tests give you the added bonus of type checking.

I'm not saying you should check types in the unit test, but that the test will probably fail if you use the wrong types.

edit:

But maybe I misunderstood your question. Are you having real productivity problems with weak typing in Python? Or are you just worried you will?

If its the former, go with TDD, it will also give you confidence in the code you are writing. If the latter, just go ahead and don't worry to much. When I first learned about Smalltalk I was coming from Java, and the weak typing issue surprised me. So the first thing I asked a veteran Smalltalk coder was:

-don't you have lot's of type-related runtime bugs?

-no, that was never a problem for me

Usually the weak-typed languages are more productive than the strong-typed, so any inconvenniences with typying is not a big deal.

Write unit tests. They are also useful for typed languages, but in dynamic typed languages such as Python or Smalltalk unit tests give you the added bonus of type checking.

I'm not saying you should check types in the unit test, but that the test will probably fail if you use the wrong types.

Write unit tests. They are also useful for typed languages, but in dynamic typed languages such as Python or Smalltalk unit tests give you the added bonus of type checking.

I'm not saying you should check types in the unit test, but that the test will probably fail if you use the wrong types.

edit:

But maybe I misunderstood your question. Are you having real productivity problems with weak typing in Python? Or are you just worried you will?

If its the former, go with TDD, it will also give you confidence in the code you are writing. If the latter, just go ahead and don't worry to much. When I first learned about Smalltalk I was coming from Java, and the weak typing issue surprised me. So the first thing I asked a veteran Smalltalk coder was:

-don't you have lot's of type-related runtime bugs?

-no, that was never a problem for me

Usually the weak-typed languages are more productive than the strong-typed, so any inconvenniences with typying is not a big deal.

1
source | link

Write unit tests. They are also useful for typed languages, but in dynamic typed languages such as Python or Smalltalk unit tests give you the added bonus of type checking.

I'm not saying you should check types in the unit test, but that the test will probably fail if you use the wrong types.