Help! My IDE is full of compile errors!

Sunday, December 6th, 2009 | Software Development

I was working on some code just now, in a project I don’t normally work on. It turns out I need to make some changes there, and once I’m done, I won’t need to work on that project anymore. This is a common enough thing for engineers, I’m guessing.

So I loaded up the code in my IDE so I could start making sense of it. I followed some instructions provided by the project team, as far as what to check out from version control, and then I used the plugin in my IDE that deals with the build system, hoping to setup my project correctly. And by correctly, there are a bunch of things I need to be happy and productive:

  • All the right code is displayed, including all the source roots and modules
  • All the needed dependencies are added as libraries, so the code compiles
  • If any special development kit is needed, like the right JVM, it’s added
  • Whatever plugins I’ve used when I worked on this project in the past should be installed and setup
  • If there are multiple modules/sub-projects, they are also added correctly, and depend on each other as source, not via their compiled jars
  • Source attached to all the binary dependencies, even third-party ones
  • All the transitive dependencies are downloaded to my machine
  • The right preferences are available, such as the Copyright block that should be pasted into new files, code style, import order, etc.
  • If there are any special arguments needed to launch the program or the tests, those are added in my Run Configurations.
  • Whenever I change any of these things, other people on my team have their IDE , and when they make changes, my IDE setup is updated

When you really get serious about your IDE being set up correctly, the state of your IDE becomes valuable. You really don’t want your setup to get borked, or to start over on a new machine, because it takes you a while to get through all these items at the various point they show up. Some of them never get set up right, like all the code formatting preferences, and we just slog through it with a partially-configured IDE.

This valuable state isn’t committed to the version control system, at least typically, because much of the information is duplicated from the files used by the build system to compile and test the program. That part of the IDE setup should be created or synced by some tool associated with our build system. But the rest of the settings are up to us; the build system doesn’t care about them, since it has a read-only view of the sources.

Why is this a big deal? When you’re working on a very large, modular, corporate codebase, you only have a nice, happy IDE configuration for the part of the project you work on regularly. You’re willing to put in that ramp-up effort on one machine, for that one module or subset of the code, and only for one version of the IDE, etc. You hope it’s only once. But what if you pair with other members of the team, their setup might suck, or if you’re trying out a new version of the IDE, or have the project setup on a home computer and a laptop as well as your work machine, or (and this is the real stretch), if you’re doing a code review and want to browse the proposed changes in your IDE, maybe experimenting with some suggested improvements and running tests? These are all times when you have to work in an IDE-not-happy state.

As much as I appreciate that we all have different preferences for our IDE, and that we take our position very strongly, I think that’s the major contributor to this problem. If we had a true standard for project metadata, which allowed for the entire spectrum of metadata I bulleted earlier, and worked with both the build system and the IDE, then all the tools would work fine. But not all the tools cover the whole feature set – if the copyright on our project changes, IDEA 8+ users want their metadata to reflect that, but no one else has a box in the IDE to update. And we don’t want to go monkey with that project metadata by hand, since in most IDE’s and build tools, it’s not very friendly. (Unless you’ve got a nice XPath/XQuery library in your head)

What’s the answer to this problem? Sadly, we have two impossible tasks: pick a build system and an IDE that we’ll make everyone use, and get that build system and that IDE to share their metadata, either by using the same location for it, or at least syncing everything correctly. I personally believe that if we really solved this, any coder who knows how to use an IDE well would appreciate the convenience of complete and correct metadata so much that it would be a ‘killer feature’, and they’d drop their IDE. Crazy talk, yes. But I think there’s more we can fix once we go down this path, which I’ll write about next time.

Tags:

2 Comments to Help! My IDE is full of compile errors!

redsolo
December 9, 2009

Maven has a nice plugin to create IDE project files for the current module. With it you can sit with IDEA or Eclipse. Not that I suggest that anyone should sit with different IDEs, but it is possible. The maven plugin will also set up all dependencies, so the project is ready to be used from start.

Also I think maven is a nice build system as it standardizes common things, like where to put source, test source, resources, etc. It also has a set build process, which is similar in most maven projects.

Alex Eagle
December 10, 2009

Maven is certainly the closest option right now, but although I use maven on some projects, it only helps with a subset of the problem. The POM only includes the required metadata to build the software, not to run it. If there are some command line flags needed to run a main, or a certain working directory needed to run some tests, or what JVM to associate in my IDE, there’s nowhere in the POM to put it. It also doesn’t know about settings needed to edit the sources, like what copyright statement needs to be on each file, or what order the imports need to be in.

Maybe someday, Maven wants to own the code editing and execution parts of this, and the POM could be extended. Then we would still have to wait for maven tooling in the IDE’s to adopt it.

Leave a comment

About Me

I'm Alex Eagle. I live in Sunnyvale, CA and I'm a code monkey.

eag...@captcha.me
LinkedIn.com/in/AlexEagle
Twitter.com/jakeherringbone

Add to Google Reader or Homepage

 Subscribe in a reader

Tweets

  • I played the ice hockey for the second time in about 8 years. I was about as good as ever, I guess. Which was fairly bad. 16 hrs ago
  • I finally jailbroke an iPhone. Now I feel like I have decent geek cred again. 2 days ago
  • Lost a bolt on my lower control arm. Found out about it when the wheel came partly off. http://twitgoo.com/fw9e0 3 days ago
  • Wow we have the craziest channel 1.6 on broadcast TV where I live, that runs this show: http://intensit.tv/ 5 days ago
  • Dorfmeister is playing Zurich the day after I leave. Worst! 6 days ago
  • 70 fresh, organic oranges from our tree were sitting on the table this morning. So, marmalade had to be canned. It's tasty! 6 days ago
  • Moles, cousins, and unattended baggage #10kpyramid 1 week ago
  • @mdauber You live in Sunnyvale too? And NBC is ruining your olympics also? We should get together. 1 week ago
  • More updates...

Powered by Twitter Tools

Podcasts I’m listening to