4 ms·
This is actually really cool. I was going to say that so many people miss the point of print debugging and as a consequence forget to shorten the import line as
by josalhor 6y ago
This is actually really cool. I was going to say that so many people miss the point of print debugging and as a consequence forget to shorten the import line as much as possible.
from icecream import ic;ic() is 28 characters
import q;q() is 12 characters
print() is 7 characters
- oauea 6y agoWhy would the amount of characters possibly matter?
- josalhor 6y agoI find it important because it lowers the barrier of entry to print debugging. I have found myself using less prints in Java than in Python both because of static typing and having to write the full `System.out.println`. This is also important to me because I am very cautious of not doing a file-level import (I don't want to commit a file with the dependency). The fewer characters it takes, the easier it is for me to write it all in a single line and remove it afterward.
- canada_dry 6y agobc pgmrs r lazy af. Seriously though... when I'm in debugging mode, speed and efficiency in completing the task is paramount. So, every character I save typing, the better!
- kyawzazaw 6y agoreduce the energy barrier to debugging
- Noumenon72 6y agoThe article says you can call from icecream import install install() in main, and from then on icecream counts as a built-in, so you can just say ic(). Four characters.