Live data from Hacker News

Stop the Hate: Obj-C Deserves Your Love

intridea.com

51–60 of 91 posts

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

#51
post #16

Didn't see a single explanation of why the language deserves my love. Let's see. * The language is verbose. * Practically speaking, it's only used to developer for two platforms (OSX and iOS). * The frameworks for those platforms are MEGA verbose. * The memory management model for the iOS platform is not GC, and it's not manual management. Frankly I found manual management of memory simpler than retain/release. And t…

"Doesn't have any functional elements to it whatsoever."

There are methods like makeObjectsPerformSelector: and now methods for taking blocks.

Sending a selector is not functional, true, because it is an OO language, not a functional one. So the idea is "send this message to all these objects" instead of "call this function on all these objects."

Unfortunately, I don't see anyway to create a new collection from an existing one by sending each object a message (the equivalent of map). Furthermore, some methods actually do take C functions, and others take an NSPredicate. It would be more consistent if they had found a way to do all these things by sending selectors and a varargs list.

(It seems like blocks is the new, improved way to do all these things, and rather functional, but all the older ways still exist, so a developer must understand all of them.)

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

#52
post #33
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…

As someone who does a ton of Objective-C, I challenge the notion that namespaces are even remotely necessary. I've also done development in nearly everything under the sun, in nearly every "popular" language under the sun, which challenges your other assumption that anyone who thinks Objective-C is good hasn't spent time outside of C/C++/Objective-C. I'm guessing you've never written a Windows app with C++ and MFC. O…

[deleted]

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

#53
post #49
post #33

Earlier quoted context omitted.

As someone who does a ton of Objective-C, I challenge the notion that namespaces are even remotely necessary. I've also done development in nearly everything under the sun, in nearly every "popular" language under the sun, which challenges your other assumption that anyone who thinks Objective-C is good hasn't spent time outside of C/C++/Objective-C. I'm guessing you've never written a Windows app with C++ and MFC. O…

As someone who does a ton of Objective-C, I challenge the notion that namespaces are even remotely necessary ... Apple is now suggesting that you use three-character class name prefixes, since they claim all the two character ones. I had my two character prefix claimed by a new private framework Apple added to iOS, and now one of my class names conflict with one of theirs. Kaboom. If you go the no-prefix route, your…

So you work on GCC and are complaining about mostly legacy C things?

What?

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

#54
post #44
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…

Standard constructor boilerplate is simpler: if (self = [super init]) { /* do the init */ } return self; Huge advantage of this is that you can implement object pools, singletons, etc. transparently.

Standard constructor boilerplate is simpler:

You just wrote exactly the same thing I did, but in a style that triggers GCC warnings regarding using assignment as a truth value.

Huge advantage of this is that you can implement object pools, singletons, etc. transparently.

You might consider looking into Newspeak constructors to see how it can be (much) better done, with much less code.

In short, treat constructors as class methods, allow them to be used interchangeably, support self-types so that you can't get selector conflicts, enforce calling of the constructor so you don't have to rely on documenting the designated initializer.

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

#55

He is at the first stage of Cocoa development. Learning a new language is fun, and you can create some really cool stuff with the Cocoa frameworks. But once that wears off you are left with Objective-C, a vestigial language that isn't suited for a majority of application development. Here are some reasons I think Objective-C needs to be retired: - Header Files: These are archaic and require you to repeat code unneces…

Am I the only person in the world who happened to like header files? It's a nice tool (for me) to separate interface declaration from modules/classes, so it's much easier to navigate massive codebases without the help from IDE. Seriously, how would you get a list of all functions in a module without an IDE? Besides, I put all my documentation into h-files as well, so other devs can pretty much see what I am doing wit…

No I'm with you re: header files.

These "people" don't also seem to get when you distribute a lib, you need to distribute headers with them.

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

#56
post #53
post #49

Earlier quoted context omitted.

As someone who does a ton of Objective-C, I challenge the notion that namespaces are even remotely necessary ... Apple is now suggesting that you use three-character class name prefixes, since they claim all the two character ones. I had my two character prefix claimed by a new private framework Apple added to iOS, and now one of my class names conflict with one of theirs. Kaboom. If you go the no-prefix route, your…

So you work on GCC and are complaining about mostly legacy C things? What?

Just because I have the perspective to understand what's wrong with a language doesn't mean I can't or won't use it when it is the correct solution in a specific problem domain.

If Apple developed a first-class alternative to ObjC I would switch in a heartbeat. In the meantime -- to write Mac/iPhone apps -- I will continue to use it.

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

#57

The discussion for another article on the front page discusses why, even today, many developers prefer C-family languages over Java for developing user interfaces, because of unpredictable delays in responsiveness with garbage controlled languages. In that context, Objective C is the closest you will find to a best of both worlds language for responsive user interfaces. Being a strict superset of C, you can control t…

You can easily get unpredictable delays in responsiveness with reference counting too. How can you be sure releasing that reference isn't going to unleash the teardown of some huge data structure?

If it does than you are doing something incredibly wrong.

I'm really starting to doubt the intelligence of HN.

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

#58
post #47
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'm otherwise mainly a Rubyist, but I have to say that on the whole I really like the verbosity of Cocoa, because I find it's generally the right sort of verbosity: it's there to clearly and unambiguously describe what's going on. The stringByReplacingOccurencesOfString:withString: method, as mentioned in the article, is a great example of that: three cheers for it!

When I speak of verbosity, I'm more referring to the need to repeat yourself and turn simple tasks into heavyweight ones via required boilerplate.

The long method names don't bother me.

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

#59

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.

It's making me feel old too.

GET OFF MY LAWN YOU DAMN KIDS WITH YOUR FANCY PYTHON.

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

#60
post #57

Earlier quoted context omitted.

You can easily get unpredictable delays in responsiveness with reference counting too. How can you be sure releasing that reference isn't going to unleash the teardown of some huge data structure?

If it does than you are doing something incredibly wrong. I'm really starting to doubt the intelligence of HN.

s/than/then/g
Post reply on HN