/ Home  / Blog

backlinks: /index

Python

Python
Execution Modes

Execution Modes

C++ programmers benefit greatly from having multiple build types of their programs. In most non-trivial systems, this is leveraged by compile-time changes, typically through the preprocessor.

Running with python -O will discard any docstrings at run time, which may increase your running speed, implying that the default mode that Python runs in is actually the development mode.

When developing non-trivial apps, you often want to show debugging information and alter program flow control over the final release version of your app in order to push bugs to the forefront.

Who is running the app?

What you want to see is largely dependent on who is running the app. I characterize this as three different groups:

Programmers — When primary devs are running the app, don't be afraid to print verbose messages, fire up the debugger, or otherwise halt execution on a severe warning. Poor error handling is this class of developer's problem, and you want to make it apparent early and often.

QA Testers — It is a fact that testers report symptoms and not problems. The quality of the error messages they deliver enable a programmer to trace a symptom back to the problem that is causing it to happen. Testers