News for hackers. Stuff that matters.
Re:Logging as a code smell by johnwheeler on Sunday January 09, 2022 @09:03PM (#29869706)
Just like a Java programmer to tell you to use an event bus for simple diagnostics. I’m a former one, I don’t mean no offense.

I go even lower though. Just

print(“XXXXXXXXXXX”)

print(“XXXXXXXXXXX”)

print(amount)

Re:Logging as a code smell by Spivak on Sunday January 09, 2022 @09:14PM (#29869792)
That event bus exists whether you call it one or not — print is just a buffered serialized stream of events consumed by the kernel and rendered to strings.
Re:Logging as a code smell by johnwheeler on Sunday January 09, 2022 @09:43PM (#29869970)
> buffered serialized stream of events

So is a sewer though, and I wouldn’t call that an event bus either.

Re:Logging as a code smell by diogenesjunior on Sunday January 09, 2022 @09:14PM (#29869801)
when my code is not working how i expect it to, i print a ton of equal signs, then the value on a knew line, then a new row of equal signs. never used loggin before.
Re:Logging as a code smell by jpgvm on Sunday January 09, 2022 @09:19PM (#29869838)
You my friend need to experience an interactive debugger.
Re:Logging as a code smell by zepolen on Tuesday January 11, 2022 @01:14AM (#29888190)
You my friend need to experience a production heisenbug.
Re:Logging as a code smell by jpgvm on Tuesday January 11, 2022 @02:04AM (#29888469)
I think you are taking the comment rather out of context and just took the chance to be snarky. The gentleman I was replying to is clearly new to the gig and he should try out a debugger, it will change his workflow immensely and likely make him a much better developer.

Yes, you still want logs (or events or traces, etc) in production to identify when edge cases or heisenbugs have occurred. A debugger doesn't replace those but it does replace 'println` style debugging when developing new code.

Re:Logging as a code smell by zepolen on Tuesday January 11, 2022 @03:18AM (#29888930)
> it will change his workflow immensely and likely make him a much better developer

Frankly the best developers I have met did not rely on debuggers, or logs for that matter. Using neither forces them to keep the program flow in their head and completely understand the code and system before pressing run.

For debugging production systems of course logs are useful.