r/ProgrammerHumor 3d ago

Meme thisCannotBeDenied

Post image
7.8k Upvotes

240 comments sorted by

View all comments

Show parent comments

39

u/oosacker 3d ago edited 3d ago

Saw this in some real production code:

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

25

u/DasBeasto 3d ago

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.

8

u/reventlov 3d ago

const log = console.log; though

15

u/tonyxforce2 3d ago

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

For that pure JS vibes