

Xcode 4 public preview - Single window, LLVM 2.0, streamlined editing - d_r
http://developer.apple.com/technologies/tools/whats-new.html

======
bonaldi
Notably missing feature: one that allows them to issue a point release to the
SDK without making you redownload 3gb of dev environment each time.

~~~
telemachos
I would go further. What I have always wanted is simple: a compiler. I believe
that the only way to get one on a Mac is from Apple itself, though I would be
happy to take a compiler from a third-party. I don't want to be a Mac dev or
an iPhone dev. I don't want their IDE. I want a compiler.

So far as I know, the _only_ way to get gcc (or any other compiler) initially
onto a Mac is by accepting the entire Xcode package. I'm posting this here
because you mentioned the 3GB download, which always makes me cringe. I'm
curious to see if anyone knows a better way. (I've had this conversation
online in a number of places in the last few years, but never received an
alternative.)

~~~
grinich
You can try navigating inside the main Developer Tools package and installing
the individual components (although they may not link properly).

I don't see any reason why you can't compilers. Here's the instructions for
Clang [1] and LLVM [2].

You can't really do a lot without the system headers and libraries, though,
which are installed via the Xcode Dev Tools.

[1] <http://clang-analyzer.llvm.org/installation.html> [2]
<http://llvm.darwinports.com/>

~~~
axman6
I'm not sure why you linked to the darwinports web site, it’s a domain
squatting site, not at all linked to the original darwinports project, and I
believe one of the reasons they changed the name. Even without this,
darwinports, not macports, have ever (really) supported binary installs, which
means you need a compiler (namely gcc) to get this LLVM package installed.

------
thought_alarm
I use XCode in "Condensed Mode": One source/header combo, one Window. And I
like it a lot.

I've never been a fan of single-window IDEs, going all the way back to Visual
C++ 6, and I don't think XCode 4 is going to be the one to change my mind. And
god damn it, all the keyboard shortcuts have changed! This is going to be
painful.

It's clear they've put a lot of work into it. It looks slick, and the
organization of the menu and commands is much more thoughtful. The biggest
problem with current version of XCode is that it's very difficult for
newcomers to learn, and this new version will go a long way to correct that.

But none of that matters to me. I can't touch this software until I'm forced
to use it, because when that happens I'm going to have to un-learn everything
I currently know, start from scratch, learn all new habits, etc. Can't say I'm
looking forward to it.

~~~
kenthorvath
There's a WWDC session on Xcode 4 - free on iTunes U for registered
developers. It might be worth a watch, as they will probably outline the most
significant changes, as well as indoctrinate you with the belief that these
changes are major improvements over the old way of doing things.

------
mishmash
Oh man been waiting for this since WWDC. IB integration took way too long.

I do have a question for the compiler geeks, though: how was LLVM able to so
quickly surpass GCC in both compiling source and binary performance,
considering gcc had a two decade head start?

~~~
megablast
I can't imagine anyone actualy using IB, at last for anything but the most
basic app. It just frustrates me no end, and I am pretty sure most people just
create all the elements programmatically.

~~~
megablast
I guess not.

~~~
mishmash
Not seeing the problem with IB here. I use it extensively for generic UI
elements, with custom views and windows, use it to target the FirstResponder,
use it to hook up actions, connect controllers, and to bind objects together -
all of things IB (and now Xcode 4) were made to handle.

I am curious as to what you don't like abou it?

~~~
sshumaker
Where should I begin?

\- It's incredibly brittle. Good luck if you need to make significant changes
to your hierarchy, or change that NSOutlineView of yours to an NSTableView.
You'll have to rebuild and re-hook up all of the connections on an object.
With no warnings or errors if anything is wrong. In HTML, you can just copy
and paste, change some tags, and make some adjustments. Now HTML isn't ideal
for application layout - but another markup language could be (MXML isn't
bad).

\- Doesn't play well with source control. Only one user can work on a .nib at
once. Just yesterday another programmer and I both made changes to UI. Of
course, it was completely unmergeable by machine or by hand - what do you
expect when you have GUI generating a 7000-line file for relatively simple UI.
So one of us had to re-do several hours of work. This isn't a problem with,
say, HTML.

\- Most significantly, it only solves a small part of the problem. It
completely falls down when you're dealing with dynamic / variable UI - you'll
have to resort to code anyway. And a lot of the layout you need to do is
actually inside cells - say, trying to build a source list like iTunes, or a
table view with icons inside of it. IB can't help here at all. Then, you end
up laying out the actual UI in code. And what code it is:

NSDivideRect(cellFrame, &imageFrame, &textFrame, ICON_INSET_HORIZ +
ICON_TEXT_SPACING + imageSize.width, NSMinXEdge); imageFrame.origin.x +=
ICON_INSET_HORIZ; imageFrame.size = imageSize;

    
    
    		textFrame.size.width -= ([self sizeOfBadge].width + ROW_RIGHT_MARGIN);
    

Are you serious? This is 2010. You should not need to be manually calculating
the positions of UI elements. There should be a layout language. HTML, MXML,
whatever.

IB encourages you to use a very low level of abstraction. There's a lot of
repetition, and the closed nature of the tool means it's very difficult to
build up higher levels of abstraction. But then again, I guess Objective-C
loves loves making programmers repeat themselves.

There's a reason most professionals don't use dreamweaver to make websites,
either. And they are much the same.

------
liedra
I'm pretty new to Mac OS X programming (coming from a very hobbyist
cmdline/web app python background) so using an IDE has been pretty weird for
me. I found the disconnect between IB and XCode the most difficult thing about
it, it's like there was another layer of programming you couldn't see
immediately (the connections) which made it harder to slip back into a project
if you hadn't touched it for a while. Not to mention the fact that every time
I picked up this project (it's an after hours thing that I don't get a lot of
time to play around on) I would almost have to re-read a tutorial to remember
how all the connections, etc. worked in IB. I think the main problem really
was the disconnect though, so I'm looking forward to actually having
everything _there_.

So, when will it be done? :D

~~~
thought_alarm
It sounds to me like you don't have a very good understanding of your
software's design.

That's understandable. Most other IDEs handle GUI development by simply
mashing the view and the controller together into a single unit. That is fine
if you just have a simple window with some buttons and text fields, but this
approach quickly falls apart when applied to larger, more sophisticated
software.

The Cocoa approach is different in that it completely separates the view (the
NIB or XIB) from the controller(s). You're free to design your views,
controllers, models as you see fit, and Interface Builder is there to help you
realize that design.

But you actually have to design your software; XCode is not going to hold your
hand and shoehorn you into a specific design, like most other IDEs.

A NIB is still a NIB. That's not going to change just because XCode and IB are
now a single application. You will still have to design your software, and you
will have to understand that design.

But software design is hard, so don't be discouraged. It will come with
experience.

~~~
statictype
Partially disagree. The problem (at least what I've seen) is not
view/controller dichotomy - most modern development platforms already have
this.

I find the mechanism of connecting UI elements to outlets by dragging around
to be gimicky and pointless.

Why can't the runtime auto-bind them by matching names? Doesn't ruby work this
way?

There seems to be a bit of pointless work that you have to do to get a new
controller and view connected and up-and-running.

~~~
alextgordon
_I find the mechanism of connecting UI elements to outlets by dragging around
to be gimicky and pointless._

 _Why can't the runtime auto-bind them by matching names? Doesn't ruby work
this way?_

The whole point of having the action/outlet system is that it provides a layer
of indirection and lets you write less code. There's no need to write an event
handler for a button to make it print a view. You just drag an action from
your NSButton to your view, and set its selector to _print:_. The same goes
for outlets.

I'm not sure what you mean by "auto-binding by matching names". The only way I
could see that working, is if you gave the control and the target names, then
inputted the action as (control name, target name, action). IMO this would be
a lot more work than the current UI.

~~~
statictype
_I'm not sure what you mean by "auto-binding by matching names". The only way
I could see that working, is if you gave the control and the target names,
then inputted the action as (control name, target name, action). IMO this
would be a lot more work than the current UI._

Well, I was referring more to linking IBOutlets as opposed to IBActions.

I think Visual Studio's way is superior - ie, from the UI Designer, you can
autogenerate and link the action for a button as well as having the option to
link an existing action.

~~~
alextgordon
_Well, I was referring more to linking IBOutlets as opposed to IBActions._

You still have the problem of selecting the object owns the outlet. You may
want to connect a text field to an outlet on a view nested down a few levels.
You'd have to give _both_ the text field and the view names, which again takes
time and effort.

 _I think Visual Studio's way is superior - ie, from the UI Designer, you can
autogenerate and link the action for a button as well as having the option to
link an existing action._

I haven't used VS for quite a while. IIRC there is always a user class
associated with the UI. This is not the case in Cocoa. It's common for file's
owner to be, say, a plain NSWindowController, and there to be no user classes
in the nib at all.

It's tempting to think of an "action" in Cocoa as being synonymous with a
method. But this isn't the case. When you click a button, it doesn't directly
call it's action on its target. The actual process is more complex, and
provides a lot of room changing where the action message is sent. This is what
makes insane magic that is first responders work.

~~~
statictype
Alright, I'm sold. I never really considered any if those circumstances. I'm
still feeling my way around.

------
amanuel
Git support was the #1 feature that I was waiting for.

Apple thank you for listening.

~~~
hayroob
git and as petty as it is, not having to type @synthesize.

~~~
cameldrv
You want PropertyFromInstanceVariable from here:

<http://www.bernard-web.com/pierre/code.html>

This thing has saved me hours of aggravation. You highlight a line in the
struct part of the Obj-C class definition, and it generates the @property, the
@synthesize, and a line in dealloc. You can also highlight multiple lines, and
it will generate multiple properties. It is even smart enough to know that
ints are assign, NSStrings are copy, and other objects are retain.

~~~
Zev
Or just LLVM 1.5 or LLVM 2.0, as there are C flags you can pass in that will
make it so you no longer have to add ivars to your header and make @synthesize
the implicit default.

------
asnyder
Although I don't use XCode, I'm not sure how I feel about it suggesting minor
fixes such as the == example. I enjoy writing a line seeing an issue and then
solving it, or at least having to scan it with my eyes.

While I'm sure it's not an issue for most, I've always wondered whether that
sort of thing breeds dependency. What happens when you don't have the IDE? Do
you forget how to scan and fix minor issues? I've seen much worse... I've seen
"professional developers" not know how to code or run projects without their
all knowing IDE. Although I don't want to point any particular group out, many
users of Visual Studio suffer from this issue.

~~~
modeless
Since the introduction of automatic transmissions many people haven't been
learning how to shift a manual transmission. These people aren't necessarily
worse drivers.

~~~
statictype
Well, I think the difference is even less than that.

People who never drove a stick-shift may have no idea how to operate one.
Whereas someone switching from an IDE to a text editor would still be able to
work - just less productive.

~~~
bad_user
> _Whereas someone switching from an IDE to a text editor would still be able
> to work - just less productive._

I have my doubts about that as I have seen many evidence to the contrary.

------
bbb
The '=' vs. '==' example actually nicely demonstrates the limits of automatic
bug hunting. The variable 'rig' is NULL when it is being dereferenced, thus
the program will segfault regardless of '=' or '==' being used. The "fix-it"
tip is highly misleading.

[http://developer.apple.com/technologies/tools/whats-
new.html...](http://developer.apple.com/technologies/tools/whats-new.html#fix-
it)

(This is probably a side effect of PR people preparing the website; there is
no reason why LLVM should not be able to detect this particular kind of NULL-
dereference.)

------
vault_
I remember reading about how LLVM would be better able to interface with IDEs
than gcc because it was library based rather than a giant monolithic system.
It's interesting to see how this has been applied.

------
Groxx
So... when is the public _release_?

btw, the wwdc videos have been public for a while. Take a look at them if
you're itching for more infos: <http://developer.apple.com/videos/wwdc/2010/>

~~~
Samuel_Michon
Today, Xcode 4 developer preview 2 has been made available for download.

No official release date for the final release is known, but judging from
Apple's history with developer previews you can expect it to be out within 6
weeks.

~~~
Lewisham
Is this only for paid up members? I have a freebie developer account, but see
nothing.

~~~
ptomato
Yes.

------
pietrofmaggi
Xcode 4 preview 2 is now available to Mac and iPhone Developer Program members
(only the ones with paid subscription). PLEASE NOTE: Xcode 4 is beta software
--> Continue to use Xcode 3.2.x for production development.

And make sure to review the Xcode 4 WWDC sessions before you dive in!

------
fleitz
I can't wait for Single Window, the multi-window design was possibly the worst
interface for an IDE I've seen. I was actually very surprised how bad the UX
for XCode was compared to the rest of OS X.

~~~
mcritz
A negative aspect of single window mode is if you use multiple monitors.

~~~
lukifer
You can always still use other monitors for to-do lists, iPhone Simulator,
documentation, performance tools, iTunes, etc.

Of course, I would hope that there are still options for breaking things into
their own window for those who want to.

------
mian2zi3
Anyone played with lldb yet? Thoughts?

------
pornel
I liked that entire project — including targets and build steps — was in the
tree view on the left.

Now tree view has been limited to be a file browser. Targets and build steps
are now hidden deeper in settings windows and tabs.

To me old way was simpler and felt more elegant.

I'm not fond of "mystery meat navigation" — tabs have icons instead of text
labels. I'm sure I'll learn that quickly, but it makes learning curve higher
and on first impression UI looks more overwhelming.

------
butu
Looks like very good improvement on the performance and to assist developer
while development like fixing error stuff.. Till date I am not able to make
any IDE whether xcode, eclipse or netbeans as my default editor bcoz IDE are
damn slow... if I want to write program it should be open instantly... may be
with new MacbookPro and xcode I can feel that way... then I can consider :)
but definitely looks good...

------
loewenskind
Wow. I'm impressed. The code fixing stuff is something I have to buy Resharper
to get on C#.

------
modeless
Aww, it installs its own copy of the iOS SDK, so you can't use it with the iOS
4.1 beta yet.

~~~
Zev
Just make a symlink from the iOS Beta SDK location to the framework dir for
Xcode 4 and you can use iOS 4.1's SDK.

------
Hopka
Is it just me or does the UI Layout look very much like iTunes?

------
grk
Gah, I was hoping they'd add some support for (mac)ruby. It would be awesome
to have real tab-completion working.

~~~
Lewisham
What does it support for Ruby dev? I mean, I like TextMate well enough, but it
doesn't even show suggested completions without hitting Esc, which doesn't
jive for me at all.

Can you bind shell scripts to the run button? Code folding?

------
lemming
It's incredible to me that they can bring out major version 4 of Xcode and
_still_ not fix the most fundamental thing in a modern IDE - navigation. Until
I can control-click on a symbol and jump to it, search for related objects
(find my interface, find implementations of an interface, what overrides this
etc etc) in my opinion it's just broken.

~~~
DeusExMachina
What do you mean? If I command-click a symbol in XCode, it jumps directly to
the definition, and with alt-click it displays the documentation. I've been
doing it for a long time, it's not new. What feature do you miss?

~~~
lemming
That's possible, I apologise if so - it's been a while since I tried to use
XCode but a colleague told me they hadn't really improved the navigation
recently. If command-click works that's a big step forwards.

I'd also expect navigation based on the semantics: 1\. Find classes that
implement an interface. 2\. From a method in an interface find implementations
of that method. 3\. From a class easy navigation to the interfaces it
implements. 4\. Find usages of a particular method, either from the concrete
instance or the interface equivalent that it implements.

I'm not very familiar with Objective-C but I'm sure that there's tons of
related navigation that could make use of Posing and Categories, for example.

~~~
DeusExMachina
For 1. and 4. I use the "Find in Project -> as symbol" option. Not the best
way of doing it, but decent. 2. is not available AFAIK. 3. is present, but
only for inheritance and for header files inclusion, not for interfaces
(called protocols in objective-c).

------
jedbrown
LLVM 2.0? That was released over 3 years ago. Maybe they mean LLVM 2.7?

~~~
astrange
It's the LLVM compiler (formerly known as clang) 2.0.

~~~
jedbrown
The LLVM website doesn't seem to have deprecated the clang name. Clang 1.1 is
included with the LLVM 2.7 release. So what exactly is at 2.0, and has this
thing been released?

------
wallflower
The changes to the standard keyboard shortcuts could drive you nuts.

------
c00p3r
Thank them for clang and clang++. Hope to see it as default FreeBSD 9
compiler. ^_^

Also it is time to realize that LLVM-based tools are much more effective than
JVM-based. (at least they can run or ARM) ^_^

~~~
aaronblohowiak
What makes you think jvm doesn't run on arm?

~~~
c00p3r
Where I can download JRE for Linux/ARM? ^_^

Do not tell me that Dalvik VM is the same as VM from JRE.

How could I run, as declared by marketers - "Code once run everywhere!" a
typical Spring + Hibernate + 100 another dependencies poorly designed crap on
Dalvik VM?

Thanks.

~~~
btn
<http://java.sun.com/javase/downloads/embedded.jsp>

~~~
c00p3r
Are you trying to say that _for Embedded_ means the same as _Standard_? ^_^

~~~
nullstyle
from
[http://java.sun.com/javase/embedded/reference/release6/Embed...](http://java.sun.com/javase/embedded/reference/release6/EmbeddedReleaseNotes_6.html#compare):
"All Java SE for Embedded offerings are Java SE compliant."

~~~
c00p3r
Thank you, I can read marketing-speak.

------
dcheung
Holy Crap Xcode 4 Single Window! You had me at hello!

