Introducing IceCream: Never Use Print() To Debug Your Python Code Again
<p>Errors are almost inevitable while programming. In fact, it is rightly said that a programmer spends a significant amount of their time debugging to make their code error-free.</p>
<p>While debugging, using <code>print()</code> statements to understand the flow of the pipeline and spot unexpected behavior is undoubtedly the most widely adopted approach.</p>
<p>However, using <code>print()</code> has numerous caveats, such as:</p>
<ul>
<li>Print statements are usually intended to display an output to the user. If the programmer uses <code>print()</code> to debug, after debugging is over, the programmer should be cautious of removing only those specific <code>print()</code> statements that were intended for debugging.</li>
<li>Often, during debugging, you may print multiple variables one after the other. In such cases, the programmer has to manually format the output to enhance its readability.</li>
</ul>
<p> </p>
<p>Above, we print two variables. Although here we know that the first variable is <code>var_1</code> and the second is <code>var_2</code>, as the number of variables increases, it might require you to look back and forth between the code and the output to figure out which output corresponds to which variable.</p>
<p><a href="https://towardsdatascience.com/introducing-icecream-never-use-print-to-debug-your-python-code-again-d8f2e5719f8a">Visit Now</a></p>