Without compilation, how to find bugs?

Marko Rauhamaa marko at pacujo.net
Fri Oct 14 01:21:54 EDT 2016


pozz <pozzugno at gmail.com>:

> All the tricks have a common goal: to discover bugs as soon as possible,
> mostly during compilation process. Indeed I usually find some bugs
> during compilation (or static analysis). It seems to me very important.

Yes, it can be very useful, and with Python, you sacrifice that.

> I will not notice the bug until I test exactly the erroneous line of
> code (the call with only one argument).

Everything must be tested anyway, and even that may not be enough.
Recently, I was guilty of an atrocious buffer overflow in C. It wasn't
caught by the compiler or testing -- during the test run, the stack
happened to contain a series of zeros.

> Are the things exactly how I understood, or do I miss something in
> Python?

What you don't yet appreciate is how Python adds to program quality.
With its concise, high-level constructs, you end up expressing more with
far less code and far less boilerplate. Your code is far easier to get
right, and you can put together more complicated solutions that are
still robust.


Marko



More information about the Python-list mailing list