The Artima Developer Community
Sponsored Link

News & Ideas Forum (Closed for new topic posts)
Mac OS X growing on developers?

38 replies on 3 pages. Most recent reply: Sep 6, 2003 10:43 AM by Wouter Zelle

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 38 replies on 3 pages [ « | 1 2 3 ]
Todd Blanchard

Posts: 316
Nickname: tblanchard
Registered: May, 2003

Re: Mac OS X growing on developers? Posted: Aug 11, 2003 6:41 PM
Reply to this message Reply
Advertisement
Its nice to see people embracing Mac OS X.

Its very sad to see not a one of you seems to be writing applications *for* the platform. Its all Java it sounds like. This is a shame because native development with Objective C on OS X is a joy.

Moreso than Java development on any platform.

At least write a cool shareware app.

Erik Price

Posts: 39
Nickname: erikprice
Registered: Mar, 2003

Re: Mac OS X growing on developers? Posted: Aug 11, 2003 6:57 PM
Reply to this message Reply
> Its nice to see people embracing Mac OS X.
>
> Its very sad to see not a one of you seems to be writing
> applications *for* the platform. Its all Java it sounds
> like. This is a shame because native development with
> Objective C on OS X is a joy.
>
> Moreso than Java development on any platform.
>
> At least write a cool shareware app.

Why?

Without rehashing all the pro-Cocoa literature out there, give us a few reasons why. In other words, tell us your personal experience with Cocoa and why you like it so much, or if you haven't got much experience, tell us what you find attractive (or unattractive) about it. I'm genuinely interested in hearing your opinions -- but please, not a feature list.

Christian Amor Kvalheim

Posts: 10
Nickname: amor
Registered: Jun, 2003

Re: Mac OS X growing on developers? Posted: Aug 12, 2003 2:44 PM
Reply to this message Reply
Well

I'm experimenting with using Virtual PC 6.1 from Connectix on my 1Gh Powerbook to do .Net development work. Hopefully it will be fast enough to replace my notebook for compilation and code writing.

Christian A Kvalheim

Todd Blanchard

Posts: 316
Nickname: tblanchard
Registered: May, 2003

Why Posted: Aug 16, 2003 4:02 AM
Reply to this message Reply
> Without rehashing all the pro-Cocoa literature out there,
> give us a few reasons why. In other words, tell us your
> personal experience with Cocoa and why you like it so
> much, or if you haven't got much experience, tell us what
> you find attractive (or unattractive) about it. I'm
> genuinely interested in hearing your opinions -- but
> please, not a feature list.

Sure. The NextStep apis are a model of simplicity and consistency. That alone makes them nice to work with. Objective C is a very pleasant language to work in. Its highly dynamic features provide for very flexible development. The ability to extend any class in the system by adding method categories (rather than subclassing) is quite powerful and something I miss a lot in Java - as does anybody who has ever worked with it. Dynamic typing means you can concentrate on your program rather than satisfying the compiler.

Interface Builder is a nifty gui builder that creates archives of serialized objects - this is markedly different from the usual brittle code generation that other UI layout tools use. IB is what Java Beans wanted to grow up to be, but never made it.

If doing user interfaces, a native Cocoa UI is so much more satisfying (and responsive) than the Java equivalents - even when using Cocoa/Java I can tell right away that its not the real thing by its sluggishness. Swing is even worse. Plus the delegation model is a lot easier to use than listener classes.

Plus, it would be nice to see some innovative new applications - real ones. That would be a much better use of developer time than writing the 10,000th Java Web Application Framework.

Paul Umbers

Posts: 7
Nickname: paulu
Registered: May, 2003

Re: Mac OS X growing on developers? Posted: Aug 17, 2003 3:23 AM
Reply to this message Reply
Just as an indication of the price difference between the US and UK, I priced up a 17" powerbook on the Apple Store US & UK sites. The UK machine costs £2918 (1Gb memory + case) while the US machine is £2347 (at current rates) for the same spec. That's a difference of almost £600 (around $1000)! I could probably buy a powerbook AND an intel laptop in the US for the same price as just a powerbook in the UK.

I think I'll hang on to my Dell Inspiron until I emigrate next year and then switch :-)

BTW, anyone know where the price difference comes from? Surely it can't be all UK duty?

Erik Price

Posts: 39
Nickname: erikprice
Registered: Mar, 2003

Re: Why Posted: Aug 17, 2003 8:41 AM
Reply to this message Reply
> Sure. The NextStep apis are a model of simplicity and
> consistency. That alone makes them nice to work with.
> Objective C is a very pleasant language to work in. Its
> highly dynamic features provide for very flexible
> development. The ability to extend any class in the
> system by adding method categories (rather than
> subclassing) is quite powerful and something I miss a lot
> in Java - as does anybody who has ever worked with it.
> Dynamic typing means you can concentrate on your program
> m rather than satisfying the compiler.

I've barely begun to learn Objective-C myself, I'd like to try some amateur Mac development. It was recently pointed out to me that while Cocoa/Objective-C has a lot of advantages over statically typed languages and is good for GUI development on MacOSX, there are even easier languages like Python that can be used to write the business logic, with an Objective-C GUI wrapper around the Python program. I have to admit that part of the reason I like Java is things like not having to deal with garbage collection, array bounds-checking, and native string types. When writing a Mac application, do you do everything in Objective-C, or C, or ... I am curious about your strategy. Thanks for posting your response, by the way.

David Holmes

Posts: 1
Nickname: dmholmes
Registered: Aug, 2003

Re: Mac OS X growing on developers? Posted: Aug 18, 2003 8:11 AM
Reply to this message Reply
I haven't tried it on my Mac yet, but there is a -vm vmpath argument to get eclipse to use a specified vm. The arguments are documented at http://dev.eclipse.org/viewcvs/index.cgi/~checkout~/org.eclipse.platform.doc.user/tasks/running_eclipse.htm.

David

Todd Blanchard

Posts: 316
Nickname: tblanchard
Registered: May, 2003

Re: Why Posted: Aug 20, 2003 6:04 PM
Reply to this message Reply
"I like Java is things like not having to deal with garbage collection, array bounds-checking, and native string types. When writing a Mac application, do you do everything in Objective-C, or C, or ... I am curious about your strategy."

Well, I think you'll be pleasantly surprised. While the ObjectiveC stuff on OS X doesn't have full blown garbage collection, a great deal of memory management has been automated for you in a pretty transparent way. I'll explain that in a second.

ObjectiveC is a superset of C - and yet when working in Cocoa you hardly ever use raw C data types. So instead of C arrays you use instances of NSArray - its a bit like List in Java. For strings you use NSString. Even string literals can be specified to be NSStrings rather than C array of char. To do that you just prepend the string with @.

"This is a C String"
@"This is an NSString"

Making NSArray's on the fly is easy too.
[NSArray arrayWithObjects: a, b, c, nil]. This makes use of the C vararg package to allow variable numbers of arguments - you need to put a nil at the end of the list to mark it.

The Foundation library uses a neat trick such that NSString, NSArray, and NSDictionary are all immutable, like java.lang.String. So when returning an immutable copy - you're telling clients that this is your data - no fiddling. There are mutable subclasses of each of these. NSMutableString is a subclass of NSString - its got all the stuff you need to change the string in place. Sort of like StringBuffer (although why StringBuffer doesn't derive from String beats me). You can return a mutable one by sending it mutableCopy if you want to muck with something you got from someone else.

Memory management is done in a pseudo generational fashion. There is a class called NSAutoReleasePool. One is constructed at the very beginning of the program and destroyed at the end. Another one is constructed before each event is delivered to the Cocoa UI and destroyed after the event is handled. They live in a stack, when you create one it takes the place of the most recently created one and when you release it the one it took the place of becomes active.

As you construct objects, their intialization methods generally register them with the current autorelease pool. So you can create temporary objects with the same level of abandon you do in Java. They will get collected when the current autorelease pool is released - which happens automatically for you every event. If you plan on holding onto something for awhile, you send it a retain message. Autorelease pools pass to their parents any object that has a retain count greater than zero. So this is the reference counting part. Each setter is typically written as:

-(void)setFoo:anObject
{
[anObject retain];
[foo release];
foo = anObject;
}

If you follow this idiom in setters, you'll have no memory management issues.

BTW, if you know you are going to create a lot of garbage - like in a loop, you can consruct your own AutoReleasePool at the beginninng of the loop and release it at the end of the loop - thus cleaning up memory more often. I hope this helps.

Wouter Zelle

Posts: 1
Nickname: aapje
Registered: Sep, 2003

Re: Mac OS X growing on developers? Posted: Sep 6, 2003 10:43 AM
Reply to this message Reply
> BTW, anyone know where the price difference comes from?
> Surely it can't be all UK duty?

US prices don't include VAT. That explains part of the difference.

Flat View: This topic has 38 replies on 3 pages [ « | 1  2  3 ]
Topic: The Human Side of XML Previous Topic   Next Topic Topic: Books & book reviews


Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2017 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us