Integrate Me

My development environment at work is pretty primitive, being a collection of largely unrelated programs loosely tied together with some scripting. Integrated environments are where it’s supposedly at nowadays though, so I figured I should give some of them a shot.

So first of all, what functions do I need from a development environment, anyway?

  • Versioning
  • Checking files in and out of our source control system should be easy — I wouldn’t want to have to check out a file, copy it to a particular location, edit it and build, and copy it back before being able to check it back in.

    We currently use Perforce, and it has a very nice GUI that forms the basis for the rest of my current environment.

  • Editing
  • I need to be able to edit files, of course, and it would be nice to have something a bit fancier than Notepad.

    Right now I use Vim, partly because I’m an old fart used to being forced to use ‘vi’ on ancient old Sparc 3s back in University, and partly because it does a fairly good job of syntax highlighting almost every file format and language under the sun.

    Perforce is set up to launch Vim whenever I double-click on a file in the source tree, and I’m usually near that point in the tree anyways in order to check files out, so it’s nice and convenient. Things can get a bit cluttered though, as I then often wind up with ten or more Vim windows open, sometimes with duplicates of the same file…

  • Searching
  • It should be quick and easy to find the information that I need, be it the location of a particular function or the documentation of an interface.

    This is a bit of a weak spot in my current environment, as the best I can do is a recursive ‘grep’ on the source tree.

  • Building
  • Changing code doesn’t do much good if I can’t actually produce a program from it…

    We already have a build system in place though, launched from Cygwin shell scripts, so any IDE would have to be able to account for that. Right now I just keep a ‘bash’ shell open and launch the build from there.

  • Checking
  • After making changes, I need to be able to check and ensure that the modules still compile, see what warnings come up, and get a PC-Lint report.

    All of the build output goes into a log file, so I just keep a Vim window with that file open and reload it after each build. And, to get lint reports, I have a custom tool defined in Perforce that shows up as a context menu item, so I can right-click on a file, select ‘lint’, and it’ll run lint on it and show me the report in a new Vim window. Some kludgy scripting was necessary here though, in order to assemble the appropriate parameters to lint, and batch files alone couldn’t handle it.

So, how do other environments compare?

Eclipse

Eclipse was originally developed as a Java IDE, but it’s grown into a fairly multi-purpose platform and there is some degree of C/C++ support as well, through plugins.

One of its main features is that you can easily shift between different ‘perspectives’ in order to see different sets of information. There’s never enough screen space to show absolutely everything at the same time, so instead you have a perspective that’s appropriate for editing files, one for browsing the type tree, one for managing project resources, and so on.

The type tree browser is rather nifty. From a project, you can browse the namespaces in that project, the types available within the namespace (including classes, structs, typedefs, etc.), and then see the members within a particular type, with each level displayed in its own little window so you can still see its neighbours. From the member, you can then jump to its declaration in the code. Very useful when you want to find a particular class but don’t know which source file it’s in, or just want to see what its members are, or want to jump to its header to look for documentation.

However, it doesn’t appear to be possible to jump to a member’s implementation, which I often want to do. I also had the type tree completely vanish a few times, and had to restart Eclipse to get it to reappear.

There are various miscellaneous little niceties as well. You can quickly define a new class and it will automatically create the source and header file and fill it with skeleton code. The search is language-aware, so you can search only for say a function containing a particular string, for example, instead of a plain text search against everything and picking up spurious matches. You can ‘refactor’ a name (i.e., rename a class, member, function, etc.) and it will automatically update all uses of it, more reliably than a global search-and-replace would.

There’s some context-sensitive information you can get while coding. Hovering the cursor over a type or function name gets you its declaration or prototype, and while typing, Ctrl-Space will attempt to complete your current word. This seems to be limited to types within the current module though, and that same information and completion doesn’t seem to be available for things like member variables and functions as well, which would be far more useful.

Getting it to work with an existing project is a bit of a pain, too. Starting with an existing body of code from our source control system, I can import that code, but that then puts it into a parallel source tree. I don’t want to have to keep reimporting the tree and exporting my changes, but there isn’t an obvious way to make it use the same tree. There’s a plugin module for the source control system, but I can’t seem to get it configured properly, and I’m not sure it’ll do what I want anyway.

Overall, it looks nice, but it’s a bit too quirky for my needs and still a bit lacking in the C/C++ support. Maybe if I ever have to work on any Java modules, though…

Visual Studio .NET 2003

We’re using Visual Studio anyway for our Windows compiles and as a debugger, so it wouldn’t be much of a stretch to use it for the rest of the tasks, too.

Its major draw for most people is its ‘Intellisense’ feature, where it will bring up a small popup window with suggested completions, or the rest of the prototype of the function you’re calling, which is handy when you can’t quite remember what types of parameters it takes and in what order. Very handy.

It also has a class browser, and although I think the interface is a bit clunkier than Eclipse’s, it also includes things Eclipse’s doesn’t, like macros and constants, and can jump to the implementation of a member.

I was also able to integrate in the lint reports fairly easily, defining it as an external tool. The only thing I don’t like here is that I have to run it from a menubar instead of a right-click context menu on the file itself.

But, it’s not perfect. I’ve managed to get it to hang or crash a few times already. Manually updating the projects to reflect changes in the source control system is annoying. Its editor doesn’t quite do as good a job at syntax highlighting. Although the window layouts are flexible, I still find it either taking up too much room in total and obscuring everything else or leaving too little room for things like the file and class browsers. It integrates with Perforce, but the interface within the IDE isn’t nearly as nice as the standalone GUI. And perhaps most importantly, it’s not portable. When I start working on the code on some other platform, I’ll need a different solution then anyways, so I may as well come up with a single solution that works on most platforms than have to maintain multiple different environments.

These are largely first impressions though, and other faults may not surface until later, and other problems may resolve themselves with experience, but I’m not sure I have the time or patience to completely revamp my environment and retrain myself without there being a clear, compelling reason. For now though, I think I’ll just stick with my hodge-podge solution. It may be inelegant, but it gets the job done. It certainly could be improved, but that’s another article.

(Ugh, I know this article is a chaotic mess, but I need to get back to actually coding, not writing about how I’m thinking about how I’ll do my coding…)

Leave a Reply

Your email address will not be published. Required fields are marked *