Live data from Hacker News

Stop the Hate: Obj-C Deserves Your Love

intridea.com

21–30 of 91 posts

Re: Stop the Hate: Obj-C Deserves Your Love

#21

I'd actually go a step further and argue Objective-C is actually closer to Ruby than to C. So close, in fact, that MacRuby implements Ruby's object system using Objective-C's runtime. Syntax and naming conventions are another matter...

That's because ruby and objective-C are both inspired by smalltalk.

Re: Stop the Hate: Obj-C Deserves Your Love

#23

This makes me feel old -- when I was learning programming/CS, memory management and storage classes were part of basic training. Now we've got a generation of programmers who've never had to worry about these things.

Actually even with gc enabled languages, you can create memory leaks. Hence you still need to know a little bit on how it works.

However, I fail to see why I should have to worry about it and do it manually.

Re: Stop the Hate: Obj-C Deserves Your Love

#24
As someone who has been, on and off, writing Objective-C for the past decade, I will unequivocally state that as application programming languages go, it's a terrible 1980s jalopy of bad language decisions cobbled on top of more bad language design under which Smalltalk-descendent ideas peek through now and then.

Language research has progressed. Microsoft has invested heavily in C# and related technologies. Even Smalltalk research moved on -- strongtalk, newspeak. We have alternative, real-world usable languages running on the JVM, from Scala to Clojure.

Yet Objective-C moves forward one slow, stuttering step at a time. There are no namespaces. There are no self types (your init methods all have to return id so that they don't conflict with other init methods that have the same name). There are no private methods. Writing an initializer takes 3 lines of boilerplate, every time, plus the header declaration:

  if ((self = [super init]) == nil)
    return nil;

  return self;
The language is obtuse, ridiculously verbose, frustrating to use, and downright paleolithic compared to modern deployed languages. It's a joke compared to everyone else's modern language research. I suffer through it full time because that's what the platform demands, but I would shoot it in the head in a second if I could.

Nuke it from orbit. It's the only way to be sure.

Anyone who thinks ObjC is a good language either hasn't actually spent significant time outside of C/C++/ObjC, or is still new to the wide, wonderful world of Mac/iPhone development.

Re: Stop the Hate: Obj-C Deserves Your Love

#26

I'm supposed to be impressed because Obj-C does reference counting? It really is sad that so little of the state of the art in GC is available in mainstream languages.

I'd say he more aiming to comfort than impress. The good part is that because of the homogenous paradigm there are three rules to learn about when to retain/release. You find them, read them, think about it for 10 minutes, and then get on with programming.

You could contrast it with malloc/free in the unix/C ecosystem. Get a pointer back from function X in library Y. What do you do when you are done? free? call X_Z? constraints on the order of freeing dependent objects? That is a trip to the man pages every time.

Re: Stop the Hate: Obj-C Deserves Your Love

#27

This makes me feel old -- when I was learning programming/CS, memory management and storage classes were part of basic training. Now we've got a generation of programmers who've never had to worry about these things.

Just because it's good to be aware of how memory management works doesn't mean you should be dragged through tedious manual tasks every time you code.

Assembler was probably part of many peoples basic training as well. Do you want to spend your days juggling everything in 4 general purpose registers because it makes you feel like a better programmer? Is that the best use of your time?

Re: Stop the Hate: Obj-C Deserves Your Love

#29
post #18

I don't understood why people think automatic deallocation = garbage collection = slow language. You can have reference counting without garbage collection. It's pretty obvious to a compiler when a variable has gone out of scope and can be dereferenced (and deallocated immediately at 0). Using a language like obj-c where you have to do memory management manually just seems so archaic after using modern languages. Plu…

>Using a language like obj-c where you have to do memory management manually just seems so archaic after using modern languages. That's not an Objective C thing, the language has garbage collection, just it isn't enabled for the mobile platform, for the reason it eats power and memory.

My point was that it is possible to have deterministic deallocation without garbage collection. This can be done at compile time. So I don't buy the "eats power" excuse for needing manual memory management.

Re: Stop the Hate: Obj-C Deserves Your Love

#30
post #24

As someone who has been, on and off, writing Objective-C for the past decade, I will unequivocally state that as application programming languages go, it's a terrible 1980s jalopy of bad language decisions cobbled on top of more bad language design under which Smalltalk-descendent ideas peek through now and then. Language research has progressed. Microsoft has invested heavily in C# and related technologies. Even Sma…

I pretty much totally agree. I released two apps in the app store (one was a rather elaborate game). I feel I experienced enough to get a feel for what the language is like, and I came away unimpressed. At the most basic level, how verbose the language is is what bugged me the most. You gotta type like crazy to get anything done in Obj-C.
Post reply on HN