Friday, August 14, 2009

Top things I miss when going from Eclipse JDT to Visual Studio C++

I recently dived into Visual Studio to do some C++ hacking after several months of doing mostly Java in Eclipse, and discovered a few items which I really miss.
  • Hot code replacement. This is really addictive in Eclipse: I set a breakpoint in a function, edit the code around it. After saving, the code in the debugged JVM is replaced and PC is reset to the start of the function. The other day I got annoyed when this didn't work (I changed the class' external signature), and I actually had to restart the debug session. Oh no!
  • Drop-to-frame. I can at any time reset the execution state to a frame further down on the stack and rerun from there.
  • Automatic code formatting. In Eclipse I have function "format entire source file on save" switched on, basically letting the editor do all the formatting for me. It even does line-wrapping inside comments, something I find very handy. In Visual Studio I have to manually indent each line (well, the indentation level is given automatically), but things like line-wrapping I have to do manually.
  • Incremental background compilation. I can sit several seconds waiting for the code to build before I realize that I need to start the build manually. (You also have to save your code before you can get any sort of feedback from the compiler.)
  • The "open type" and "open resource" commands. "Open type" allows me to interactively search for a class and jump to it. Visual Studio has a similar search, but I often get multiple matches and need to think about which match I'm actually interested in. "Open resource" does the same thing, but searches for files in the workspace. Visual Studio only gives me the regular Open File dialog, which is useless since I first need to locate the directory the file is in.
  • Red squiggles for errors. Compilation errors are indicated as a tiny line in the margin, instead of a red squiggle in the code.
  • The Emacs-bindings in Visual Studio are much crappier than in Eclipse. The most annoying part is that TAB doesn't indent an empty line, so you have to start your line at column zero, and not until you've written at least one character can you indent the line. (The Emacs-bindings in Eclipse aren't perfect either, I especially miss the kill-ring).
I realize that several of these issues are very difficult to get right in a C++ IDE (hot code replacement and drop-to-frame, for example), or completely subjective (I don't really expect Microsoft to spend a lot of time getting Emacs-binding completely right; I'm actually very happy that there are Emacs bindings at all).

3 comments:

Carlos said...

Visual C++ has hot code replacement (at least for native code, it seems that it doesn't work for managed code). Also, you can move the execution pointer to be beginning of the function (or any other location).

JesperE said...

What requirements does hot code replacement have for Visual Studio? It doesn't work out-of-the-box for me at least.

Just moving the execution pointer isn't enough. You need to restore the machine state, which I'm pretty sure Visual Studio can't do. (JDT can't do it all the time of course, but surprisingly often.)

Sophie said...

Hi,
I am Programmer with Chessboss.com. Chessboss.com is absolutely FREE chess server where you can play chess,create your own tournament with players online. No Gambling and explicit talk. This website is purely meant to increase the fan-base of chess and for entertainment. I Need your help to promote the FREE chess server around the world. I would like to be on your blog as i found it a useful and informative resource. By adding chessboss.com you will recognized and added as a top resource on our chess server. I really believe in FREE flow of information. I have included the code and title.

Please email me back with subject line of your URL for the featured resource code. This is to avoid spam and to make sure you get the award.

I hope you understand and co-operate with us.

Thank you,
Sophie Vierra
Programmer
www.chessboss.com.