| ▲ | IceCream – Never use print() to debug again(github.com) | |||||||||||||||||||||||||||||||
| 35 points by gregsadetsky 2 days ago | 22 comments | ||||||||||||||||||||||||||||||||
| ▲ | oweiler 2 days ago | parent | next [-] | |||||||||||||||||||||||||||||||
Or use tests and/or a debugger. Which gives you all the listed benefits w/o an additional dependency. | ||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||
| ▲ | RockRobotRock 2 days ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||
>Do you ever use print() or log() to debug your code? I haven't written my own code in months at this point...kind of depressing to think about | ||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||
| ▲ | awoimbee 2 days ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||
Debugging in python is already so easy with `print(f"{myvar=}")` and `breakpoint()`... | ||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||
| ▲ | smackeyacky 2 days ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||
I haven’t used print for debugging for ages. Now it’s all trace on azure and hope your bug ends up in the sampled data in whatever that stupid thing is called. App insights or some rubbish. Apparently a good old log file just isn’t good enough it has to be larded up with a query language. Grep was fine guys. | ||||||||||||||||||||||||||||||||
| ▲ | rurban 2 days ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||
Cannot recommend icecream, way too slow. But the use case of logging shines with realtime systems, or concurrent apps. You won't be able to efficiently debug them without logging. I live in my debugger, but logging is mandatory for the big picture. | ||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||
| ▲ | trvv 2 days ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||
It's neat how trivial it is to do this in C, only takes a couple of macros. https://github.com/trvv/_/blob/d4899741c4f35833b8e86d16e2163... Looks like the project has a linked repo that appears to do a similar thing for C but it doesn't generically format the arguments. | ||||||||||||||||||||||||||||||||
| ▲ | hankbond a day ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||
Yeah this is a miss for me. I've never felt that this was a considerable source of friction. Certainly not enough to justify a dependency. | ||||||||||||||||||||||||||||||||
| ▲ | grun a day ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||
hey! icecream author here. let me know your thoughts on what could make icecream more useful to you. feedback is how good products become great | ||||||||||||||||||||||||||||||||
| ▲ | Borborygymus 2 days ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||
Remember COBOL's EXHIBIT? | ||||||||||||||||||||||||||||||||
| ▲ | soizi 2 days ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||
why another tool for that ? think standard with other team/company and use the same integrated ones. | ||||||||||||||||||||||||||||||||
| ▲ | IshKebab 2 days ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||
...use slightly fancier print() instead! | ||||||||||||||||||||||||||||||||
| ▲ | imagent 2 days ago | parent | prev [-] | |||||||||||||||||||||||||||||||
[dead] | ||||||||||||||||||||||||||||||||