The World’s Leading Microsoft .NET Magazine
   
 
The .NET Addict's Blog

My Top Tags

                                                           

My RSS Feeds








I heart FeedBurner

Latest Diggs - Programming

Computers Blogs - Blog Top Sites

Site Hits

Total: 4,741,920
since: 19 Jan 2005

Objective-C 2.0 - Programming for wimps?

posted Wed 31 Jan 07

In a blog post here, someone indicates that the notion of moving to Objective-C 2.0 only after Leopard comes out reveals a lot about too little ambition and talent. To me, posts like this reveal an elitist, snobbish attitude that only serves to embarass those with such an attitude. This same attitude was strewn about by C++ programmers when VB3 programmers began writing Windows code - the C++ programmers had been "doing it the hard way" for years, and they had far more low-level control, and they could produce applications with far more performance... They also had three or four times the time-to-market, double the bug rates, and a lot of other side effects that resulted from monolithic code and manual pointer and memory management.

What bugs me is why people would complain about having people pick up Objective-C 2.0 but for the "wrong reasons". If you can code, and you can code well, and you produce good products - why does it matter whether you decided to go to Objective-C 2.0 for the "right" reason (its an extremely powerful language that has been around since the dawn of time) or the "wrong" reason (some people thing garbage collection is the wrong reason).

The bottom line here is that Objective-C is an awesome language, and I love its dynamic features, the loose messaging abilities, the syntax is nice - its basically an object-oriented C that went toward Smalltalk to get its objects instead of C++. I have no qualms using malloc and dealloc, etc. However, that said, I do enjoy what .NET offers me - a chance to think about the overall application I am writing, the hiearchy, the structure, the architecture, the design - without worrying about whether or not I forgot to release something, without worrying about reference counts, and without manually unravelling an object graph upon deallocation. I think that garbage collection is a productivity enhancement, not some crutch that allows poor programmers to set foot upon the elitist ground that was previously held solely by the "hard core" programmers who march to the beat of a different managed environment.

So. I guess what I'm saying is this: if you are an inexperienced programmer who cannot properly manage your own memory, then moving to a GC'd environment like Objective-C 2.0 (or the .NET Framework for that matter) will not make you able to write good applications. However, if you are a developer with decent development habits, good discipline, and the knowledge of when things should be allocated and when they should not, then moving to a GC'd environment should make you more productive.

Whining and complaining that people are planning on adopting Objective-C 2.0 for the wrong reasons is immature and elitist. We all suffered through the scorn of C++ developers when we wrote VB/COM, and we suffered through the scorn of ADA programmers when we wrote Delphi, we suffered through the scorn of Java programmers when we wrote C#. There will always be egos when there are programmers, and I foresee a lot of developer puffer-fishes expanding their chests when they sneer down at a new breed of developers who cut their teeth on Garbage Collected Objective-C who start all their developer stories with, "Back in my day...".

Good apps are good apps, bad ones are bad ones, good developers or bad developers - it is all the same whether you're in a GC environment or not.

tags:              

links: digg this    del.icio.us    technorati    reddit

AddThis Social Bookmark Button




1. Gareth left...
Wed 31 Jan 07 8:12 pm :: http://www.colourmecocoa.com

That last sentence is so true. Sometimes people need to take a step back and think about the overall product and the experience it provides. Who cares about the implementation if the product is a dream to use?


2. Craig left...
Wed 31 Jan 07 9:10 pm

Does OC only run on a MAC? - when do you find the time!!! I have so much code to write and its all web based so c#/asp.net is just too fast to use something else but it would be nice :)


3. Gareth left...
Wed 31 Jan 07 9:18 pm :: http://www.colourmecocoa.com

Craig,

Objective-C can be run on pretty much any platform, you just need to get a compiler for it. The Mac specific parts are the Cocoa and other frameworks that Apple have implemented for developers to use.


4. Jeff left...
Thu 01 Feb 07 2:41 am

Well, i think the post you mention is intended to be - at least in part - provocative; you just have to read a bit between the lines ;-). And i don't even think the majority of Mac developers out there would fully share this view of easy malloc-dealloc (cf. Autoreleased objects hanging around like Hitchcock's Birds, http://www.cocoabuilder.com/archive/message/cocoa/2004/8/18/114873).

This, however, is not to say that Objective-C is a pretty smart and speedy OO programming language, esp. when you tap Higher Order Messaging constructs (cf. http://www.cocoade.com/products/frameworks/Documentation/index.html, which btw includes CCAAutoreleasePoolWrapper).

Welcome to the Mac.

Regards Jeff


5. Jason Nitzky left...
Thu 01 Feb 07 6:53 am

Pretty provocative, IMHO. Just look at these two docs as well to get a feel how tricky Cocoa memory management can get:

Very simple rules for memory management in Cocoa http://www.stepwise.com/Articles/Technical/2001-03-11.01.html

Debugging retain counts http://weblog.bignerdranch.com/?p=2


6. D.J. left...
Fri 02 Feb 07 11:03 am

I just hate those superficial VB-C#-ObjectiveC whatever clickers that build crappy software really fast. Quality software can be only done by understanding the details, everything else is pure crap.


7. - left...
Fri 02 Feb 07 3:10 pm

"I have no qualms using malloc and dealloc, etc."

I think you mean malloc and free, there.


8. Kevin Hoffman left...
Mon 05 Feb 07 7:38 am

free is C++, dealloc is Objective-C, from what little I know of the language.


9. ElitistNewbie left...
Tue 06 Feb 07 4:26 pm

Kevin --

free() is not C++. free() is C. Neither is malloc(). The proper equivalents in C++ are new/new.

In general, modern C++ programming avoids all of these, and instead relies on RAII - also known as stack-based allocation.

Cheers.


10. Kevin Hoffman left...
Tue 06 Feb 07 9:39 pm

Quite right. With having gone from C to C++ to VB to COM to MFC then to Java and then to .NET and now jumping into Objective-C, it is really easy to get the syntax for allocation and releasing confused.


11. Jon Hendry left...
Tue 13 Feb 07 4:46 pm

"Just look at these two docs as well to get a feel how tricky Cocoa memory management can get: "

Still, that's not *that* tricky. It's not like C/C++, where reams have been written about memory management.

Even before Objective-C had autorelease pools and ubiquitous String objects (relying on char* instead), I found memory management to be significantly easier and less error-prone than it is in C.


12. Don left...
Fri 20 Apr 07 2:55 am

All too true. And what's even funnier is how old a concept GC really is; you have the (elitist) assembler/C/C++-crowd getting the masochist-price and the Lisp/APL/Smalltalk-crowd just nodding their heads: "they all learn eventually..."


Tag Related Posts

Would you like to touch my mono?

Mon 23 Nov 09 2:59 P GMT-05

Upgrading your Leopard install to Java SE 6 64-Bit

Mon 12 Jan 09 1:38 P GMT-05
tags:            

Apple drops the iPhone NDA for Released Software

Wed 01 Oct 08 3:54 P GMT-05
tags:          

Cappuccino, Objective-J, and You

Wed 10 Sep 08 6:14 P GMT-05

So I'm in the LA Times ;)

Wed 27 Aug 08 2:51 P GMT-05
tags:                  

MobileMe vs. Live Mesh Throwdown - Round 1

Wed 16 Jul 08 10:33 A GMT-05

Building Model Classes in C# and Cocoa

Sun 15 Jun 08 3:13 P GMT-05
tags:            

MobileMe vs. Live Mesh - Round 1

Wed 11 Jun 08 12:20 A GMT-05

My Macbook Air is masculine, dammit!

Mon 17 Mar 08 6:59 P GMT-05
tags:          

iPhone Underrated as a Gaming Device?

Fri 14 Mar 08 1:50 P GMT-05
tags:        

My take on the iPhone SDK

Sat 08 Mar 08 1:39 P GMT-05

Jobs says "not likely" to Flash on the iPhone

Thu 06 Mar 08 1:39 A GMT-05
tags:          

My Macbook Air Review

Sun 02 Mar 08 4:20 P GMT-05

iPhone Roadmap March 6th

Fri 29 Feb 08 10:41 P GMT-05
tags:        

Video of the Macbook Air in Action

Wed 20 Feb 08 3:04 P GMT-05

Macbook Airはきれいですよ!

Sun 17 Feb 08 2:38 A GMT-05

Why is O'Reilly Condoning iPhone Hacking?

Mon 11 Feb 08 3:55 P GMT-05

Evaluating my next laptop purchase

Wed 06 Feb 08 8:40 P GMT-05

The iPhone SDK key has been leaked! Oh Noez!!!1

Tue 29 Jan 08 11:36 A GMT-05
tags:        

Why Geeks just don't "get" the Macbook Air

Thu 17 Jan 08 2:30 P GMT-05

Popcorn + TiVo + Macbook Pro + iPhone == Hell Yeah!

Tue 15 Jan 08 3:11 P GMT-05
tags:          

How my ADC membership changed my life

Mon 31 Dec 07 3:57 P GMT-05
tags:      

Leopard Code Sample : Sprinkling in some Bonjour

Tue 27 Nov 07 2:32 P GMT-05
tags:        

Leopard Sample: A Bound NSCollectionView

Mon 29 Oct 07 1:41 A GMT-05

My Leopard Installation Experience

Sun 28 Oct 07 12:57 P GMT-05
tags:    

Leopard is out - let the code samples begin!

Fri 26 Oct 07 10:09 A GMT-05
tags:          

My life is complete : iPhone SDK is CONFIRMED.

Wed 17 Oct 07 6:38 P GMT-05
tags:          

Leopard Shipping October 26th!!

Tue 16 Oct 07 4:59 P GMT-05
tags:        

My iPhone Review

Mon 23 Jul 07 1:09 P GMT-05
tags:        

Microsoft Codename Acropolis - Unwrapped

Wed 20 Jun 07 3:22 P GMT-05
tags:              

The dreaded language bleed-over has begun

Tue 19 Jun 07 6:23 P GMT-05
tags:        

Exploring the Delegate Design Pattern

Mon 14 May 07 6:30 P GMT-05

Core Data - Almost too Easy?

Wed 18 Apr 07 2:23 P GMT-05