Re: Spoiled by Java IDEs
Re: Spoiled by Java IDEs
- Subject: Re: Spoiled by Java IDEs
- From: William Squires <email@hidden>
- Date: Sat, 26 Jul 2008 10:14:20 -0500
On Jul 18, 2008, at 1:45 PM, Jens Alfke wrote:
On 18 Jul '08, at 7:18 AM, Graham Perks wrote:
I too l sorely miss the completion tools. Add a method prototype,
it should absolutely kick out a stub. Copy and paste? What?? Even
better, I write a method, add it to the .h for me.
There are some predefined macros for common methods. Inside an
@implementation context you can type "init" or "dealloc" and press
the completion key and it will spit out a generic -init or -dealloc
method for you. There are more of these (and they're documented in
the Xcode guide) but those are the ones I remember.
If I need a property added to my class, why do I need to hand-
write THREE lines (!? baffles me how complex a simple property is.
C# buggered that up too.)
Here's why.
#1: The @property declaration. It's kind of a given that you need
that :)
#2: The instance variable declaration. As you point out, not needed
in 64-bit, but needed in 32-bit due to fragile-base-class issues
(any subclass needs to be able to compute this class's instance
data size given only the information in the .h file. There is no
way around this without breaking binary compatibility with existing
code.)
#3: The @synthesize declaration in the .m file. You need this
because there are at least three ways to implement a property
(synthesized, dynamic or explicit method) and you have to tell the
compiler which one you're using. Otherwise, if you left out the
@synthesize line, the compiler couldn't tell if you wanted it to
synthesize a method, leave it out entirely (dynamic), or maybe you
meant to implement an accessor but forgot to write it.
[I've said it before: Any time you think a released piece of
software does something totally the wrong way, and you can
obviously see the right way it should have been done, there are
almost certainly issues you don't know about (or haven't thought
through) that make the situation much more complex. Real software,
unlike the stuff we wave our hands about, is built out of
compromises.]
I totally agree with you that assistance from the IDE for writing
these would be nice. Unfortunately everyone has ten or twenty pet
features that they think Xcode really, really needs (I'm no
exception), and what's worse, that list of features is different
for every user. So there's no way they can add what every user wants.
It sounds like some of this could be done with an AppleScript that
you could run from the scripts menu - it could then present a dialog
to obtain the information, then spit out the code; though there would
probably be assumptions that have to hold (i.e. you're currently
editing the .h file you want the property in, that both the .h and .m
are in the current project directory, etc...)
You might even be able to do it with a custom automator doohickey.
—Jens _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40satx.rr.com
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden