News for hackers. Stuff that matters.
Re:Go 2 Draft Designs by mike_hearn on Tuesday August 28, 2018 @02:24PM (#17861403)
I'd note that's only an issue if you don't have a good IDE.

In IntelliJ you can breakpoint on an expression that uses chaining, hold down the alt key and then click on the expression you want to evaluate. It turns into a hyperlink and can be viewed easily.

Re:Go 2 Draft Designs by kcmp on Tuesday August 28, 2018 @02:52PM (#17861716)
I think needing a heavy IDE to comfortably work in a language/paradigm is a negative
Re:Go 2 Draft Designs by pjmlp on Tuesday August 28, 2018 @05:41PM (#17863150)
Given what Lisp, Smalltalk, Mesa/Cedar, Oberon, Delphi, VB introduced as productivity tooling, I see as negative programming as if my computer was still stuck in 80x25 green phosphor terminal.
Re:Go 2 Draft Designs by simias on Wednesday August 29, 2018 @03:53AM (#17866503)
That's a silly caricature. I could retort "I see as a negative if my development environment takes 40GB of RAM and half an hour to boot up" and it would be on the same level.

Debuggers are great but they're not always practical, for instance for debugging remote targets with limited connectivity. Actually in some situations you may end up having to buy expensive licenses for closed source software to run a debugger on certain hardware (although that might not be a concern for Go).

I'm also of the opinion that firing the debugger as soon as something unexpected happens instead of taking 10 seconds to reason about your code might lead you to miss a more general problem with your architecture as you focus solely on the symptoms, but that's of course a lot more subjective and your experience may vary. Personally I generally tend to use debuggers as a last recourse when I really can't make sense of what's going on through "static" analysis.

Re:Go 2 Draft Designs by marcus_holmes on Wednesday August 29, 2018 @05:34AM (#17866941)
also, if you write a ton of log statements because that's how you debug, then when your production system blows up and you can't fire up the debugger, you have something to work on.
Re:Go 2 Draft Designs by pjmlp on Wednesday August 29, 2018 @06:51AM (#17867210)
Or use modern instrumentation data that debuggers can work with like IntelliTrace, JMX, Flight Recorder, JTAG,....
Re:Go 2 Draft Designs by simias on Wednesday August 29, 2018 @07:02AM (#17867253)
I don't understand why it has to be an exclusive OR. Both printf-style logging and debuggers have their use. As I mentioned in my previous comment deploying some tracing solutions can be a complicated and expensive process, writing to an UART is however very cheap. Breaking or slowing down the execution of tasks interacting with other threads and resources can be impractical or simply hide the bug altogether if it's race-condition related, sometimes toggling a GPIO and putting an oscilloscope on the PIN beats any trace framework in terms of practicality. It will also work regardless of programing language, developing environment software and hardware used.

Saying that debuggers are for noobs and that they shouldn't be used is idiotic but arguing that not using them is doing it wrong and being stuck at the age of 80x25 terminals isn't much better. Wisdom is to use the right tool for the right job.

Re:Go 2 Draft Designs by scroot on Tuesday August 28, 2018 @09:25PM (#17864515)
Amen
Re:Go 2 Draft Designs by mike_hearn on Tuesday August 28, 2018 @02:57PM (#17861779)
You don't need an IDE but it solves problems like "I don't want to chain my methods because my weak debugger can't handle it well".
Re:Go 2 Draft Designs by sagichmal on Tuesday August 28, 2018 @05:51PM (#17863242)
Chained method calls being difficult to debug does not necessarily mean using a debugger. It can mean difficult to insert clarifying code in the middle of the chain: print statements, or additional value checks, and so on.
Re:Go 2 Draft Designs by bmurphy1976 on Tuesday August 28, 2018 @07:18PM (#17863792)
Chained methods also don't diff as clearly (the one liners anyway).
Re:Go 2 Draft Designs by pjmlp on Wednesday August 29, 2018 @01:06AM (#17865806)
They do on GUI diff tools by using different colors.
Re:Go 2 Draft Designs by Cthulhu_ on Wednesday August 29, 2018 @03:33AM (#17866404)
It's still not as clear as just splitting across lines, plus in most tools you need to explicitly indicate you want to highlight word diffs.

But more abstractly speaking: are chained calls, from the POV of a human that didn't write it, or wrote it two months ago, more readable than a number of statements on multiple lines?

Re:Go 2 Draft Designs by marcus_holmes on Wednesday August 29, 2018 @05:33AM (#17866933)
Generally speaking, Gophers don't interactively debug. There is some support for it, but it's historically been difficult and we have tended to adjust to logging everything and working out the problem from the logs.
Re:Go 2 Draft Designs by lucio on Thursday August 30, 2018 @05:09PM (#17880803)
That's OK but when using "logs" it takes more time and tries to find a complex bug than to search for it using an interactive debug tool.