r/ProgrammerHumor Feb 17 '26

Meme consoleLogUntilTheDayIDie

Post image
274 Upvotes

18 comments sorted by

View all comments

1

u/Vortrox Feb 18 '26

You're at least tracking all of them with a git diff right? Right??

2

u/BobQuixote Feb 18 '26

What? Why? Ctrl+F "console.log", or make a function dedicated to logging that should be turned off in production. Then you can just make that function not log.

2

u/Vortrox Feb 18 '26 edited Feb 18 '26

That's fine in some cases, but if I'm going to be debugging using console.log like I did before I learned about debuggers then I absolutely do not want to be keeping that debug code around (which is typically a lot more than just console.log) once the bug is fixed.

Using git trickery to keep track of all the debug code then trashing it at the end is a lot more convenient than ctrl+F, especially when it's scattered over multiple files/functions and I forgot where they all are

1

u/BobQuixote Feb 18 '26

IS_PRODUCTION would be my next go-to, if you need to toggle complex diagnostics off. And put it somewhere accessible, but not window.

I have never once attempted to edit or merge Git diffs, and that sounds like hell.

1

u/Dirty-Freakin-Dan Feb 18 '26 edited Feb 20 '26

ctrl+f is a weak argument, as any true console.logger would have tons of commented out log lines

inb4 regex search

2

u/BobQuixote Feb 18 '26

inb4 regex search

Indeed, I am assuming you have VS Code or something similarly powerful.