After enough time this just becomes "1", "2", "3" etc. I'm at a point where if there is a messy section i automatically generate/copy paste 9 of these and place them around the troubling section.
That sounds horribly inefficient when you shoukd just start to do breakpoints. The ide will also tell every variable thats accessible at the breakpoint and its contents.
How else are you expected to debug some apps with threads and multiple services involved with timing affecting? Add a line breaker and all of it crashes
I have added sysou syslog and syswarn to my auto complete and they expand to our logging macro, a pretty function macro, a line macro and my commit handle that is easily searchable in logs.
When i want to trace something i can simply sysou a couple of spots and not stage the lines to clean up before committing
Its funny, teaches you not to commit your console logs (you'll only ever commit poop once), and p/o are right next to each other on the keyboard so its fast
Personally, I just use unique gibberishes or sounds, like "blah", "bleh", "fwah", or the like. Extremely unlikely to come up during normal usage, stands out enough to draw the eye, and easy to search the source for.
That, or a quick description of the location, such as "before x() call" or "inside y()" or "after foo, before bar", depending on the situation.
"Hello. My name is Inigo Montoya. You killed my father. Prepare to die" "Hello. My name is Inigo Montoya. You killed my father. Prepare to die" "Hello. My name is Inigo Montoya. You killed my father. Prepare to die"
A single letter is impossible to grep for in a log file though. It's fine if you're adding console logs to a JS application that doesn't have much other logging going on, but for anything else, you want something identifiable that you can search for without getting false positives.
This. Showing my age, I used to make simple DirectX 7 games as a college student. I remember having one bug that took me weeks to solve. If I tried to debug, it worked fine. If I put in a bunch of logging, it worked fine. But if I ran it without debugging or only a few prints it segfaulted.
Eventually I realized I was using a pointer (void**) that the GPU was supposed to populate before it was being populated. The delay from debugging gave it enough time for the GPU to finish setting that pointer. I added a GPU flush (just a command that waits until it is processed by the GPU queue before continuing) and it worked beautifully. Nowadays the engines just do all that crap for you.
Honestly thats what i have had multiple times where someis being filled in another thread. It works on one machine but when your system is faster or slower it might not. Horrible to debug
I used to work on tape libraries(big backup systems...) and it would lose geometry(location of the tapes) when a bug happened and needed to rescan the whole thing. After trying to attach a debugger to winCE several times and it taking several hours to reboot and rescan I added print logging. Yeah solved the bug in one go...
I've sometimes needed to open a file, write to it, close it, and flush, because prints and logs don't always show up correctly in the face of certain types of crash. Or "send a UDP packet to port 54321" and do my logging in a separate app.
I don’t hate it, shorter usage everywhere, can wrap it in a conditional based on ENV for dev logs only, and if you swap to an external logging service you just change it in that one function.
I am NOT a programmer by profession, though I do code a ton at my job (Mechanical Engineering and data analysis), so this may be a dumb question…
Is there a way to set up all microservices to run on one computer to aid in debugging? Like a bunch of VMs or docker-but-faking-network-instead-of-machine?
Yes, I use Tilt to set up a localized Kubernetes cluster or to run docker compose. It provides a nice web interface for seeing all service statuses, logs, controls to restart or rebuild a service, and it can automatically watch local files to trigger a rebuild.
I think some problems are faster to solve with a simple print, if you really do need tk warch your code step by step to figure out what is going wrong then pull out the debugger, also here's a tip, learn to use your debugger do that you aren't bashing your head against a wall trying to figure out what is causing an issue
I tried debugging "the right way" and I don't know it just never felt better than using console log. People who do use it please enlighten me: how will it make your life better? I am using Python btw, so maybe having the console makes a debugger less necessary
I use pycharm (mostly because I'm a Java boy), the debugger lets you step line by line, preview variables, and evaluate any expression (including calling an endpoint using a client class that's already authenticated).
Do you use console.log with a debug flag? If you're using it without it, deactivating, and reactivating, it is PITA. And I don't mean capitalized greek bread.
Those debugging tools work well with something small, like a microservice.
Throw something chunky at it. Like a large Android app, and debugging tools either fail to attach, crash the app, cause app to stop responding, or just crash on their own.
I just enter stars and after each step the count increases.. so I end up spending more time counting stars in the logs and comparing at various stages in IDE than actually finding the issue.
I'm using password generator to generate unique random 8-letters-long strings, and then I'm pasting those into console log messages and error messages. If my code will get into some strange place, then it's soo easy ti to debug it by just searching the string from the log inside the source code 😅
Honestly, I've never tried to debug a full JS backend application and debugging some frontend application in the browser dev tools is just pain..
With PHP setting up Xdebug is like flipping switches in an airplane until it works. .NET/C# is undoubtedly the best experience with debugging I've ever had.
if it's faster than navigating a debugger, then there is no issue.
Really it's just whatever you find faster to solve problems. Might be worth looking into debuggers on your own time, but we all know you're not going to do that.
I actually like to use debuggers to get familiar with inner workings of the program. Stepping through a process often exposes a lot of in-buult or hidden classes or files you wouldn't find easily otherwise.
And stepping through a debugger to simply verify the contents of a variable is more time consuming than just printing it.
If they ever figure out a JS debugging tool that is actually reliable and accurate enough, I'll bless the earth they walk on though.
People are obsessed about “proper”. No one thinks with their own brain, yet everyone is trying to employ “best practices”. People just can’t stand for what they do and how they do it. Trying to hide behind the rationale of the “best approach”.
Programming in C, I don't know how to use the debugger and how to control the flow of the program in it. If I compile with debug information and it shows the segfaul inside an underlying library I am totally fucked and this makes me mad.
862
u/Mindstormer98 Sep 06 '26
Dont forget "I got here2" and "I got here3"
743
u/sweetytoy Sep 06 '26
A real developer wouldn't do that. A single letter is more than enough, your sentence is too long and tiring to type.
263
u/Idk13008 Sep 06 '26
Unironically, some race conditions are better chase down with logs rather than a debugger.
54
u/EPacifist Sep 06 '26
My favorite is `exit(1)`. Useful if your print/logs aren’t showing where you expect them. Close after that is `raise Exception(“HERE 1”)`.
43
u/oosacker Sep 06 '26
Real pros write a function to do the console log
28
u/elmanoucko Sep 07 '26
// don't remove the following console log, fixed a race condition139
u/TheDogPill Sep 06 '26
Try debugging like that using micro services on the cloud and see how far you get.
10
u/safelix Sep 06 '26
We have a typist up in here. Just "here" does it for me. And then "Here 2", "Here 3", and so on.
8
u/n9iels Sep 06 '26
Oh no, that is way to long and descriptive. I just go with 'durp', 'blub' and 'nope'
8
u/No-Ambition-4164 Sep 06 '26
111111111 222222222 333333333
6
u/Xevestial Sep 06 '26
log the root object, then navigate all the triangles.
5
u/DTSHNICK Sep 07 '26
Hello, embedded engineer here. IDE debugger suxks, log console is the best option
4
u/Foorinick Sep 07 '26
I think some problems are faster to solve with a simple print, if you really do need tk warch your code step by step to figure out what is going wrong then pull out the debugger, also here's a tip, learn to use your debugger do that you aren't bashing your head against a wall trying to figure out what is causing an issue
4
u/action_turtle Sep 07 '26
I like
console.log(1)
console.log(2)
console.log(3)
3
u/LetterLambda Sep 07 '26
What else are you supposed to do when a bug appears in prod, but not in debug mode?
2
u/KoliManja Sep 07 '26
Who wants to ask for Admin access from some Sysadmin sitting in Timbuktu everytime you want to run your debugger? "I got here" works for me!
2
u/RobotechRicky Sep 07 '26
I always add a log statement "I made it".
2
u/EdelWhite Sep 07 '26
...and then, just in case you need it later, give it the trustworthy "//" treatment.
2
u/Cyhnn Sep 07 '26
Wtf1 wtf2 wtf3
2
u/Occultus_Andras Sep 07 '26
"inside the loop" "Inside the else if statement" "return value is ___" "user parameters are ___" "database entries for ___ is ___"
2
u/Birphon Sep 07 '26
the IDEs debugging tools in question will respond with shit like "𓀀 𓀁 𓀂 𓀃 𓀄 𓀅 𓀆 𓀇 𓀈 𓀉 𓀊 𓀋 𓀌 𓀍 𓀎 𓀏 𓀐 𓀑 𓀒 𓀓 𓀔 𓀕 𓀖 𓀗 𓀘 𓀙 𓀚" and "Didnt work :D"
2
u/Kajot25 Sep 07 '26
For me its "fuck this shit", "fuck this shit2", "fuck this shit3" and so on
2
u/burgonies Sep 07 '26
`console.log('****** WHAT THE FUCK ******');`
2
u/xWrongHeaven Sep 09 '26
2
u/WispTheWanderer1 Sep 07 '26
I dk about you but I use actual breakpoints
2
u/Educational-Lemon640 Sep 07 '26
Is it your job to use a debugger, or to improve your product/project?
Use what works.
2
u/wristay Sep 07 '26
I tried debugging "the right way" and I don't know it just never felt better than using console log. People who do use it please enlighten me: how will it make your life better? I am using Python btw, so maybe having the console makes a debugger less necessary
1
u/dudeness_boy Sep 06 '26
print("bread")
1
u/NJ247 Sep 07 '26
"Hellooooo. Is it me you're looking for?"
1
u/Babemagnet69 Sep 07 '26
AHHHHHHH 1 or AHHHHHHH 2
Hard to miss being yelled at
1
u/thelumaniboi Sep 07 '26
I always thought I was a terrible coder because of how often I do this, glad to see its somewhat common
1
u/ketopraktanjungduren Sep 07 '26
Tell that to nvim users
1
u/SandStealer Sep 07 '26
Stare at debug tools , and start debug in head
1
u/Random_182f2565 Sep 07 '26
Print(" failure: you shouldn't be reading this :C")
1
u/MotaLadkaHu Sep 07 '26
console.log(“I got here 2”)
1
u/m0nk37 Sep 07 '26
Console.log("s");
Console.log("ss");
Muscle memory ctrl+s. In my day there was no document recovery.
1
u/stilldebugging Sep 07 '26
Here1 Here2 Here3
1
u/conundorum Sep 07 '26
What if I told you...
...You could have the debugger use console-logging calls as debug tools & breakpoints?
1
u/biggiebass13 Sep 07 '26
This is the way
1
u/WillingLearner1 Sep 07 '26
Yeah we don’t do that anymore. It’s more ctrl+c ctrl+v these days
1
u/RRumpleTeazzer Sep 07 '26
not every architecture has a debugger.
not every problem can be solved by a breakpoint.
1
u/Ok_Spread4050 Sep 07 '26
20 layers of JavaScript “framework” abstractions will do that.
1
u/thegodzilla25 Sep 07 '26
Debuggers are cool, and I would use them most times, but async and race code is horrible with debuggers. Especially in JS.
1
u/walmartgoon Sep 07 '26
Maybe I just want to debug in a way I know how to instead of learning a new tool
1
u/Primary-Ad-9741 Sep 07 '26
Those debugging tools work well with something small, like a microservice.
Throw something chunky at it. Like a large Android app, and debugging tools either fail to attach, crash the app, cause app to stop responding, or just crash on their own.
1
u/irn00b Sep 07 '26
"Ah, shit. Logs are scrolling by too fast."
1
u/bradpittisnorton Sep 07 '26
I wanted to use vscode-js-debugger but I can't, for the life of me figure out how to configure it properly in my neovim setup.
1
u/killerdrama Sep 07 '26
I just enter stars and after each step the count increases.. so I end up spending more time counting stars in the logs and comparing at various stages in IDE than actually finding the issue.
1
u/WatchOutIGotYou Sep 07 '26
console.log({ val })
Or
console.log("hiiiiiiiii")
Are my lazy go-tos lmao
1
u/Novel_Dog1743 Sep 07 '26
printf("If you are reading this, here is the value of every variable related to this function:\n");
<prints all the variables>
1
u/Runrun_5 Sep 07 '26
println!("qiwduqwdoqwopjdoioqwidjpo")1
u/LmaoPew Sep 07 '26
I once forgot to remove my System.out.println("test") from a computer science exam
1
u/JohnnyPlasma Sep 07 '26
I mean, at least it works with every IDE whenever you share the code or change IDE.
1
u/cosmicomical23 Sep 07 '26
The alternative is having to learn every fucking time a new set of controls for the new ide, with no explanations to be found anywhere.
1
u/harveyabb Sep 07 '26
This the way!
1
u/FailureOfTheFamily Sep 07 '26
Nah nah nah. "1", "2", "3"
1
u/frinoname Sep 07 '26
What are debugging tools? Just allow Claude to print-figure out things itself.
1
u/artur-iwan Sep 07 '26
I'm using password generator to generate unique random 8-letters-long strings, and then I'm pasting those into console log messages and error messages. If my code will get into some strange place, then it's soo easy ti to debug it by just searching the string from the log inside the source code 😅
1
u/ShrimpStuffAdmin Sep 07 '26
I used to use swear words. The worst ones of course.
1
u/Bulky_Engineer_2534 Sep 07 '26
print(1), print(2),... always works
1
u/Patrick_Atsushi Sep 07 '26
Print("%s, %d\n", __func__, __LINE__);
By the way this is not reliable since print buffer exists.
1
u/Faegbeard Sep 07 '26
console.log("if you see this, someone(me) has fucked up")
1
u/rcls0053 Sep 07 '26
Honestly, I've never tried to debug a full JS backend application and debugging some frontend application in the browser dev tools is just pain..
With PHP setting up Xdebug is like flipping switches in an airplane until it works. .NET/C# is undoubtedly the best experience with debugging I've ever had.
1
u/Inevitable_Sun_5987 Sep 07 '26
Too long. I always write console.log(„ppp”);
1
u/boomers26 Sep 07 '26
Log.info(“>>>>>>>>> 1 $value”) is my favorite
1
u/notexecutive Sep 07 '26
if it's faster than navigating a debugger, then there is no issue.
Really it's just whatever you find faster to solve problems. Might be worth looking into debuggers on your own time, but we all know you're not going to do that.
1
u/lewisb42 Sep 07 '26
I sometimes need print statements to narrow down where I need to pull out the debugger.
1
u/Fissvor Sep 07 '26
This is me :
1
u/Undernown Sep 07 '26
I actually like to use debuggers to get familiar with inner workings of the program. Stepping through a process often exposes a lot of in-buult or hidden classes or files you wouldn't find easily otherwise.
And stepping through a debugger to simply verify the contents of a variable is more time consuming than just printing it.
If they ever figure out a JS debugging tool that is actually reliable and accurate enough, I'll bless the earth they walk on though.
1
u/stlcdr Sep 07 '26
Microsoft patch v13.5.1 : “removed all console commands because the IDE has debugging tools built in.”
1
u/Red_Holla04 Sep 07 '26
Mine is
1111111
2222222
333333
1
u/ThisIsABuff Sep 07 '26
If(value==<some value far into a file>)
System.out.println("I got here"); // place breakpoint here do immediately skip to value
I'm not ashamed of doing that
1
u/Skibidibob4 Sep 07 '26
True , this subreddit is stupid
1
u/daffalaxia Sep 07 '26
I'll especially resort to logging if there's a lot going on in parallel - trying to time that right with a debugger is practically impossible.
1
u/ShurNutria Sep 07 '26
console.log("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA")
1
u/OkazakiNaoki Sep 07 '26
clg HOW!?
1
u/kirasiris Sep 07 '26
For me usually goes like: It gets here It gets here x2 It gets here x3 And so on lololololololol
1
u/Candid-Log6751 Sep 07 '26
People are obsessed about “proper”. No one thinks with their own brain, yet everyone is trying to employ “best practices”. People just can’t stand for what they do and how they do it. Trying to hide behind the rationale of the “best approach”.
1
u/GoogleIsYourFrenemy Sep 07 '26
Have you tried to use the debugging tools in an IDE for an embedded processor?
1
u/lastFractal Sep 07 '26
"jqja"
"a"
"yes"
"mwkqkq"
"g"
1
u/SoapCoder Sep 07 '26
I do: f hfs fish parrot treh and just go oh it stopped at fish well where did I put fish
1
u/greenflame15 Sep 07 '26
Legitimately useful in a synchronous settings
1
u/RizzKiller Sep 07 '26
Programming in C, I don't know how to use the debugger and how to control the flow of the program in it. If I compile with debug information and it shows the segfaul inside an underlying library I am totally fucked and this makes me mad.
1
u/EpitomEngineer Sep 07 '26
Why the hate on marketing analytics?
1
u/MischiefArchitect Sep 07 '26
I caught claude and codex doing this themselves for debugging an issue.
1
u/ISDuffy Sep 07 '26
I do "Aqui" which is Spanish for here..
1
u/DudeManBroGuy69420 Sep 07 '26
Don't forget "uh oh"
1
u/NoRequirement5796 Sep 07 '26
I use bacon
1
u/hundo-p Sep 08 '26
Nah it’s always `console.log(“poop”)`
1
u/nxluda Sep 08 '26
I used lyrics from all stars by smash mouth. When the code was successful i got a minute of happiness.
1
u/Fluffy_DOW Sep 08 '26
Here
Acqui
Over here
Now here
Made it
1
u/randomogeek Sep 08 '26
Personally i prefer print("fuck")
1
u/Zenithrium Sep 08 '26
i usually oscillate between "FOUND YOU" and "shit"
1
u/flori0794 Sep 08 '26 edited Sep 08 '26
Well logging is pretty strong... Even more if you fight unification, skolemization and Robinson Resolution..
A log with this structure is much better:
1
u/Awkward-Cat-4702 Sep 08 '26
echo: "=============================="
1
u/calahil Sep 09 '26
I use song lyrics so that I get a dopamine hit when its fixed and I can sing along
1
u/ttop34 Sep 22 '26
I usually write “inside _____” whatever the function name is
1
u/SenatorCrabHat Sep 07 '26
I cannot explain how much better my life got once I learned how to properly use debugging tools.
But I kind of miss a chain of silly messages popping up in logs as well....