r/programminghumor • u/hpyfox • Jul 23 '26
Which one you use more?
Causally, print statements but when you get desperate or the project is too big, a debugger is great.
215
Upvotes
r/programminghumor • u/hpyfox • Jul 23 '26
Causally, print statements but when you get desperate or the project is too big, a debugger is great.
49
u/agfitzp Jul 23 '26
I can tell you this after thirty years in the industry, if anyone tells you a debugger is a waste of time you should never take any of their advice.
6
u/taurus_incognito Jul 23 '26
Lol .. too much faith put in lldb though.. good luck with the races.
65
u/Darkodoudou Jul 23 '26
print("AAAAAAAAAAAAAAAAAAAA")
21
u/Avocadonot Jul 23 '26
Mfw every print statement is "test" and then I have to count how many got printed to figure out where the code failed, instead of just "test1"
8
u/slime_rancher_27 Jul 23 '26
The debugger was nice for debugging pic microcontrollers with the special debugging hardware. But you can't always use a debugger, for instance many arduinos don't support debugging so you just have to get good at print statements.
5
u/AndroidOdnetnin Jul 23 '26
Print statements. They they get called "1", "2", "3", and then if they go inside of a conditional block, they become, "2a", "2b", etc.
5
u/fixermark Jul 23 '26
I do distributed systems, so print.
Can't throw a debugger on a node of a big distributed process. Not unless all you want to learn is what the timeouts are on your upstream and downstream. ;)
(There have been some very, very clever ideas in this space, but generally they haven't caught on as mainstream, standard, and ubiquitous, unfortunately.)
4
u/Strostkovy Jul 23 '26
I turn on an output at the start of an interrupt. I turn it off at the end of the interrupt. When I no longer hear a beep from the speaker on that pin, I know I need to optimize.
1
u/FragmentedHeap Jul 24 '26
Print statements+ llm is better. I don't know if I even read error messages and print dumps anymore
Debugging loop is basically mcp llm now.
Can easily write every possible edge case test now and let llm debug till it finds the problem.
Works everywhere on every language.
I hate everything about it but it's really effective.
2
u/Ignisami Jul 23 '26
The Intellij debugger is goated beyond belief.
Use the good ol log statements to narrow down where to set the breakpoint, then debugger.
2
u/LegendarySoda Jul 23 '26
I see, developer experience in python so poor developer can't track code while running.
2
u/SpaceCadet87 Jul 23 '26
The debugger isn't for debugging.
It's the default thing you should be doing with the code after writing anything to make sure what you wrote actually does what you think it does.
1
u/Xgf_01 Jul 23 '26
1
u/Complete_Window4856 Jul 23 '26
Since 2020 i cirsed myself to print "sussy" and "amogus" and now i write it instinctively on quick debigs. Im quite sure i forgot those at one time and commited so another dev would find out
1
u/shadowdance55 Jul 23 '26
I used to use print statements all the time. I don't any more.
1
u/Athropod101 Jul 23 '26
every time I’ve seen mentions of debuggers they seem like so much upfront work that I’ve never gotten around to learning them :(
I built a whole kernel + shell for my arduino in rawdog C using nothing but UART print statements straight into picocom. Did I suffer needlessly? The memory corruptions were funny tho.
1
u/Responsible-Bar7165 Jul 24 '26
both. logging for helping to track down issues in production. debugger for development.
1
u/MagicalPizza21 Jul 24 '26
Debugger if one is available. Otherwise print statements work.
1
u/AtmosphereVirtual254 Jul 24 '26
I tend to output the extra symbol table if I’m linking for a debugger
1
u/Black-Cloud-22 Jul 24 '26
GDB
1
u/ReasonResitant Jul 24 '26
I literally have 9 clue how to make it work in vscode and I am too lazy to use the client debugger even if its nicer so prints it is.
Although after a while "----look at me4-----> ", err becomes unreadable
1
u/Eric848448 Jul 25 '26
God I miss GDB. LLDB doesn’t autocomplete anything! And why would they use different commands from GDB? It’s not hard; just make them the same as what everyone has been using for 30+ years.
1
u/Silly_Guidance_8871 Jul 25 '26
Since I rarely get to work in environments where I'm allowed to install a debugger, print statements & psychic debugging are my go-tos.