Objective-C Enters Top Ten In Language Popularity
bonch writes "Objective-C has entered the top 10 of the Tiobe Programming Community Index. Last year, it was at #39. The huge jump is attributed to its use in iPhone and iPad development. C, of which Objective-C is a strict superset, has reclaimed the #1 spot from Java, which slides to #2. Tiobe also explains how it determines its rankings."
They use search engines to determine this?
Why does this seem odd to me... or even misguided?
Embedded Systems. There's lots of work there. And we're getting more valuable all the time, because Universities are increasingly teaching C#, Java, etc. The number of people out there who can program a microprocessor right down to the metal is dropping each year.
I believe the answer is C.
The answer is always C.
"I use a Mac because I'm just better than you are."
From this I conclude that the results are meaningless. At best it shows that Objective-C programming has resulted in more discussions and questions. Whether it is "popular" or not is a bit more subjective.
All kidding aside, Objective-C isn't the sort of language people use because they want to. Rather, they use it because it's what Apple says they can use.
Back in the NeXT days, we used it because it was far better than anything else out there. But that was 20 years ago. Times have changed, and we have better programming languages available to us. Even with Objective-C 2.0, it's still somewhat of a relic.
So it's popularity isn't natural. It's almost fully artificial, based upon the restricted nature of Apple's platforms, especially the mobile platforms where they've literally "outlawed" everything else.
You will, however, almost certainly not share a single line of UI code between a .Net application and an iPhone application anyway. Even if you could write Objective-C code for .Net, you wouldn't be able to make UIKit calls on the other device, making it a moot point. Likewise, even if you could write code in C# for iPhone, you would not have support for Windows UI calls.
The way you write code in situations like this is an abstraction layer. You write the core code in C or C++, then write an iPhone UI in Objective-C and a WinMo UI in... whatever, and similarly abstract out file reads/writes, etc. You write custom OS-specific code near the boundaries between the OS and your app, then write the core code in a language that's cross-platform.
For maximum convenience, you should also consider using Core Foundation where possible. You can build and include CFLite for the other devices, and as long as you restrict yourself to that subset of the API, you'll be fine. And on the iPhone side, you can then take advantage of toll-free bridging to use most of those CF objects as though they were the equivalent NS (Foundation) objects.
Check out my sci-fi/humor trilogy at PatriotsBooks.
The reason Java and other languages are more prominent these days is because they are more suitable for most business requirements - reliability, scalability, portability etc. Unless an app has to hit the metal, or has hard speed / memory / CPU requirements, chances are C is not the right language to write in any more.
Somewhat interesting to look at (e.g.) the Wolfenstein 3D iphone code...to see just how little Objective-C there can be!
This.
Objective-C has a lot of buzz, since Apple has a lot of buzz. That doesn't mean it is getting used in a lot of projects, just that a lot of people are talking about it. Just because there isn't a lot of chatter online about something, doesn't mean it isn't used.
For example I suspect C++ is actually much higher. Why? Because it is the language of video games by and large. Pretty much any PC and Xbox 360 game are written in C++, usually using Visual Studio. However you don't see a lot of chatter about it online since it is being done professionally and it just kind of an assumed thing in the games industry.
Well, that makes for a rather large amount of apps out there, even if they don't get talked about all that much.
Likewise, though I suspect C is high up on the list due to embedded applications, I think that their data on it is flawed. The reason they see so much is likely Linux, which of course uses a lot of C. Fine, but Linux also gets talked about a lot online, since it is open source. So the amount of discussion it generates in relation to code is much higher than a commercial project.
In general their methods are rather flawed.
I've never understood why Apple has such an obsession with Objective C. To me it really does seem like being different for the sake of being different. In the event they really felt like a new language was needed, well, they should have made one (as MS did in the case of C#). Otherwise it makes sense to use C and C++. They produce fast code, they are well supported, lots of programmers know them, etc. To me it seems highly sensible to use C for extremely low level things (like OS kernels), C++ for speed critical/native apps (like much of the rest of an OS) and then a managed language for those things where speed is not important.
iPhone however does have KVO, KVN, and dynamically generated keys (valueForKey, setValueForKey), all of which doesn't work with linking by address.
You are supposed to write your network code using CFNetwork and BSD sockets. This is as intended. This is also why Cocoa sockets are actually just loosely wrapped CoreFoundation sockets.
Obj-C is like a screwdriver. You're trying to use a screwdriver like a hammer, and then loudly complaining about it. I'm telling you it's a screwdriver, not a hammer, and that's how it's intended.
Obj-C is a language for quickly building GUIs. It's not a language for programming the logic. Apple recommends you use C for logic. Apple codes Cocoa itself in C and C++. Obj-C was in no way and shape build for performance situations. That doesn't mean it's a bad language. The things you regard as deficiencies actually make it an extremely strong language for GUI construction. This is also why Apple doesn't try to force you to use ONLY Obj-C.
Storing objects by name is an EXTREMELY important feature in Obj-C. Yes, it's slow, but as I've said, don't use Obj-C for performance code.
Allow me to explain.
1. Who owns the language spec? What if there was a modification needed to the language to meet the needs of Apple's hardware that's going to be released to consumers? For example, blocks. How fast could Apple introduce something like that if the language spec was owned by ... for purpose of example, Oracle?
2. Who owns the runtime? See question 1.
Objective-C gives Apple the flexibility to make changes as needed to meet their needs without waiting on some standards body or another corporation to get in the way. Apple will not walk away from Objective-C for these reasons.
What? No. What you describe would indeed be stupid, but that's not what happens.
All string literals are shared compile-time constants. You can use @"color" in seven different places and they all refer to the exact same address. So you aren't interpreting ASCII strings, but simply doing a pointer comparison. The only time they need to be parsed is when they are part of a key path, like @"moulding.color", and there is a separate function for evaluating key paths so that the common case is easily optimized.
Furthermore, key values like 13.5 or 2010-May-23 are not stored or passed around in ASCII form, but wrapped in an NSValue object or a subclass, similar to Java's Integer objects.
i'd hit it so hard, if you pulled me out you'd be the king of britain [bash.org]