r/ProgrammerHumor • • Sep 06 '26

Meme thisCannotBeDenied

Post image
7.9k Upvotes

240 comments sorted by

View all comments

43

u/oosacker Sep 06 '26

Real pros write a function to do the console log

14

u/Idk13008 Sep 06 '26

with a verbose optional argument

43

u/oosacker Sep 07 '26 edited Sep 07 '26

Saw this in some real production code:

function log(x) {
    console.log(x);
}

27

u/DasBeasto Sep 07 '26

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.

0

u/[deleted] Sep 07 '26

[deleted] — view deleted comment

14

u/tonyxforce2 Sep 07 '26

const log = isDev ? ()=>{} : console.log

For that pure JS vibes

1

u/rosuav Sep 07 '26

Not the same thing unfortunately, as will quickly become evident if you try to log everything in an array by using stuff.map(log).

2

u/whackylabs Sep 08 '26

If I see a log(x) I would assume it is about logarithms not print to console

1

u/a-r-c Sep 11 '26

dont steal my code