How to reduce errors in dynamic language such as python, and improve my code quality

Posted by Martin Luo on Programmers See other posts from Programmers or by Martin Luo
Published on 2012-12-05T12:08:16Z Indexed on 2012/12/05 17:26 UTC
Read the original article Hit count: 287

Filed under:

I post the origin question in stackoverflow, some people suggest me to post here

I've always have trouble with dynamic language like Python.

Several problems:

  1. Typo error, I can use pylint to reduce some of these errors. But there's still some errors that pylint can not figure out.
  2. Object type error, I often forgot what type of the parameter is, int? str? some object? Also, forgot the type of some object in my code.

Unit test might help me sometimes, but I'm not always have enough time to do UT. When I need a script to do a small job, the line of code are 100 - 200 lines, not big, but I don't have time to do the unit test, because I need to use the script as soon as possible. So, many errors appear.

So, any idea on how to reduce the number of these problems?

© Programmers or respective owner

Related posts about python