Me, I'm lazy, so I lean on my tools to make my life easy. And there's some fantastic tooling out there; the biggest problem is usually discovering that a helpful feature exists and how to use it effectively.
They started to realize that there were many developers doing feature requests for stuff Visual Studio already supports.
I understand that what I did would be a bit close to a poor man's reversible debugger.
[0] https://gist.github.com/hadrianw/5b8d33a4b353c49e7dbd6eb55f8...
https://docs.microsoft.com/en-us/visualstudio/debugger/debug...
https://docs.microsoft.com/en-us/visualstudio/debugger/map-m...
Otherwise Intellitrace is the way to go.
https://docs.microsoft.com/en-us/visualstudio/debugger/intel...
Now if you insist in vim and Emacs, there is printf.
That's just plain wrong. GDB for example has had pretty printers for STL data structures for many years. Those operate on the underlying structure of the data types and you can write printers for your own data types pretty easily (gdb uses python for these).Apart from that, there is structured hierarchical logging, which seems to be on the way of becoming an industry standard and is considered best practice in some ecosystems (golang comes to mind)
Also it has to do with IDE, because in an IDE there is two way communication between both tools, like the ability to do edit-and-continue.
It's not quite as fancy as an IDE, but it's a lot more than printf.
Here's a recording of using GDB's TUI mode: https://s.mort.coffee/d/vid/gdb-tui-demo.mp4
Note that I'm not a GDB pro, I just recently started trying to use it more instead of printf, so there are probably lots of stuff I didn't show off. (For example, I wish I'd shown the `bt` command to print stack traces).
Another thing that's worth noting is that with GDB, if your program crashed and generated a coredump, you can use GDB to look at how everything was when it crashed, just like if you were debugging a running program. This is extremely useful on for example embedded systems where you don't have GDB installed, or when the crash is hard to reproduce.
I don't know if you've tried it, but whenever you have a bit of time try Visual Studio's (or even Visual Studio Code's) debugger. They're among the best visual debuggers out there. Or IntelliJ's.
You see directly all the variables as you step through code, you can see array contents directly, they're super discoverable, etc.
It's such a shame that there's no glory (or money) to be had in designing CLI/TUIs. I also get the impression that it would be really hard to change things, OSS maintainers have a reputation for being very stubborn about workflow changes (sometimes for good reasons, sometimes not) :(
As for the data visualizers, as mentioned, with Java and .NET I can do it with a bit of annotations and the debugger takes it from there.
Or in C++'s case when using Visual Studio, a bit of XML describing the metadata.
BTW: In GDB, all commands have shortcuts i.e. 'b'=='break'. (Saves a lot of time).
No reason this couldn't be possible for Emacs, I guess nobody bothered. In particular, Common Lisp with SLIME already makes use of "presentations" in REPL, which nicely combine CL's print-object output with inspector/debugger capabilities.
Ultimately, no one limits you to printing out simple text. In various Lisp software I wrote, I ended up displaying profiling info inline in REPL, like this:
CHARTED-LET*
0 9.249
˫--------˧
SOME-VAR: 0.006 |
OTHER-VAR: 0.004 |
SOME-COMPUTATION: 2.036 |==.
A-SUMMARY: 0.062 |
DATA-FOR-A-CHART: 3.486 |====
SOME-BIG-COMPUTATION: 9.249 |==========
SOME-TREE-STUFF: 0.005 |
(EDIT: there were pretty Unicode characters in that output, but my browser / HN ate them. See https://github.com/tkych/cl-spark for how it should look like.)(all it took was a simple macro on top of a sparkline lib). I dumped custom execution stats out-of-band into a HTML file that, with little bit of static JS, rendered explorable charts. I've sent data straight into new Emacs buffers for processing, with a help of this simple macro:
https://gist.github.com/TeMPOraL/8715c9dd9837e0b601d1cdce059...
(can be trivially modified to make the new buffer automatically assume a given major-mode).
Point is, you don't have to limit yourself to simple, uninterpreted printfs. Write your own debugging tools! And while I'm not up to date with C#, most other languages and IDEs I've seen don't move beyond dumb printfs. Java definitely doesn't (hint: Grep Console is a very useful plugin to IntelliJ and Eclipse). And this Console.table() is just a visual gimmick. I'm actually disappointed that with all the capabilities for interactive HTML rendering, that's the best the Web standardized on so far.
#+BEGIN_SRC elisp
(list (list 'col1 'col2) (list 1 2))
#+END_SRC
(I don't use quote syntax to not confuse non-lispers)
Hitting C-c C-c on it produces the following block just below it: #+RESULTS:
| col1 | col2 |
| 1 | 2 |
With Org source blocks you can have a literate program even using multiple languages and still communicating easily between source code blocks and both generated and static tables. It can easily be intermixed with formatted text and exported to a suite of various formats, including plain text source code (so-called "tangled source").Edit: just for the sake of it, another example, this one in Python:
#+BEGIN_SRC python
return [[x for x in range(1,5)],
[chr(y) for y in range(ord('a'),ord('e'))]]
#+END_SRC
#+RESULTS:
| 1 | 2 | 3 | 4 |
| a | b | c | d |Freaking IBM had box drawing characters in freaking 1985, how hard is it to have them in 2018? https://www.ascii-codes.com/
See this:
┌─┬┐
│ ││
├─┼┤
└─┴┘
vs the crappy table. | Hello | Planet | Earth |
|-------+--------+-------|
| foo | 4 | 88 |
| bar | 265 | 123 |
|-------+--------+-------|
| sum | 269 | 211 |
This org table looks clean enough to me.The disadvantage of using box drawing characters is that they do not always align nicely - depending on the font, renderer, and couple other things. You can't go wrong with basic ASCII and a fixed-width display.
How do you type ┌─ ?
It's easier to use a font that renders "regular" keyboard characters as borders, akin to https://github.com/tonsky/FiraCode
Beauty is in the eye of the beholder, true, but the majority of the beholders want a table to actually look like a table. If you give me pen and paper, I'm not going to draw weird half lines around the table, I'm going to draw the table first, line fully drawn everywhere and then add the content.
Common Lisp and Smalltalk environments have something like console.table since its early days.
Xerox even went to the trouble of adding similar capabilities to the Mesa/Cedar enviroment, because they thought they should cater to their Interlisp-D and Smalltalk developers.
Java and .NET even allow to provide metadata so that debuggers know what is the best way to render the data in debug view.
Visual Studio allows similar capabilities for C++ via data visualizers.
Now if you insist in vim and Emacs, there is printf.