News for hackers. Stuff that matters.
Re:Why did Objective-C never catch on? (Ask Slashdot, Aug 2000) by Tichy on Friday March 30, 2012 @06:21AM (#3775239)
Is Objective-C really popular now? I mean would people volunteer to use it, if they weren't forced by Apple?

One indicator would be that there would be ports of Objective-C to many platforms, is that the case?

Re:Why did Objective-C never catch on? (Ask Slashdot, Aug 2000) by w0utert on Friday March 30, 2012 @08:31AM (#3775604)
The way you state it is a little negative, but it's an interesting question nonetheless. I think Objective-C would not have been on many developers radar if it weren't for the fact that Apple frameworks use it extensively (they don't 'force it on you' by the way, as you can easily use C or C++ for anything except interfacing with Obj-C frameworks).

That said, Obj-C for me is very much an acquired taste. I had seen it a few times before I started developing iOS applications, and on the surface, it never appealed to me at all. The idea to use it for anything never even crossed my mind, and looking at the sad state of GNUstep usage and the many modern Obj-C features GCC doesn't implement, I'd guess it's not really popular in the FOSS scene either.

Now that I have used Objective-C for some time, it would actually be a serious option anywhere I used to automatically pick C++ before. The more you learn about Obj-C and the more you use it, the more you will like it. It basically has most of the good things of C and C++ without many of their downsides, and it adds some almost Pythonesque dynamic features that are very useful and elegant.

IMO Objective-C deserves a little more credit than 'just the language Apple uses'

Re:Why did Objective-C never catch on? (Ask Slashdot, Aug 2000) by meow on Friday March 30, 2012 @08:45AM (#3775656)
"they don't 'force it on you' by the way, as you can easily use C or C++ for anything except interfacing with Obj-C frameworks"

Unfortunately, since most of the popularity is due to iOS applications - developers have to touch these frameworks at one point or another and that means touching at least a tiny bit of ObjC

Re:Why did Objective-C never catch on? (Ask Slashdot, Aug 2000) by seclorum on Friday March 30, 2012 @08:54AM (#3775686)
Thing is though, with a bit of application of the Toll Free Bridge, you can access those frameworks from C or C++ as well ..

http://www.cocoadev.com/index.pl?HowToCreateTollFreeBridgedC...

Re:Why did Objective-C never catch on? (Ask Slashdot, Aug 2000) by eternalban on Friday March 30, 2012 @08:43AM (#3775652)
I believe Go will eat Objective-C's dessert ("general programming") in the "good things of C and [C related languages]" language category.

I would guess (but don't know the compiler) that Objective-C is a better choice than Go if you want more precise control over memory layout and specially management. But that feature is a PITA when you don't need such control and would much rather the language runtime take care of memory and GC.

Re:Why did Objective-C never catch on? (Ask Slashdot, Aug 2000) by kstenerud on Friday March 30, 2012 @11:18AM (#3776330)
Objective-C supports GC. You can choose to use it or not in OS X. In iOS, there's ARC.
Re:Why did Objective-C never catch on? (Ask Slashdot, Aug 2000) by mpweiher on Friday March 30, 2012 @06:55AM (#3775327)
Objective-C the language has always been extremely portable. Even pre-NeXT there were compilers/runtimes for Atari, Amiga, Mac, DOS/Windows, Unix, QNX, and probably a bunch of other systems I am not aware of.

When NeXT shared their compiler patches and runtime (after some GPL-prodding), Objective-C became part of gcc and available on pretty much any supported platform, especially after the GNU-runtime delivered a portable messenger ( objc_msg_lookup()() vs. objc_msgSend() ).

That's the language itself, but you also need to consider the frameworks implemented in it.

NeXTSTep itself was, of course, ported to Intel, HP-Precision architecture and SPARC. Compiling for other architectures was as simple as checking a box in Project Builder. Later there were OPENSTEP-compatible implementations on Windows and Solaris.

The grand-daddy of the open-source implementations is, of course, GNUStep, though there are a bunch more that have been around for a while such as libFoundaton and mgstep. My current favorite is Cocotron, it allows cross-compilation for Windows and Linux right out of Xcode.

Re:Why did Objective-C never catch on? (Ask Slashdot, Aug 2000) by vpdn on Friday March 30, 2012 @07:03AM (#3775354)
> Objective-C the language has always been extremely portable.

Is there some inherent feature of the language that would make it more portable than others?

Re:Why did Objective-C never catch on? (Ask Slashdot, Aug 2000) by conradev on Friday March 30, 2012 @07:30AM (#3775429)
It sits directly atop C, which, for example, is why C++ is very portable.
Re:Why did Objective-C never catch on? (Ask Slashdot, Aug 2000) by dfox on Friday March 30, 2012 @09:26AM (#3775800)
There is significant difference between C++ and Objective-C in this matter. Implementations of C++ that emit C are almost always implemented as full compilers that targets C as output language, but Objective-C can be easily implemented as quite simple preprocessor on top of C, that has almost no understanding of C's syntax. (traditional Objective-C, ie. without closures and such features)
Re:Why did Objective-C never catch on? (Ask Slashdot, Aug 2000) by matwood on Friday March 30, 2012 @09:26AM (#3775799)
Obj-C is basically C with objects. The first objective-c versions were simply pre-processors that generated C code.
Re:Why did Objective-C never catch on? (Ask Slashdot, Aug 2000) by Tichy on Friday March 30, 2012 @07:03AM (#3775357)
Thanks, didn't know that. I don't think the step-things still have any traction, though (apart from what made it into OS X)?
Re:Why did Objective-C never catch on? (Ask Slashdot, Aug 2000) by Moschops on Friday March 30, 2012 @07:02AM (#3775353)
We've been using it for over a decade (small part of a major defense company). We do not (and have never) targeted any Apple operating systems.
Re:Why did Objective-C never catch on? (Ask Slashdot, Aug 2000) by Moschops on Friday March 30, 2012 @09:19AM (#3775767)
By request, more information.

We never ran any NeXT machines. There was no (and frequently continues to be, thankfully - we've got some good negotiators who manage to convince the customer that picking the language themselves is often not smart) customer requirement on language. As I recall, a number of candidate languages were examined as a replacement for C (which was what we were mostly using at the time) and the lightness of Obj-C, its Smalltalk-like object model and the ease of training newcomers to go from C to Obj-C, were amongst the reasons.

Re:Why did Objective-C never catch on? (Ask Slashdot, Aug 2000) by exim on Friday March 30, 2012 @07:15AM (#3775383)
Very interesting. Could you please give us some more details?
Re:Why did Objective-C never catch on? (Ask Slashdot, Aug 2000) by yardie on Friday March 30, 2012 @09:10AM (#3775736)
Could you give some background on how that decision was made? I've only seen objC used in only a few situations. Usually academic and businesses that bought into NEXT computers. I've met a few neck beards who used it in Linux on GNUStep projects.

Outside of Apple and the few examples I haven't met anyone who has decided that objC was an obvious choice.

Re:Why did Objective-C never catch on? (Ask Slashdot, Aug 2000) by mturmon on Friday March 30, 2012 @05:17PM (#3778134)
objC was common for a time in the NYC financial industry, because of in-house use of NeXT computers.
Re:Why did Objective-C never catch on? (Ask Slashdot, Aug 2000) by zerostar07 on Friday March 30, 2012 @07:22AM (#3775407)
Is that some strategic choice? Like, less danger of being hacked or sth?
Re:Why did Objective-C never catch on? (Ask Slashdot, Aug 2000) by spoiledtechie on Friday March 30, 2012 @08:26AM (#3775591)
Probably a customer requirement. You don't do something for a contract in the government, unless the government requires or asks for it specifically.
Re:Why did Objective-C never catch on? (Ask Slashdot, Aug 2000) by rbarooah on Friday March 30, 2012 @06:25AM (#3775247)
You could make the same argument for other languages - I've never used Java out of preference, but have written 100,000s of lines of it because it was what was required to get the job done in the context.

I still think it's popular.

Re:Why did Objective-C never catch on? (Ask Slashdot, Aug 2000) by Tichy on Friday March 30, 2012 @06:51AM (#3775318)
Perhaps for J2ME development, but apart from that I'd say thousands of companies have individually decided to use Java. Apple is just one company that has decided to use Objective-C.

Edit: I forgot about Android, but Java was "popular" before that - in fact Android probably uses Java because Java was popular...

Re:Why did Objective-C never catch on? (Ask Slashdot, Aug 2000) by rbanffy on Friday March 30, 2012 @07:37AM (#3775446)
My favorite jab here is that thousands of IT managers, after some multi-day infomercial paid by IBM, Sun, BEA or Oracle, decided they'd buy something that limited their developers to Java.

But really, Java is a fine language, not much worse than C++, and, as far as static typing goes, fairly OK. What bothers me most is the insane proliferation of bloated frameworks and tools that Java seems to generate around itself. In order to use several popular tools, you need Eclipse. It's not a bad IDE, but needing an IDE for even basic stuff like building a web app clearly is a symptom of something that went very wrong. Some wrong decisions are really hard to undo.

Re:Why did Objective-C never catch on? (Ask Slashdot, Aug 2000) by mahmud on Friday March 30, 2012 @09:08AM (#3775729)
Java is an excellent language, far superior to C++.

I only use Java SE and Apache Commons libraries, along with a very handful speciality libraries. Very little fuss. I like it.

Re:Why did Objective-C never catch on? (Ask Slashdot, Aug 2000) by davidw on Friday March 30, 2012 @06:57AM (#3775329)
> individually decided

Languages aren't used in a vacuum, and the economics of them involve positive network externalities and switching costs, so 'individually' needs some qualification.

Re:Why did Objective-C never catch on? (Ask Slashdot, Aug 2000) by Tichy on Friday March 30, 2012 @07:07AM (#3775370)
What kind of thing do you mean? I was (to my utter dismay) a Java developer for more than 10 years. Most of the time I worked on business internal projects or J2ME. Seems to me that for internal projects, the businesses could have chosen anything?

Of course there was the hype, the hope to find more developers, the idea that there should be only one language in the company and so on. (All wrong, imo...)

Maybe all those factors could be combined into a single one, "popularity" :-)

Re:Why did Objective-C never catch on? (Ask Slashdot, Aug 2000) by davidw on Friday March 30, 2012 @07:22AM (#3775404)
http://www.welton.it/articles/programming_language_economics

Is something I wrote about it several years ago.

Re:Why did Objective-C never catch on? (Ask Slashdot, Aug 2000) by Tichy on Friday March 30, 2012 @09:39AM (#3775847)
I guess once Apple has created thousands of Objective-C developers (already done), it might become interesting for other things, too. It is a self-feeding loop.
Re:Why did Objective-C never catch on? (Ask Slashdot, Aug 2000) by Daniel_Newby on Friday March 30, 2012 @09:08AM (#3775728)
How can one have "utter dismay" for 10 years? Shouldn't it at least become "hopeless resignation" after the first few years?
Re:Why did Objective-C never catch on? (Ask Slashdot, Aug 2000) by Tichy on Friday March 30, 2012 @09:36AM (#3775837)
Because I suck... I just didn't manage to jump ship yet. I'd take off time for months to work on my own projects but usually failed to finish what I started. Then money would get low and I would accept the next Java contract to make money again. These days I tell the recruiters that I am leaning towards Rails and JavaScript, but in both I don't really have as much experience as with Java. I did some small things with Rails, but I also don't have the killer combination of design sense and coding skill that the younger Rails devs seem to have. Still, I have rejected most Java projects in the last three years. Might grudgingly look into Android, though (I like Android, but I hate Java, as has probably become clear...).
Re:Why did Objective-C never catch on? (Ask Slashdot, Aug 2000) by sek on Friday March 30, 2012 @09:22AM (#3775787)
There is always the point where the ecosystem is the killer feature. Rails made Ruby very popular.
Re:Why did Objective-C never catch on? (Ask Slashdot, Aug 2000) by mattmanser on Friday March 30, 2012 @06:30AM (#3775263)
Could you? Because there's the Mono project for .Net for example. Which seems pretty popular. Where's the ObjC equivalent?
Re:Why did Objective-C never catch on? (Ask Slashdot, Aug 2000) by sambeau on Friday March 30, 2012 @06:35AM (#3775276)
A Mono-a-like is not required as Apple has fully open sourced it. Instead there's GCC, Clang and http://www.gnustep.org/
Re:Why did Objective-C never catch on? (Ask Slashdot, Aug 2000) by gauravk92 on Friday March 30, 2012 @05:15PM (#3778120)
Well the entire stack is open source so no one needs to port it. I'm pretty sure that people like it because, it along with cocoa, makes iOS a great platform to develop apps for. But as for spreading objc, most of the features it has have been in dynamic languages like perl for many years longer. Perl even has objc lib bindings and much better integration in unix, albeit not necessarily for making apps.

I think the popularity of objc is hindered more by the fact that people would be moving a step back, if they were using it for something besides what it's designed for (cocoa apps).

Re:Why did Objective-C never catch on? (Ask Slashdot, Aug 2000) by rbarooah on Friday March 30, 2012 @07:47AM (#3775471)
My point is that the existence of ports is irrelevant. A language is popular if it is used by a lot of people. The choice to use it involves a lot more than language preference.

To claim that objective-c doesn't count as popular because anyone who chooses to write for iOS must use it whether they like it or not, is like saying that java doesn't count as popular because anyone who chooses to develop on an emterprise stack that a corporation has built on java must use it.

Re:Why did Objective-C never catch on? (Ask Slashdot, Aug 2000) by MasterNayru on Friday March 30, 2012 @06:59AM (#3775342)
Also, can you assume that apps that even are in the Apple domain DO use Objective-C enough that it warrants calling the language "popular"? Or are we seeing apps written in another language with a bit of Objective-C to act as glue between the app and Cocoa/iOS?
Re:Why did Objective-C never catch on? (Ask Slashdot, Aug 2000) by coob on Friday March 30, 2012 @07:50AM (#3775482)
Many games are written this way, for sure.
Re:Why did Objective-C never catch on? (Ask Slashdot, Aug 2000) by Tichy on Friday March 30, 2012 @07:08AM (#3775374)
I know that I strongly wish I could do iOS development that way, but I suspect it is not really practical yet :-(
Re:Why did Objective-C never catch on? (Ask Slashdot, Aug 2000) by MasterNayru on Friday March 30, 2012 @07:15AM (#3775386)
I'm just looking at the slew of cross-platform games (eg. the GTA series) that have recently been put on the iDevices and thinking "They wouldn't have rewritten those from scratch, would they?".
Re:Why did Objective-C never catch on? (Ask Slashdot, Aug 2000) by 286c8cb04bda on Friday March 30, 2012 @11:01AM (#3776231)
> They wouldn't have rewritten those from scratch, would they?

I do a lot of cross-platform integration. This is based on my experience. If you know you're going to cover multiple platforms from the beginning, you will do a lot of things to make that a lot easier.

Most of those would be written to target a graphics framework (like OpenGL) for the visual elements. Then, for each platform there will be a host that OS-specific things like file & network access. You can also use libraries to abstract that for you.

So the amount that needs to be rewritten depends on how similar the new platform is to the old ones. Going from PC to iOS would be about 40%. Going to Nintendo Wii, maybe 70%.

Unless the platform is particularly unusual, most of the hard problems were solved in the first release, adding additional platforms is fairly mechanical. So even if you need to replace >50% of the code, you know roughly how you're going to do it before you start.

Re:Why did Objective-C never catch on? (Ask Slashdot, Aug 2000) by sjmulder on Friday March 30, 2012 @08:51AM (#3775678)
I think that Objective-C’s pros, like they way message passing can be used for UI event handling, come to life only with a framework that makes good use of the language’s strengths. People drawn to the language would be likely to stick with the framework.
Re:Why did Objective-C never catch on? (Ask Slashdot, Aug 2000) by canthonytucci on Friday March 30, 2012 @09:41AM (#3775855)
> Is Objective-C really popular now? I mean would people volunteer to use it, if they weren't forced by Apple?

I would say No and No. I'm in agreement with John Siracusa on this one, even with ARC Apple can't hang on to Objective-C forever.

John Siracusa's piece: http://arstechnica.com/apple/news/2010/06/copland-2010-revis...

Re:Why did Objective-C never catch on? (Ask Slashdot, Aug 2000) by w0utert on Friday March 30, 2012 @10:40AM (#3776126)
I fail to see how the article you link to supports your opinion in any way, and neither you or Siracusa offer any arguments why Objective-C needs replacing. At all.

You can summarize Siracusa's piece as 'Objective-C needs automatic memory management, it needs automatic memory management, and all the other popular languages have automatic memory management, so yeah, Objective-C needs automatic memory management'. He then rejects the fact that Objective-C on OS X has had garbage collection for years because 'it is not a no-brainer because not every developer uses it' and because iOS doesn't support it. Guess what, ARC is now the default way of 'managing' memory on iOS and OS X, and it has some very clear advantages over garbage collection. I wrote 'managing' with quotes, because with ARC you don't actually have to do anything as a developer, and if you don't pay attention to anything it is just like writing code in a language that has GC.

So unless you have some actual arguments why Objective-C needs replacing or what important features it is missing that other languages do have, it is very hard to take your 'No and No' very serious.

Just out of curiosity: did you actually ever develop anything non-trivial with Objective-C, and if so, what part of that experience makes you think it people would not use it voluntarily?

Re:Why did Objective-C never catch on? (Ask Slashdot, Aug 2000) by kstenerud on Friday March 30, 2012 @11:25AM (#3776378)
"with ARC you don't actually have to do anything as a developer"

* With the caveat: if you're using blocks, you need to be careful about unintentional circular retains, and sometimes take extra steps to avoid them.

Re:Why did Objective-C never catch on? (Ask Slashdot, Aug 2000) by canthonytucci on Monday April 02, 2012 @03:09PM (#3789589)
I'm an iOS developer at my 9-5, so it certainly could be a case of disliking the thing I am most familiar with.

You seem to be disputing my claim that "people don't like obj-c and wouldn't use it if they didn't have to" on the grounds that it is capable and getting better. I don't think that is enough. It's all just my opinion, I don't think C# has a bright future either.

As for my "No and No".

## My First No - "No it is not popular" - Purely anecdotal

I interpreted popular as "well liked". Those I have met and worked with all seem to view Objective-C as "what we use" not, "language of choice". I know those who have grown to appreciate and even like it, but not a soul who says "Obj-C is my favorite" outside of the context that it makes them the most money. I'm sure objective-c fans exist, but to qualify as "popular" to me, that would have to be the overwhelming majority. I've never met an objective-c person who talks about it with the same grin that a Ruby person wears when they tell you about "unless".

## Second No - "No, I don't think anyone would use it by choice" (stupid internet assumption, anyone == people who think exactly like me)

The reason for this, I think, has more to do with its lack of popularity than anything else (yup, some circular logic, I know). The fact that every mac developer I know already knows at least one other language that they can use everywhere else is I think why they aren't putting forth any effort into developing the community to use Obj-C for other jobs. Why bother? There's already overwhelming support other languages of similar merit, so why opt for the unpopular one?

## My own experience

ARC has been wonderful, and I think it greatly improves the process of getting things from idea to application. However, I still feel like I am writing - or rather tab-completing - too much code to accomplish trivial tasks. There is so much ritual that could be done away with completely. If the most common case is to @synthesize an @property, why am I forced to @type @it @out every time? I understand there are sound, logical, historical origins to many of my frustrations (like separate .h and .m files and having to wear out my 'n' and 's' keys). To be honest, much of my complaining is nothing more than trivial syntax whining, but to me, that is all friction. Here I must also admit that I am probably seeing Obj-C in a negative light because I have to interact with it through XCode. I've tried JetBrains AppCode, but there is so much switching back and forth to XCode for CoreData and Interface stuff that I now just keep it around for a few specific tasks. With Obj-C it's really hard for me to separate the language from the Apple APIs, XCode and the iOS development community, all of which I would consider "take it or leave it" quality. Every once in a while Apple throws you a bone like NSOperationQueue, which is a joy to work with, but again, that's conceptual, not syntactic, it's still a million characters to do anything with it.

I can't think of a reason I would pick it over C for low-level serious business or over $yourSciprtingLanguageOfChoice / (((your-functional-language-of-choice))) for everything else. It's got some cool features, but nothing that overpowers its awkwardness for me.

Re:Why did Objective-C never catch on? (Ask Slashdot, Aug 2000) by pooriaazimi on Friday March 30, 2012 @04:55PM (#3778054)
I was very shocked when I heard old Siracusa bashing ObjC in his rant about the dreadful HFS+ last month (in his terrific podcast, Hypercritical). I didn't know why he didn't like ObjC (I really like it), and I still don't understand why exactly. I've written iOS/Mac apps and am familiar with it. I don't think his critiques are on spot this time.
Re:Why did Objective-C never catch on? (Ask Slashdot, Aug 2000) by glassx on Friday March 30, 2012 @09:11AM (#3775738)
Well, yes, it is popular, and yes, it is popular today because Apple uses it, but still, people are using it in projects that don't have much to do with iOS/OS X, such as Web Frameworks (Frothkit, Bombax) and client-side MVC (Cappuccino).

In this aspect it's similar to C#, and Mono, I think, but in a much smaller scale.