News for hackers. Stuff that matters.
Re:Objective-C overtakes C++ to become 3rd most popular lang... by cageface on Thursday July 05, 2012 @02:04AM (#4201912)
Even taken with a large grain of salt as the TIOBE rankings must be, this is unfortunate since Obj-C is a pretty poor language, IMO.

After a year of working almost exclusively in Obj-C I still haven't come to enjoy its verbosity and awkward and incomplete collection classes. The lack of namespaces and inadvertent selector overloading are a regular nuisance. And the Cocoa frameworks are more dynamic than they need to be and heavy use of notifications and KVO make code a rat's nest of indirect jumps that are very hard to follow.

It's ok as a widget glue language, I suppose, but really a lot of other languages could serve that purpose just as well without standing over the flaming pit of C all the time.

The new collection literals and operator overloads for the collection classes will help, of course. And you have to give Cox some credit for a design that was, in its time, quite visionary. But language design has caught up to and passed Obj-C by in the meantime. If it weren't for my reservations about having one more software layer between me and the machine I would have moved to MonoTouch/C# a long time ago.

Re:Objective-C overtakes C++ to become 3rd most popular lang... by zoul on Thursday July 05, 2012 @03:27AM (#4202099)
I think that Objective-C is pretty sweet.

The problem is that you can’t cherry-pick language features. Each of them has implications for the rest of the language, forcing you into some compromise. As an example, when Objective-C picked great compatibility with C, it picked some great strengths (using existing C libraries, language familiarity, being close to the metal) along with some downsides. For me, the Objective-C strengths are worth the downsides.

Some of your points are purely subjective. I would pick Objective-C verbosity again, because it makes me think less. I can generally parse long words at a glance and code completion saves me typing. Some identifiers are too long indeed, but the consistency is a win. For me.

I don’t see what’s so awkward about collection classes and you don’t say what is that you miss. Granted, the collection literals are too verbose, but that will get much better with the upcoming Xcode release, just as you said. And even the older, verbose syntax is not a language deal-breaker for me.

KVO and notifications are not always roses, but can you give an example of what bugs you along with a solution in a different language that you consider superior?

Again, my main point is that each language design is a compromise and I quite like the compromise represented by Objective-C. Namely, the simplicity of the language, the balance between the metal and a higher-level language, the readable syntax and the standard libraries.

Re:Objective-C overtakes C++ to become 3rd most popular lang... by cageface on Thursday July 05, 2012 @03:41AM (#4202133)
Langauge preference is always subjective. That said, IMO:

C compatibility is a double-edged sword. For most apps it's more of a liability than a benefit. Always being one pointer error away from writing all over memory is not a good thing. Being forced to manually deal with headers and include directives in 2012 makes me sad. Not necessary in Java/C#/etc.

ARC makes memory management a lot less of a pain but you really still need to understand retain/release and weird issues pop in things like blocks, complicating their already ugly (compared to C#/Java lambda, Ruby, Python etc) syntax.

Picking apart a long selector invocation takes a lot more effort than just parsing a typical function call. In languages like Python or C# you can use explicit argument labels if you really need them instead of all the time.

Collections are going to be less painful with the new literals and autoboxing but they're still really crude compared to C++ stl, for example.

Most of what you can accomplish with KVO and notifications can be done with more explicit listener/delegate arrangements and that kind of code is a lot easier to understand too. There's nothing keeping you from doing that in Obj-C but the KVO way is pretty ingrained in Cocoa, just like informal protocols used to be.

Re:Objective-C overtakes C++ to become 3rd most popular lang... by nevster on Thursday July 05, 2012 @03:39AM (#4202126)
Also, any Objective-C developers should definitely try out AppCode from JetBrains - http://www.jetbrains.com/objc/
Re:Objective-C overtakes C++ to become 3rd most popular lang... by cageface on Thursday July 05, 2012 @03:43AM (#4202137)
AppCode definitely makes things a little less painful.

Unlike XCode, it even gives you pretty decent refactoring, which is impressive considering how hard that is in a language with a preprocessor.

Re:Objective-C overtakes C++ to become 3rd most popular lang... by terhechte on Thursday July 05, 2012 @03:57AM (#4202162)
Agreed, I use it for all my Objective-C stuff. And it has fantastic VIM bindings. Being able to code Objective-C with VIM bindings and full auto completion is just awesome.
Re:Objective-C overtakes C++ to become 3rd most popular lang... by notinfinland on Thursday July 05, 2012 @05:00AM (#4202270)
No it's not. After the major Obj-C hype on HN I decided to learn it and was very disappointed.

1. C compatibility is a liability, not a benefit. Every language that has build on C is full of corner-cases, warts and undefined behavior. Obj-C is the worst since it didn't fix anything about C, it just nailed objects on top of it.

2. The syntax is horrible. People rush to say that this is not important, but it's HUGELY important since it's the only way that you interface with the machine, the text that you read and modify for the entire lifetime of the software - which could be years or even decades. Brad Cox failed to anticipate how object orientation would look like in future programming languages. Most languages either extended the C syntax for the object oriented part or got rid of the baggage. B.C brought us the e-mail symbol and writing + and - in front of all your member functions. e.g:

* You have to write @interface and @implementation and @end because apparently it was too much work to write a decent contextual parser.

* @"char" instead of automatic conversion

* @ as placeholder in string formatters. I see a pattern here...

* You must use () around return types. This is piss poor programming language design: thanks to the +'s and -'s you already know you're looking at a non-C function, but let's make the programmer dance around like a little monkey.

* Must use pointer syntax even though you're forced to use pointers to objects anyway. Java and C# got this right.

* No operator overloading. Where is your Smalltalk now?

* Namespaces?

* many other examples

Obj-C assumes that it can offload the boring tasks to the programmer because such was the fashion in the 70s and 80s.

3. Verbosity does not help at all. You have to spend more time reading code, understanding code, writing code. If it has more LOC, it's harder to maintain, this is a proven fact.

4. The type system is as weak as C's, but dynamic typing makes it even more fragile.

5. Memory management in iOS is too complicated. Even with ARC you still have to do manual memory management in some cases. The fact that I call retain and release is not much better than calling malloc and free. Heck, it's easy to do similar reference counting in C. Several studies (please Google) have reported that iOS dev is more time consuming than Android and this matches the reports that I got from companies/people doing cross-platform dev. Obj-C is more complicated to program in than Java, in no small part due to memory management.

The final nail in the coffin is that this programming language is all but owned by Apple. The only reason to use it is if you're doing iOS development, but even there we're thankfully starting to see some alternatives such as Ruby and C#.

Re:Objective-C overtakes C++ to become 3rd most popular lang... by overcyn on Friday July 06, 2012 @08:23AM (#4207422)
> If it has more LOC, it's harder to maintain, this is a proven fact.

Its a proven fact that given 2 programs, the one with more LOC will be harder to maintain?

Re:Objective-C overtakes C++ to become 3rd most popular lang... by notinfinland on Monday July 09, 2012 @06:32AM (#4217486)
It is not mathematically proven, but there are studies that indicate this (e.g Code Complete provides some)

This assumes that the code bases are of similar quality.

Re:Objective-C overtakes C++ to become 3rd most popular lang... by overcyn on Saturday July 14, 2012 @03:48AM (#4243508)
> there are studies that indicate this

So... not a proven fact at all. More like a vague correlation with assumptions tacked to the end.

Re:Objective-C overtakes C++ to become 3rd most popular lang... by batista on Thursday July 05, 2012 @01:00PM (#4203830)
>Obj-C assumes that it can offload the boring tasks to the programmer because such was the fashion in the 70s and 80s.

You seem to forget that it was created in the 80s.

You also seem to forget that it was picked in part because of it's performance characteristics, including the ability to drop down to pure C, for stuff like OpenGL etc.

In general, your complain is an repeat of "it's not high level enough as the languages I normally use".

Re:Objective-C overtakes C++ to become 3rd most popular lang... by petercooper on Wednesday July 04, 2012 @11:54PM (#4201681)
Though on the same chart Ruby is climbing while JavaScript falls. Being involved with both, that's certainly not how it's playing out on the ground.. (Yes, yes, the old story about TIOBE being useful for trends and not absolutes.. :-))
Re:Objective-C overtakes C++ to become 3rd most popular lang... by damian2000 on Thursday July 05, 2012 @12:29AM (#4201744)
Yeah ... agreed. I can't understand how Perl could be above JS either.
Re:Objective-C overtakes C++ to become 3rd most popular lang... by charliesome on Thursday July 05, 2012 @01:19AM (#4201831)
You underestimate just how much Perl there is out there (hint: a lot)
Re:Objective-C overtakes C++ to become 3rd most popular lang... by se85 on Thursday July 05, 2012 @01:37AM (#4201869)
I'm sorry but there is no way there could be more perl out there than javascript.

Although I agree that a lot of people underestimate perl generally speaking.

Re:Objective-C overtakes C++ to become 3rd most popular lang... by tjogin on Thursday July 05, 2012 @02:44AM (#4202016)
How about the fact that Visual Basic tops both?
Re:Objective-C overtakes C++ to become 3rd most popular lang... by minikomi on Thursday July 05, 2012 @03:28AM (#4202105)
And Logo is above bash..
Re:Objective-C overtakes C++ to become 3rd most popular lang... by craigvn on Thursday July 05, 2012 @12:35AM (#4201753)
Shows how pointless TIOBE is. C++ is still light years ahead of Objective-C use in the field.
Re:Objective-C overtakes C++ to become 3rd most popular lang... by wsc981 on Thursday July 05, 2012 @12:44AM (#4201775)
In which field? Surely Objective-C & Apple's frameworks are much more suited towards general purpose mobile apps? And surely C++ is much more suited towards e.g. games?
Re:Objective-C overtakes C++ to become 3rd most popular lang... by jlarocco on Thursday July 05, 2012 @01:44AM (#4201879)
How about anything that isn't developed solely for iPhone/iPad?

Objective-C is high on the list because it's trendy to write iPhone apps, so people blog about it and write a million "How to get started with objective-C" tutorials for it.

Outside of that niche, and a really small group of OSX developers, there's zero Objective-C development. It's barely even possible to write Objective-C on Windows or Linux.

Re:Objective-C overtakes C++ to become 3rd most popular lang... by terhechte on Thursday July 05, 2012 @03:58AM (#4202165)
On Linux, Gnustep offers a really good Objective-C stack.
Re:Objective-C overtakes C++ to become 3rd most popular lang... by chmike on Thursday July 05, 2012 @01:31AM (#4201851)
Most used is not the same as most popular !

People use objective-C when programming for iOS or iPhone. These are popular, not the programming language.

Re:Objective-C overtakes C++ to become 3rd most popular lang... by veyron on Thursday July 05, 2012 @01:40AM (#4201872)
At this stage there are alternatives like PhoneGap or RubyMotion, allowing you to bypass objc entirely
Re:Objective-C overtakes C++ to become 3rd most popular lang... by pacomerh on Thursday July 05, 2012 @03:39AM (#4202125)
The language ranking is driven by the product created with it. And this table makes me think that mastering a lower positioned language just makes you more special.
Re:Objective-C overtakes C++ to become 3rd most popular lang... by Skywing on Thursday July 05, 2012 @12:31AM (#4201747)
Crap. Time to switch to C.
Re:Objective-C overtakes C++ to become 3rd most popular lang... by nevster on Thursday July 05, 2012 @12:43AM (#4201771)
Usual caveats about taking TIOBE with a grain of salt...
Re:Objective-C overtakes C++ to become 3rd most popular lang... by robert_nsu on Thursday July 05, 2012 @01:50AM (#4201885)
I glance at TIOBE from time to time. My biggest gripe is just because a language is searched does not mean it's being used.
Re:Objective-C overtakes C++ to become 3rd most popular lang... by thetabyte on Thursday July 05, 2012 @01:05AM (#4201807)
Do that many people still use Visual Basic? Honestly, I'd like to know. I'd think surely that group of people would be on C#/.NET?
Re:Objective-C overtakes C++ to become 3rd most popular lang... by yen223 on Thursday July 05, 2012 @01:30AM (#4201849)
There's still a lot of legacy software running VB, e.g. the camera software that I'm currently working with now. Software written in VB.net for the most part plays nicely with C#.net, so there's no hurry to upgrade.

I find it hard to believe that it actually _increased_ in ranking though.

Re:Objective-C overtakes C++ to become 3rd most popular lang... by aeurielesn on Thursday July 05, 2012 @01:48AM (#4201884)
You will be surprised how used/popular VB6 is. Some results from a Microsoft's VB6 survey on [1].

[1]: http://stackoverflow.com/a/637671/417685

Re:Objective-C overtakes C++ to become 3rd most popular lang... by veyron on Thursday July 05, 2012 @01:36AM (#4201862)
Not really surprising: Except for some very limited cases, I found that python performance is comparable to C++ performance for solving problems (obviously using python/C++ idioms where relevant). I rarely use C++, opting for C for performance reasons.
Re:Objective-C overtakes C++ to become 3rd most popular lang... by charliesome on Thursday July 05, 2012 @01:56AM (#4201901)
> Except for some very limited cases, I found that python performance is comparable to C++ performance for solving problems

I have a hard time buying this. What cases have you found where Python is comparable to C++?

Re:Objective-C overtakes C++ to become 3rd most popular lang... by cageface on Thursday July 05, 2012 @02:05AM (#4201918)
Python is comparable to C/C++ when the code you write spends most of its time in the many Python libraries which are written in C.

If your program spends most of its time actually executing code in Python then a comparable C++ implementation will probably be two or more orders of magnitude faster.

Re:Objective-C overtakes C++ to become 3rd most popular lang... by mseepgood on Thursday July 05, 2012 @02:10AM (#4201927)
When he uses NumPy that is implemented in C.
Re:Objective-C overtakes C++ to become 3rd most popular lang... by eswangren on Thursday July 05, 2012 @02:19AM (#4201956)
And by "limited cases" I assume you mean "performance critical code"?
Re:Objective-C overtakes C++ to become 3rd most popular lang... by veyron on Thursday July 05, 2012 @09:33AM (#4202922)
even in performance critical code, unless you are doing some very aggressive bit twiddling or assembly-level optimizations, python can hold its own.

Although at that point, C is easier to work with ...

Re:Objective-C overtakes C++ to become 3rd most popular lang... by mhd on Thursday July 05, 2012 @12:43AM (#4201772)
Given the peculiarities of Tiobe, I'm more surprised about Ada being on the list at all.
Re:Objective-C overtakes C++ to become 3rd most popular lang... by yen223 on Thursday July 05, 2012 @01:32AM (#4201856)
Out of curiosity, who uses Ada? The DoD?
Re:Objective-C overtakes C++ to become 3rd most popular lang... by ricardobeat on Thursday July 05, 2012 @01:57AM (#4201902)
The aerospace industry, traffic control, railways, industrial automation, banks and the military.

http://www.seas.gwu.edu/~mfeldman/ada-project-summary.html

Re:Objective-C overtakes C++ to become 3rd most popular lang... by mhd on Thursday July 05, 2012 @02:55AM (#4202040)
It actually was mandatory in the past for some DoD projects. Not anymore, for quite a while, which is why I'm surprised. It's never been a hip language, and so I would expect Ada engineering positions to be somewhat like Cobol jobs, i.e. maintenance and legacy. And thus not as likely to appear on things like Tiobe.

It's an interesting language, worth a look.

Re:Objective-C overtakes C++ to become 3rd most popular lang... by stewie2 on Thursday July 05, 2012 @01:09PM (#4203869)
I really like objective-c. I think my perfect language should be something between C++ and objective-c.