Live data from Hacker News

Stop the Hate: Obj-C Deserves Your Love

intridea.com

71–80 of 91 posts

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

#71
post #48

Earlier quoted context omitted.

And as someone who is currently writing high-performance ObjC code, and who has written internet-scale packets-per-second-metered code in C and C++, I call bullshit on this. I have no doubt that method dispatch is significantly slower than vtables, but you're ignoring the fact that for performant code, plenty of C++ devs believe that vtables are far too slow as well. Large high-performance C-style projects are always…

There's a huge difference between the overhead of a dynamic function call and a vtable lookup. No doubt there are some cases where even a vtable lookup is too expensive but there are millions upon millions of lines of production C++ in high-performance apps that use C++'s vtable dispatch. What language would you choose to write something like Protools, Photoshop, Maya, Visual Studio etc in? Definitely not C and defin…

There's millions upon millions of lines of production code, some of it (for instance, at the financial exchanges) millisecond-optimized, running in Java. What's your point?

Again, I simply call bullshit on the idea that you couldn't write ProTools or Photoshop in ObjC. The portions of those systems where you care deeply about performance can be written most effectively in bare-metal C anyways; it's a delusion of C++ programmers that all the shellac and geritol that C++ offers is giving them a major performance benefit. It's C++ that forces you to make a lifestyle decision by pretending that pointers are anything other than register-sized integers. ObjC is just enough object goop layered over straight C to make large programs maintainable.

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

#72
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 ex…

Are blocks available in the iOS version of Objective-C? (Not trying to refute your point, just curious, since that would be exciting news for me if I do another iPhone app...

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

#73
post #50
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…

> Typically have to deal with two different kind of strings (NS versus C). NSString has plenty of methods to deal with this, and you get boxing for free between CFString and NSString. > The frameworks for those platforms are MEGA verbose. Which some view as self documenting.

NSString has plenty of methods to deal with this, and you get boxing for free between CFString and NSString.

And that pesky char * that you get from C.

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

#74
post #71

Earlier quoted context omitted.

There's a huge difference between the overhead of a dynamic function call and a vtable lookup. No doubt there are some cases where even a vtable lookup is too expensive but there are millions upon millions of lines of production C++ in high-performance apps that use C++'s vtable dispatch. What language would you choose to write something like Protools, Photoshop, Maya, Visual Studio etc in? Definitely not C and defin…

There's millions upon millions of lines of production code, some of it (for instance, at the financial exchanges) millisecond-optimized, running in Java . What's your point? Again, I simply call bullshit on the idea that you couldn't write ProTools or Photoshop in ObjC. The portions of those systems where you care deeply about performance can be written most effectively in bare-metal C anyways; it's a delusion of C++…

I hate C++ as much as the next guy but the idea that the people behind essentially all the performance-critical desktop apps on the planet are just too dumb to move on is quite strange.

Again, I've seen first hand a big, native UI project crash and burn on Obj-C dispatch overhead that is now trucking happily along in C++. Have you?

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

#75
post #72

Earlier quoted context omitted.

"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 ex…

Are blocks available in the iOS version of Objective-C? (Not trying to refute your point, just curious, since that would be exciting news for me if I do another iPhone app...

They're available in iOS4 natively, or can be used with earlier OSs with this project: http://code.google.com/p/plblocks/

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

#76
post #71

Earlier quoted context omitted.

There's millions upon millions of lines of production code, some of it (for instance, at the financial exchanges) millisecond-optimized, running in Java . What's your point? Again, I simply call bullshit on the idea that you couldn't write ProTools or Photoshop in ObjC. The portions of those systems where you care deeply about performance can be written most effectively in bare-metal C anyways; it's a delusion of C++…

I hate C++ as much as the next guy but the idea that the people behind essentially all the performance-critical desktop apps on the planet are just too dumb to move on is quite strange. Again, I've seen first hand a big, native UI project crash and burn on Obj-C dispatch overhead that is now trucking happily along in C++. Have you?

I have never seen an ObjC program crash and burn under the weight of ObjC. I have seen two major C++ projects get rewritten, once to straight C and once to new flavor-of-the-month C++ (from ACE-style objecty GoF-y C++ to Alexandrescu-y template-y C++).

You talk like adoption of C++ is a testimonial to C++'s power. The fact is, the market picked C++. Your realistic choices for bare metal app dev are straight C, which you can use anywhere, or C++, which you can use anywhere. If you want native objects, you're going to use C++.

There are two places where ObjC is even an option:

* On Apple stacks.

* In SaaS/ASP/service backend code.

In both of those places, ObjC is better than C++. If you care about portability, write in C or JVM+C.

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

#77
post #18

Earlier quoted context omitted.

>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.

No it's not. For some programs, it is possible to tell, for others, it most certainly is not.

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

#78
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…

When was the last time you've used C#? The fact you are lumping it in with Java already suggests your C# skills are very out of date. C# is by far the fastest growing mainstream language. C# 3 and now C# 4 require very little boilerplate code. I'm often amazed at how clean and succinct my C# code can become nowadays.

As for UI programming in C#, give WPF and/or Silverlight a try. They both have their downsides, but in the end they offer a far more pleasant experience than Cocoa Touch. I haven't written an MFC app in about 1.5 decades or so.

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

#79

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…

Array literals: This one bugged me too. Try this:

  #define NSDICT(...) [NSDictionary dictionaryWithObjectsAndKeys: __VA_ARGS__, nil]

  #define NSARRAY(...) [NSArray arrayWithObjects: __VA_ARGS__, nil]

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

#80
post #71

Earlier quoted context omitted.

There's millions upon millions of lines of production code, some of it (for instance, at the financial exchanges) millisecond-optimized, running in Java . What's your point? Again, I simply call bullshit on the idea that you couldn't write ProTools or Photoshop in ObjC. The portions of those systems where you care deeply about performance can be written most effectively in bare-metal C anyways; it's a delusion of C++…

I hate C++ as much as the next guy but the idea that the people behind essentially all the performance-critical desktop apps on the planet are just too dumb to move on is quite strange. Again, I've seen first hand a big, native UI project crash and burn on Obj-C dispatch overhead that is now trucking happily along in C++. Have you?

I don't understand the comparison you're drawing. On most platforms, they don't have the option of using Objective-C (support outside the Apple ecosystem could charitably be called "anemic"), and on Apple platforms, most native development is done using Objective-C.
Post reply on HN