Member-only story
Diseases I Got From Debugging A Client’s Python Code
Python tutor/freelancer here — From time to time, I get a request to debug some Python assignment or code with a certain deadline. Recently, I’ve mistakenly agreed to help debug some Python code, and reading the code base gave me the aforementioned diseases.
What Made The Code Base So Cancerous To Read
1) Dynamic Typing in Python
In statically typed languages like java, we need to specify the data type of every single variable, function input and function return type. In statically-typed languages, data types are checked at compile-time before we can even run the code. However, in dynamically-typed languages such as Python, data types are checked only when the code runs.
In other words, Python allows you to input whatever data type you want, and will raise an error during runtime (after we run the code) when it realises that we screwed up the data type.
def add(a, b):
return a + b