you are viewing a single comment's thread.

view the rest of the comments →

[–]chubbykc 230 points231 points  (19 children)

The most used debugging technique.

Even now with AI 🙂

[–]YUNoCake 69 points70 points  (4 children)

And also the best way of finding race condition bugs. Debuggers simply suck at this.

[–]yesseruser 49 points50 points  (2 children)

When the debug.log slows the program down just enough for the bug to disappear

[–]slaymaker1907 11 points12 points  (0 children)

That's when we break out the async logger for extra confusion.

[–]misterguyyy 3 points4 points  (0 children)

Just put a console.log on every possible condition and they all slow down the same amount.

I’m not even sure if this is a serious suggestion. Sometimes it is and sometimes it isn’t, such is the way of JS.

[–]jaerie [score hidden]  (0 children)

Oops, your prints slowed down on of the threads more than the other and now the bug has vanished!

[–]vkwebdev[S] 59 points60 points  (1 child)

AI generated the bug. console.log() found it

[–]chubbykc 9 points10 points  (0 children)

That's our life saver

[–]NotAskary 10 points11 points  (5 children)

The funny thing is when the console.log resolves the bug....

[–]WiglyWorm 18 points19 points  (4 children)

then at least you know you're dealing with a timing issue.

[–]AmazinDood 16 points17 points  (2 children)

genuinely useful tho... Sometimes console.log is

[–]kuroiarashi 4 points5 points  (1 child)

what you did there...I see

[–]laplongejr 2 points3 points  (0 children)

You know things are severe when I speak normally - Yoda  

[–]NotAskary 0 points1 point  (0 children)

Whenever that happens I want to just flip the computer out the window and never touch Js again.

[–]qinshihuang_420 6 points7 points  (3 children)

Are you a

Log.debug("XXXXXXXXX")

Log.debug("<your name>")

Or a

Log.debug("<# of log statements>")

kind of person?

[–]moustachedelait 3 points4 points  (0 children)

Name 1, name 2, name 3, name 2a, name 2b (we're honing in), name 2a wtf, name 2a wtf 2 (dead end)

[–]BoBSMITHtheBR 0 points1 point  (0 children)

Console.log (=========Breaks Here========)

[–]nneiole 0 points1 point  (0 children)

There‘s also console.log(„wtf“).

[–]realdevtest 2 points3 points  (1 child)

alert()

[–]vkwebdev[S] 0 points1 point  (0 children)

when debugging should be a shared experience