or Connect
AppleInsider › Forums › Software › Mac Software › Inside Apple's new Xcode 4 development tool
New Posts  All Forums:Forum Nav:

Inside Apple's new Xcode 4 development tool

post #1 of 96
Thread Starter 
At WWDC, Apple treated its Mac OS X and iOS programmers to a preview of its entirely revised Xcode 4 integrated development environment. Here's a look at what's new and how it matters for end users.

Xcode 4 presents an entirely new user interface and workflow for developers, along with new components for compiling, debugging and finding and correcting common errors. The result: better, faster code from more productive developers.

One window to bind them all

The first major feature of Xcode 4, according to developers familiar with Apple's plans, is the shift from the multiple window workflow that Xcode (and its predecessor, NeXT's Project Builder) currently uses to a new single window interface.

Rather than spawning new windows to search code, debug, build, and set parameters, everything can be done within a single window that echoes components of the design of iTunes, including a LCD-like status display.

The new window presents a dismissible Navigator control (akin to iTunes' Source List), with icon tabs that can present a variety of different types of development-related information within the same window column:

a listing of projects and files
a symbol listing of classes and methods
a search feature that lists project-wide results
an issues listing of build errors
debugging information
breakpoints
a listing of build logs

The main area of the new Xcode windows is devoted to the document being viewed, whether code, a data model, or the project's graphical interface. This area can also be segmented to view multiple documents, presenting a comparison of their differences (such as for comparing two versions of the same code file). The content area also integrates support for viewing PDFs and other file types supported by the extendable Quick Look feature.

Above the content area is a new Jump Bar, which presents a hierarchical "breadcrumb" listing similar to the Path Bar introduced in iTunes and the Finder. The difference is that the new Jump Bar is fully interactive; users can click on any path along the bar and select a popup that allows them to navigate at that level. For example, in the photo below, a user can click on Resources within the Jump Bar to view (and directly jump) to other resource files within that directory via a dynamic popup window that is displayed.



On page 2 of 3: Now including Interface Builder.

Now including Interface Builder

Apple's Xcode Mac OS X developer tools, adapted alongside the iPhone 2.0 SDK to also create iOS mobile apps, originally included Project Builder for working with code and Interface Builder for laying out a program's graphical user interface and mapping elements of the GUI to the code that made it functional.

Back in the late 80s, the original developer of Interface Builder, Jean-Marie Hullot, showed the graphical development concept to Apple but was wooed away to Steve Jobs' NeXT Computer, which made the advanced GUI builder part of its development tools.

Interface Builder was used to rapidly develop Tim Berners-Lee's WorldWideWeb browser at CERN. Apple later acquired the technology when it bought NeXT in 1996, making it part of the Mac OS X development tool package with Project Builder, which the company has since renamed Xcode.

In Xcode 4, Interface Builder is folded into the revamped Project Builder-based IDE to create a single tool for creating both the appearance and the functionality of applications. The deep integration between the two components provides a variety of improvements in developing mobile and desktop applications.

Graphical elements can now bind their outlets and actions right into source code using a graphical drag and drop gesture. A new Assistant feature in Xcode 4 allows developers to work on the GUI and source code at the same time (below).



On page 3 of 3: Fixit, LLVM, LLDB, Instruments.

The Fixit feature

Developers report Apple has also introduced a new Fixit feature that provides advanced code completion and flags common bugs or typos using the same red underlining that Mac OS X uses system wide to indicate spelling errors.

The Fixit feature can suggest appropriate symbol spellings and supply correct punctuation, assisting developers to write code faster while making fewer mistakes. A static analysis can find and flag common bugs and errors such as a failure to properly release memory that is no longer needed.

Xcode 4 is also reported to support new version control features for collaborative development, enabling coders to checkout, commit changes and update content in projects stored on Subversion and Git version control systems (which work with multiple versions of files over time, like Time Machine).

New tools also allow users to compare different files for changes over time that have been checked into a version control system and revert or merge code into the latest version.



Apple shares new LLDB debugger as open source with LLVM

Xcode 4 is also reported to include a significant new version of the modern Low Level Virtual Machine (LLVM) Compiler, which Apple has been supporting as an open source project to eventually replace GNU Compiler Collection (GCC), the tool most Unix-based development systems use to convert source code to executable object code targeted to a specific processor.

LLVM is a modular compiler system designed to create faster, more optimized code. The new LLVM Compiler 2 now supports C++ in addition to the C and Objective C languages, and compiles code up to twice as fast as GCC. The code it creates also runs faster than code compiled with GCC, with Mac OS X code reportedly running up to 25% faster and iOS code running as much as 60% faster, just through improvements made in optimizing the compilation of the same source code.

Also within Xcode 4 is an entirely new debugger system Apple designed for performance and efficiency, resulting in faster finding and fixing of bugs. The new debugger is modeled after LLVM's modular architecture, and is therefore named LLDB. Apple is also said to be releasing its internal LLDB project as open source, and will make it available to third parties alongside the open source LLVM compiler.

Playing new Instruments

Another major feature delivered alongside Xcode 4 will be a new version of Instruments (originally code named Xray), Apple's graphical tool for code performance profiling based on Sun's DTrace technology.

The new Instruments adds new time profiler support for iOS development, and includes new features that help developers examine how their application code interacts with other apps and the system's kernel, in order to find where apps are spending their processing time and allocating their resources in a very complex computing environment.

Instruments is also said to include support for identifying abandoned memory that has been referenced but not actually needed, enabling developers to reduce the memory footprint their apps demand. The tool will also add profiling analysis support for OpenGL ES, an important tool for iOS developers building high performance games and other apps that make use of sophisticated graphics.
post #2 of 96
"Developers report..."

Yeah, you could at least credit Apple's development videos for all the info here that you are publishing.
post #3 of 96
Looks like a great IDE. Having been a MS Visual Studio developer for over a decade I can appreciate the single window IDE. However, hearing how others used the multi-window IDE with spaces it seems so people won't like the change.

I'll give Xcode a try for myself when this new version is fully released. I have a few ideas I'd like to pursue for iOS apps.
post #4 of 96
Any information regarding release date?
post #5 of 96
Even in the current released version there is a "all in one" mode.

when can we get that new version? any word on that?
post #6 of 96
I'm currently watching the dev videos.

Quote:
The deep integration between the two components provides a variety of improvements in developing mobile and desktop apps, as graphical elements can now bind their outlets and actions right into source code using a graphical drag and drop gesture. A new Assistant feature in Xcode 4 allows developers to work on the GUI and source code at the same time.

I love the fact when designing the GUI, while in splitview, you can literally drag a line from a Button or a Slider to the source code on the right-side and inserts binding code on the fly.

Quote:
The Fixit feature can suggest appropriate symbol spellings and supply correct punctuation, assisting developers to write code faster while making fewer mistakes.

Fix-it's spellcheck feature is awesome. It alerts you if you typed a class name that doesn't exist and it even suggests a list of possible corrections before you even compile.

Also in split-view, selecting the implementation classes on the left side for editing/viewing automatically displays the interfacing classes on the right while you navigate in the Jump Bar.

I noticed Xcode 4 does have some resemblance to iTunes with that stop and playback buttons along with the new status bar at the top.

Quote:
New tools also allow users to compare different files for changes over time that have been checked into a version control system and revert or merge code into the latest version.

Its called the Blame tool.
post #7 of 96
Just as I'm trying to learn the Xcode 3, they change it again? Is there a good reference for Xcode 4 anywhere?
post #8 of 96
This single-window stuff and version control looks good. I'm not a developer though, I just dreamt last night I went to Perth (Australia) to do my Masters degree in iOS development. Weird, huh.
post #9 of 96
"I'm not an iOS developer, I just play one on TV..."
post #10 of 96
Now the XCode editor finally catches up to Visual Studio, Eclipse, and Netbeans. The code completion and debugging was inferior to those IDEs. Now Apple is applying a formula that works, which is the single window view of the other IDEs.

Still, they managed to also come up with at least one brand-new idea. The code and GUI side-by-side view is something I haven't seen, but is a fantastic idea.
post #11 of 96
So now we'll have another 500,000 apps to choose from since Xcode 4 development is so easy? Hmm, "there's an app for that" could become "well, there's 4,000 apps for that, good luck wading through them all".
post #12 of 96
Quote:
Originally Posted by richwiss View Post

Just as I'm trying to learn the Xcode 3, they change it again? Is there a good reference for Xcode 4 anywhere?

I've been working on an app for a whole year+! Over a year! Am I just stupid or is this stuff difficult... (don't answer that!)

Proud AAPL stock owner.

 

GOA

 

Get the lowdown on the coming collapse:  http://www.cbo.gov/publication/45010

Reply

Proud AAPL stock owner.

 

GOA

 

Get the lowdown on the coming collapse:  http://www.cbo.gov/publication/45010

Reply
post #13 of 96
Quote:
Originally Posted by JavaCowboy View Post

Now the XCode editor finally catches up to Visual Studio, Eclipse, and Netbeans. The code completion and debugging was inferior to those IDEs. Now Apple is applying a formula that works, which is the single window view of the other IDEs.

Still, they managed to also come up with at least one brand-new idea. The code and GUI side-by-side view is something I haven't seen, but is a fantastic idea.

I HATE single window view mode in XCode. I almost broke my laptop keyboard back when XCode was morphing to single-window-mode (so it was the only mode you could use) back in the original XCode 1.0/2.0 days [yes, I was actually pounding it in frustration. I wound up buying an external keyboard just so I would stop hitting my laptop]. Now, it has an 'all-in-one' mode, but you can change to a separate-window-for-everything mode, which I find works much better [except of course, when debugging, when I wish it would use the old CodeWarrior behaviour of hiding all the 'edit' windows leaving only the debugging related windows visible.

Invariably, I find that single-window-mode apps always need to be adjusted. The list of files in the project needs to be wide enough so you can see all the filenames, even when they are long and indented, but it's a total waste of screen space when you're actually editing a file.

Even the debugger window layout in XCode sucks right now, because variables, stack and current PC are all stuffed in one window. In particular, the variable display likes to be wide, to be able to display the actual variable name and value, while the stack display doesn't have to be that wide/tall. I find I constantly have to adjust the relative size of the three things to view what's important at any given instant, then readjust it when different part gains in importance. If they were separate windows, I would rarely need to resize the windows, just switch which one was in front.

And yes, it also pisses me off that radar entries about it get marked as 'duplicate' and seem to get sent to /dev/null.
post #14 of 96
Quote:
Originally Posted by AppleInsider View Post


LLVM is a modular compiler system designed to create faster, more optimized code. The new LLVM Compiler 2 now supports C++ in addition to the C and Objective C languages, and compiles code up to twice as fast as GCC. The code it creates also runs faster than code compiled with GCC, with Mac OS X code reportedly running up to 25% faster and iOS code running as much as 60% faster, just through improvements made in optimizing the compilation of the same source code.

I have often wondered if LLVM is being utilized now by Apple and third parties to generate code for distribution. Or does GCC remain the workhorse? Does anyone know?

Edit: substitute 'binaries' for 'code'

Nullis in verba -- "on the word of no one"

 

 

 

Reply

Nullis in verba -- "on the word of no one"

 

 

 

Reply
post #15 of 96
As iOS is somewhat related to development on the iPhone family of devices. I thought this article about it might be of interest:

http://www.tipb.com/2010/06/14/ios-4-walkthrough/
post #16 of 96
Time Machine is based on Subversion? Is there any source for this? I checked Google and the only thing I could find was some guy in 2006 speculating that it uses Subversion.
post #17 of 96
Quote:
Originally Posted by JavaCowboy View Post

Still, they managed to also come up with at least one brand-new idea. The code and GUI side-by-side view is something I haven't seen, but is a fantastic idea.

Any GUI editor in Eclipse can do that in a split-pane like view, it's not new at all.
post #18 of 96
The code editor in XCode has always been fine, except that autocomplete doesn't work like you'd expect (hint: Bash, Eclipse and Visual Studio all use TAB).

The confusing part has always been the build system. It doesn't use the standard concepts/terminology. For example it refers to a build script as a "target." Which is a little too nouny for a processy thing. Supposedly they have the term "scheme" is the new version, which sounds like another confusing reinvention of something that should be simple.

And don't get me started on the search and replace. A hundred options no one cares about.

And the preferences window - so ugly.

The whole thing is just a dog's breakfast of confusing terminology, non-intuitive GUI, and useless reinvention. There would be twice as many apps on the app store with a better IDE.

But enough of this meanness, I have an episode of Doctor Who to watch.
post #19 of 96
Quote:
Originally Posted by Synotic View Post

Time Machine is based on Subversion? Is there any source for this? I checked Google and the only thing I could find was some guy in 2006 speculating that it uses Subversion.

I don't believe it uses subversion at all. Time Machine is using the hardlink feature of the HFS+ to provide backups and ref counts of a file unchanged, and save a real copy of the whole file if the file has been changed.

http://en.wikipedia.org/wiki/Time_Ma...pple_software)
post #20 of 96
I wish XCode copy Delphi interface
post #21 of 96
Those yellow folders remind me of another operating system
I'm no programmer, but it looks like a healthy update to me.
post #22 of 96
do apple use Xcode to write their own apps? (OS X, iOS, Windows)
post #23 of 96
Quote:
Originally Posted by SpamSandwich View Post

I've been working on an app for a whole year+! Over a year! Am I just stupid or is this stuff difficult... (don't answer that!)

Could be. But stupidity is chronic only as long as you don't discover the simple parts you thought you knew but didn't. It only SEEMS difficult as long as there are one or more of those undiscovered (on your part) concepts you don't fully understand.

Daniel Swanson

Reply

Daniel Swanson

Reply
post #24 of 96
Is there a bit missing in the article about how it relates to end users? Interesting article nonetheless.
post #25 of 96
Quote:
Originally Posted by aucl View Post

Even in the current released version there is a "all in one" mode.

No there is not. Xcode has a single window view for itself, but that doesn't to the totally separate "Interface Builder".
post #26 of 96
Quote:
Originally Posted by Synotic View Post

Time Machine is based on Subversion? Is there any source for this? I checked Google and the only thing I could find was some guy in 2006 speculating that it uses Subversion.

Don't worry, this is NOT the case. Seeing as subversion is really for dealing with plain-text.
post #27 of 96
Quote:
Originally Posted by djsherly View Post

Is there a bit missing in the article about how it relates to end users? Interesting article nonetheless.

Seeing as how the "end users" of Xcode are going to be developers it relates entirely to them.
post #28 of 96
First, I've always used the all-in-one view. Not all that new.
IB built into Xcode? Well it's about damn time it was rolled in.
Never liked the old instruments, so any change is for the better IMHO.
I use Subversion now and it works transparently and perfectly.

I can't wait to try it out, but not until I've done the next release...

Sent from my iPhone Simulator

Reply

Sent from my iPhone Simulator

Reply
post #29 of 96
Quote:
Originally Posted by melgross View Post

As iOS is somewhat related to development on the iPhone family of devices. I thought this article about it might be of interest:

http://www.tipb.com/2010/06/14/ios-4-walkthrough/

Superb link. Thanks.
post #30 of 96
Quote:
Originally Posted by tawilson View Post

Seeing as how the "end users" of Xcode are going to be developers it relates entirely to them.

Ah, silly me. Here I was thinking the end-user was the chump who buys the apps.
post #31 of 96
Will there finally be support for python scripts and debugging in xcode?
post #32 of 96
Quote:
Originally Posted by djsherly View Post

Ah, silly me. Here I was thinking the end-user was the chump who buys the apps.

I'm not sure if your comment is sincere, but the end user for a product relates to those who are its customers, not how the product can produce other products for other customers.
Dick Applebaum on whether the iPad is a personal computer: "BTW, I am posting this from my iPad pc while sitting on the throne... personal enough for you?"
Reply
Dick Applebaum on whether the iPad is a personal computer: "BTW, I am posting this from my iPad pc while sitting on the throne... personal enough for you?"
Reply
post #33 of 96
Quote:
Originally Posted by solipsism View Post

I'm not sure if your comment is sincere, but the end user for a product relates to those who are its customers, not how the product can produce other products for other customers.

No. I was being sincere. As a developer I just had stuck in my mindset my own end-users. I don't think it's a stretch to interpret the opening paragraph in such a way.
post #34 of 96
Quote:
Originally Posted by djsherly View Post

No. I was being sincere. As a developer I just had stuck in my mindset my own end-users. I don't think it's a stretch to interpret the opening paragraph in such a way.

Yeah, it's technically accurate, but I think changing "end users" to "developers" would make it more clear.
Dick Applebaum on whether the iPad is a personal computer: "BTW, I am posting this from my iPad pc while sitting on the throne... personal enough for you?"
Reply
Dick Applebaum on whether the iPad is a personal computer: "BTW, I am posting this from my iPad pc while sitting on the throne... personal enough for you?"
Reply
post #35 of 96
Quote:
Originally Posted by leafy View Post

Any GUI editor in Eclipse can do that in a split-pane like view, it's not new at all.

They are doing something slightly different in Xcode 4, it looks like a traditional split pane view, but doesn't behave like one. Anyway, watch the videos.


Quote:
Originally Posted by Joe hs View Post

do apple use Xcode to write their own apps? (OS X, iOS, Windows)

Yes for OS X and iOS (and they have done for years and years). No idea about Windows dev.
post #36 of 96
Xcode 4 is a HUGE update and has probably been long in development. Yes, everything has been unified into a single window, but it looks like Apple has really put key focus on navigating your project files and getting the info you need as easily as possible or automatically. I really can't wait to get my hands on it!

According to one of the developer videos LLVM compiled code executes significantly faster than GCC so for the person who asked, Xcode 4 highlighting, code completion, etc is all run by LLVM.
post #37 of 96
I'm not sure if these lines conflict with the NDA and I don't have much first hand experience yet.

Here my first impressions.

RAD is a double-edged sword. You are fast in initially creating major parts of our project, but you often have to spend much more time in refining it and eliminating bugs or performance issues. So RAD mainly addresses the initial project phases while pointing you to other mechanisms and tools when leaving the draft-phase.

Of course there are some welcome RAD features that help to create, edit, modify and review your code, but the biggest difference is that all code serves as "knowledge", as base for the following project-phases.

For every phase there is an optimized integration of tools for debugging, unit testing, performance and memory optimization (leaks), revision control, deployment etc. managed by seamless workflow integration.

This reminds me of best-practice phase based rapid prototyping in the automotive industry.

So it's not just better code-completion. The LLVM compiler and LLDB debugger are integrated in the process and are providing their information.
Because the compiler knows what is allocated, code-completion can not only suggest what's possible but that what's useful. If the object You want to use doesn't show up, you haven't implemented it properly.

Because the compiler knows what's going on and "telling" it to the debugger and other tools you get much more detailed information e.g. about the behavior of parallel threads, memory consumption etc.

I think the additional tools can do a much better and better integrated job while the new IDE provides a "live" code and project state, pointing to known problems and providing the tools in place to resolve them.

Coming from other IDE's I welcome the adjustments on XCode 4.
I don't think it's so much about replicating others features but those features are the result of a new approach on optimization the complete development, production and deployment cycles while LLVM representing the foundation.
post #38 of 96
Quote:
Originally Posted by JustReelFilms View Post

I'm currently watching the dev videos.

Where are the videos located?
post #39 of 96
Quote:
Originally Posted by SpamSandwich View Post

I've been working on an app for a whole year+! Over a year! Am I just stupid or is this stuff difficult... (don't answer that!)

Probably neither.

You just aren't experienced with programming (or with that kind of programming).

You can make simple fart apps in a day (or a couple or hours) and you can make a full-featured but limited in scope app in half a year (say, a twitter client like Twitterific).

But there are also complicated apps that require many man-years (that is, a team of programmers) to complete. E.g. you can't just make a full-blown 3D game to compete with EA by yourself (except if you are John Carmack).
post #40 of 96
Quote:
Originally Posted by ascii View Post

The code editor in XCode has always been fine, except that autocomplete doesn't work like you'd expect (hint: Bash, Eclipse and Visual Studio all use TAB).

Hint: no, it's not the keybinding for the autocomplete.

It's the selection, presentation and ordering or possible completions that lacks in XCode.

Quote:
Originally Posted by ascii View Post

The confusing part has always been the build system. It doesn't use the standard concepts/terminology. For example it refers to a build script as a "target." Which is a little too nouny for a processy thing.

Builds have been called "Build targets" since, I dunno, the seventies...

Quote:
Originally Posted by ascii View Post

And don't get me started on the search and replace. A hundred options no one cares about.

Oh, trust us, we do.

So, to recap, your gripes with a full blown IDE are:

1) does not use the keybinding you'd like for autocompletion.

2) Calls "builds" "targets".

3) Too many search and replace options.

4) Ugly preferences Window (ever seen Eclipse or NetBeans preference window?).

It must be a hell of a great program then, or you judge way too superficially.
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Mac Software
AppleInsider › Forums › Software › Mac Software › Inside Apple's new Xcode 4 development tool