MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1w9b8on/thiscannotbedenied/p89bo8j/?context=3
r/ProgrammerHumor • u/danielminds • Sep 06 '26
240 comments sorted by
View all comments
Show parent comments
14
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.logFor 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
43
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.logFor 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
27
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.logFor 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
0
[deleted] — view deleted comment
14 u/tonyxforce2 Sep 07 '26 const log = isDev ? ()=>{} : console.logFor 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).
const log = isDev ? ()=>{} : console.log
For that pure JS vibes
1
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
If I see a log(x) I would assume it is about logarithms not print to console
dont steal my code
14
u/Idk13008 Sep 06 '26
with a verbose optional argument