4 ms·
Question for Gophers. How do you guys debug your code? What IDE do you use? Scala works beautifully with IDEA IDE, one of the best IDE out there! GUI debugger
by trungonnews 14y ago
Question for Gophers.
How do you guys debug your code? What IDE do you use?
Scala works beautifully with IDEA IDE, one of the best IDE out there! GUI debugger just works out of the box.
I tried using Go for a little bit but I find IDE and tooling support for Go is a bit lacking. Do people consider these aspects anymore when they evaluate a new language? A proper IDE support can greatly boost your productivity!
- andrewguenther 14y agoI have not personally used it, but I know that there is an IDEA plugin for Go out there that some people I know use and seem to be happy with.
- trungonnews 14y agoI used that plugin too. It's still missing the debugging support.
- genwin 14y agoIn Go I do poor man's debugging, print statements. Knowing the exact line number of an error is most of what I want for debugging. On errors Go shows the stack with line numbers. An IDE might be icing on the cake but there are usually disadvantages to be accepted as well.
- jff 14y agoI debug it using Printfs as needed--it just doesn't need a ton of debugging, and Go makes it easy with the %#v format in Printf giving an appropriate, annotated representation of pretty much any data type. Stack traces are also very informative if something goes badly wrong. I'm pretty sure GDB works now too, but again I have never really felt the need for it. But then, I've never really felt the need for syntax highlighting, code folding, or auto-completed function names. I feel like if my Go code has reached a level of complexity where it needs those things, I've done something wrong. My IDE is Acme, it lets me edit files, run my build scripts, and execute test programs.
- trungonnews 14y agoThis sounds like me when I was still in college trying to hack out a 100 line of code for a small programming assignment... But this approach does not scale with a million line of code project. Anyone with real programming experience can tell you this. Corporates don't just shell out thousand of dollars for an IDE license for no reason. :)
- jff 14y agoCrap, there I was thinking developing Go for my employers was "real programming"! I guess I should go add a lot more boilerplate and un-needed complexity, maybe rewrite it in a true enterprise language like Java. Then it would be a big enough project to need an IDE, making it a "real" project. Maybe I should just delete all these repos I've worked on for my job, the cluster management tool, the pedestrian simulator, the GSM radio emulator, the VM monitoring infrastructure, the distributed key-value store. They were written in Go, so I guess they weren't real programs.
- trungonnews 14y agoHey. If you can do all of that without requiring any assistance from a good IDE, then you have my respect. :) However, I'm still sticking to my point. Debugging your code using Printf feels like 1990s.
- NateDad 14y agoYou can always use gdb to debug. However, with type safety and proper unit tests (which are easy to write with Go's interfaces) you often don't need it.
- burntsushi 14y agoI've been programming for over ten years and the only situation under which I need a debugger is when I'm working with a language that allows segmentation faults. Maybe debuggers are useful to you in other scenarios, but they are by no means necessary. You don't need to be inflammatory about it.
- shurcooL 14y agoI'm building something, one aspect of which can be considered as a Go IDE. So that's what I use. It'd be pretty hard for me to go back to just ST2 and a terminal for writing Go code now, but it's not quite ready for mass usage yet. I'm working on it as fast as I can.
- dualogy 14y agoHave a blog or some kind of "sneak peek"? I must admit I'm very much in love with the combo of ST2 with the free GoSublime plugin, Goding is a breeze with it...
- shurcooL 14y agoSure, take a look at https://github.com/shurcooL/Conception https://github.com/shurcooL/Conception - there are some screenshots in the README and if you're feeling adventurous, you can compile the thing on OS X or Linux out of the box. There are also some older public-oriented binaries in the simple-live-editor branch. There's still a lot to do, and much of that is stuck in my head at this time, but I'll do my best to put it all with the source soon. Plus I gotta work on "presenting" it a bit better (in a way that is more friendly towards other people seeing its long-term value and getting them interested in collaborating).
- Matrixik 14y agoLiteIDE[1] has build in Go debugger. [1] https://github.com/visualfc/liteide https://github.com/visualfc/liteide