Live data from Hacker News

Show HN: Dlg – Zero-cost printf-style debugging for Go

github.com

41–42 of 42 posts

Re: Show HN: Dlg – Zero-cost printf-style debugging for Go

#41
post #40

Earlier quoted context omitted.

I don’t know if you’re trying to make assumptions about me or you, but I am those 3 things. It is definitely different approaches and both can achieve the same goals, but having started with your approach and then learned IDE’s, debugging and writing tests, I can from my own experience say that tests and debuggers are the way to go when it comes to building long term stable applications, especially in shared environm…

> I can from my own experience say that tests and debuggers are the way to go when it comes to building long term stable applications, especially in shared environments. Ah, so there's the distinction for me - I don't build long-term stable applications in shared environments, I build small utilities or one-offs in private or occasionally shared environments. > As for speed to attach a debugger? Lol, it is one button…

> I don't build long-term stable applications in shared environments, I build small utilities or one-offs in private or occasionally shared environments.

If your work is that minimal and the code that simple, then pulling in a third-party library just to wrap printf seems like overkill.

And just to clarify, at least in IntelliJ, there's zero debugger config. You set a breakpoint, hit play on your test (or 200 line code), and that's it. Couldn't be easier.

> I cannot see any way in which my workflow would be improved by that level of integration with an IDE

Totally get where you're coming from, everyone has their own workflow. But to me, your bigger issue is a limiting mindset. I'm a tinkerer at heart, always curious to see what new tools can unlock. Even if something doesn't seem useful at first, I've found it's often worth exploring, sometimes the biggest leaps come from unexpected places.

It is a big reason why I put down my ego and went and consulted at Pivotal Labs for almost a year. It was a cult, they did real pair programming, it was uncomfortable for my ego in every way, but once I did it, I was so glad I did. I learned so much. Really shifted my perspective on things.

Re: Show HN: Dlg – Zero-cost printf-style debugging for Go

#42
post #8

How does the dead code elimination work when using args to Printf? If static strings are fed into an empty function, I can imagine it does nothing. However, this I have less of a firm grip upon dlg.Printf("the thing.Something is %+v", thing.Something()) since surely golang will still call Something, and still call Printf And don't misunderstand me: it's a grave pet peeve of mine to do action inside the args to Printf…

I've added a section to the README that goes into the subtleties of compiletime elimination and what to watch out for to ensure that calls to dlg.Printf can actually be eliminated: https://github.com/vvvvv/dlg?tab=readme-ov-file#true-zero-co...

I'd appreciate any feedback on whether these changes make the behavior more transparent and less misleading.

Post reply on HN