views:

1551

answers:

6

I think Xcode is a good IDE, but having used Eclipse for Java development in the past I am quite underwhelmed by XCode's code completion and error/warning feedback. (Most of the time, XCode seems to simply try to match the beginning of a text fragment to "words" in the same document, without even using type information to try to determine the appropriateness of a suggested completion.)

Does anyone have ideas or tricks to make XCode approach Eclipse's cleverness, or to realistically develop Cocoa apps with other IDE:s than XCode?

EDIT: Worth keeping an eye on this: code.google.com/p/objectiveclipse/

A: 

emacs and/or vim

samoz
and/or TextMate and/or KDevelop or [someone's favorite editor]. Yeah... but how about motivating the suggested use of a particular editor/IDE?
Felixyz
I would *love* to see and emacs/vim enthusiast back up such claims. There is no code (true) completion, let alone predictive compilation. Text editors are only considered to be IDEs by people who think GUIs are a fad that will eventually die off. KDevelop is actually an IDE (for KDE), but it barely supports Objective-C, let alone advanced compilation features.
Quinn Taylor
@Quinn I'd like to have you go head to head with an emacs/vim expert (not me) with their flood of keyboard shortcuts, macros, and plugins. Assuming each knew what they were doing programming wise, I'm confident the emacs/vim expert would be able to code circles around a typical IDE what with its mouse clicking. :-PThough on the other hand, I do enjoy Firefox as a replacement for lynx.
samoz
@samoz I wasn't making any assertions about programmer efficiency with/without and IDE (those studies have already been done), just pointing out that vim and emacs are *not* IDEs, which is what the question author was asking for. If you've used Xcode, you should know that it supports extremely flexible key binding and scripts, and the best Xcode coders I know do very little mouse clicking. When they do, it's usually for project build configuration, and I'd bet that's faster than tweaking a makefile in vim/emacs.
Quinn Taylor
@samoz: I use Xcode and I don't spend the bulk of my time clicking the mouse. I spend the bulk of my time thinking.
Nosredna
I use Emacs from time to time, but not as a primary editor (anymore). However I have to disagree you could not use it as an IDE - you can compile using XCodeBuild (instead of Make). You can also debug in place, and get a form of code compeltion with ctags (to be honest not sure if that supports objective-C calls though).
Kendall Helmstetter Gelner
+2  A: 

I have certainly felt your pain — as an experienced Java developer and frequent Eclipse user, I've wished for the same features myself. Unfortunately, I'm not aware of anything that fits the bill. I don't think there was any satisfactory resolution to this SO question, either.

However, I think you'll be quite happy with the improvements to Xcode code completion coming in Snow Leopard — it's vastly smarter about filtering the list of possible completions. Also, there are new conveniences for coding, such as inserting a starting bracket when you forgot one, etc. To my knowledge, there is still no predictive compiling like Eclipse, though.

Is anyone aware of an IDE other than Eclipse that supports predictive compiling and warning/error reporting? Does Eclipse itself support the feature for languages other than Java, such as C++? I'm led to wonder whether the fact that Java is built with independent .java files rather than .h and .c/.cpp/.m files makes it simpler to predictively compile. Also, anything compiled with gcc requires a little more care and attention than the comparatively simpler javac command. Any thoughts?

Quinn Taylor
XCode does predictive compiling to improve build performance. It just doesn't make very good use the information it gleans. I don't believe there's any particular care required for gcc compilation beyond javac. Each .o is independently compiled, so there's nothing special going on during predictive compilation.
Rob Napier
I was also thinking about whether there would be anything to make Java inherently more easy to do predictive compiling for than, say, Objective-C, but can't really think of anything (except, of course, for dynamic ObjC code which forfeits type safety). As Ahruman suggested, reading about Clang provides more context.
Felixyz
Very true. Xcode already generates the gcc commands, anyway. It appears that part of the problem is gcc itself — it's under GPL, which restricts Apple from integrating it truly seamlessly without making Xcode open-source itself. Dynamic typing wouldn't even cause a problem, because what you really care about is correctness in the context of Objective-C, not what would be correct in Java or any other language. I think that as Clang goes mainstream and eventually replaces gcc in Xcode, we'll see features like these appear. (Hoping for that day...)
Quinn Taylor
+3  A: 

Quite simply: no.

You can do almost everything by hand using your favorite text editor but it's not at all recommended. Try designing interfaces without Interface Builder for example.

My advice would be to just stick with Xcode and learn its way of doing things. Yes, it will be different and sometimes might not be "better" in your Eclipsed eyes. Console yourself in the fact that Apple's managed to release some great products using Xcode.

My personal experience is that, each time I use Xcode, I find a new trick which I can add to my bag. Xcode is far more full-featured than what you might think at first (or second) glance.

rein
I've noticed that features have been added steadily as the years go by. There are still features in Eclipse, VisualStudio, etc. that I'm jealous of, and I hope to see them in Xcode (hopefully sooner rather than later). That said, there are also areas in which Xcode blows away other IDEs. Eclipse's Achilles' heel is probably creating and managing projects and workspaces, it is an incredible hog of screen real estate, and the plugins are often out of control. I haven't used VS regularly enough to pick on details, but solution/project config was certainly confusing when I did use it.
Quinn Taylor
I agree about Eclipse: whenever I've tried to use anything beyond the core capabilities, I've ended up frustrated. Like Aptana's RadRails... That was a nightmare. I've even had problems getting the SCM intergration working properly in Eclipse. But where it shines, it certainly sets a standard.
Felixyz
I once tried to install Eclipse and use it for Ruby on Rails development. Never, ever again. It was a complete nightmare and I wasted many days of my life trying to get it working. It was slow, cumbersome, looked horrible and the plugins were awful to setup.
John Gallagher
+5  A: 

The good news is, Apple’s working on the problem. One of the goals of the clang compiler project is to create a reusable parser which can be used for better code completion and refactoring support. Indications are that this has borne fruit in the latest Snow Leopard seeds.

Ahruman
Clang is a beautiful, beautiful thing. The Compilers section at WWDC nearly brought some of us to tears. Or at least a lot of applause.
Rob Napier
Ah, yes. I have read about clang, but forgotten it. For people who are interested, there is a bit of interesting background here:http://etoileos.com/news/archive/2009/03/31/1640/This is also an indication that non-Apple Objective-C/NS-derived coding is alive and kicking. This has been discussed elsewhere on SO:http://stackoverflow.com/questions/874690/is-objective-c-only-used-for-development-on-mac-os-iphone
Felixyz
Apple's goals for LLVM and Clang (some of them longer-term) include completely replacing GCC for almost all cases. The modular design allows for pluggable front ends (of which Clang is one) and decouples parsing from optimization and code generation completely. It's great to see the momentum, and the fact that it's all open source is even better.
Quinn Taylor
For those who crave some quick and easy clang goodness right now, check out: www.karppinen.fi/analysistool . Highly recommended!
Felixyz
Or if you have Snow Leopard, just use "Build and Analyze"...
Kendall Helmstetter Gelner
+2  A: 

I've long voiced my rants about what's wrong with Xcode (and what's not wrong with Xcode). But you really don't want to use another tool. And without breaking NDA: Xcode 3.2 with SnowLeopard: Hooray. (Compared to what we have; not compared to what we might want.)

That said, to your original question about code completion, I personally turn off auto-completion in favor of on-demand completion. I find it far more useful and less distracting. In the Code Sense panel, set "Automatically Suggest" to "Never" and make sure the other two options are selected ("Show arguments in pop-up list" and "Insert argument placeholders...") This will do completion in a pop-up box when you hit Escape, making it easy to scroll through looking for what you want. I find that I have to type a lot less this way, especially for methods that are not unique for many characters. 80% of the time, it's highlighting the right thing already.

Rob Napier
A: 

Xcode does have some context awareness, when you are sending a message to an object it will generally have the "ESC" list pull up meaningful arguments.

One thing I strongly recommend is looking into text macros. These are not really type aware, but they can save a ton of typing - for instance, after @implementation type "init" and then hit control-. (period) to activate the text macro. It will fill out a whole init method for you. You can create your own, or override the existing macros.

Kendall Helmstetter Gelner