Slashdot Mirror


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

31 of 351 comments (clear)

  1. Tiobe also explains how it determines it rankings by Colin+Smith · · Score: 5, Funny

    Don't they just google it like the rest of us?

     

    --
    Deleted
  2. What language for business logic? by tepples · · Score: 4, Interesting

    There is one popular computing platform that requires all programs to be written in Objective-C. There is another popular computing platform that requires all programs to be written in one of the many languages that compile to verifiably type-safe CLR bytecode, but Objective-C is not one of those languages. So if I want to develop an application for both of these platforms, in what language should I express the business logic of the application so that it can be automatically translated into Objective-C and into a CLR-friendly language?

    1. Re:What language for business logic? by 0racle · · Score: 5, Insightful

      I believe the answer is C.

      The answer is always C.

      --
      "I use a Mac because I'm just better than you are."
    2. Re:What language for business logic? by pauljlucas · · Score: 4, Informative

      I thought Apple allowed a few other languages, like plain C/C++...

      They do, but if you want to use any of the functions for things like, say, UI, you need to use Objective-C at some point because their API is only in Objective-C.

      --
      If you reply, do so only to what I explicitly wrote. If I didn't write it, don't assume or infer it.
    3. Re:What language for business logic? by dgatwood · · Score: 4, Insightful

      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.

    4. Re:What language for business logic? by Moridineas · · Score: 4, Informative

      I think you must be confused. That would be pretty hard to do, since Objective C is a superset of C! In any case, you're explicitly wrong:

      The clause, section 3.3.3, now reads:

      "Applications may only use Documented APIs in the manner prescribed by Apple and must not use or call any private APIs. Applications must be originally written in Objective-C, C, C++, or JavaScript as executed by the iPhone OS WebKit engine, and only code written in C, C++, and Objective-C may compile and directly link against the Documented APIs (e.g., Applications that link to Documented APIs through an intermediary translation or compatibility layer or tool are prohibited)."

      (http://www.appleinsider.com/articles/10/04/08/apples_iphone_4_sdk_license_bans_flash_java_mono_apps.html)

    5. Re:What language for business logic? by Moridineas · · Score: 4, Insightful

      Somewhat interesting to look at (e.g.) the Wolfenstein 3D iphone code...to see just how little Objective-C there can be!

    6. Re:What language for business logic? by TheRaven64 · · Score: 4, Interesting

      No you can't. Well, you can (in theory, except that back end is painfully buggy), but you also need to use Clang and LLVM to compile an Objective-C runtime for the CLR. You can't compile the Apple one, because it contains per-platform assembly for the message sending, but you can (in theory) compile the GNU one, which is portable. You then end up running one object model on top of another object model, with two conflicting memory models. If anything nontrivial works, you deserve a prize.

      (I am the maintainer of the GNUstep Objective-C 2 runtime and the author of the GNU runtime support and a few other bits of Objective-C in Clang).

      --
      I am TheRaven on Soylent News
  3. Re:Where are the C development jobs? by localman57 · · Score: 4, Insightful

    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.

  4. Re:Where are the C development jobs? by ClosedSource · · Score: 4, Funny

    Unfortunately the number of projects that require people who can program right down to the metal has also been dropping each year.

  5. Re:Tiobe also explains how it determines it rankin by IamTheRealMike · · Score: 5, Insightful
    Indeed they do:

    The ratings are calculated by counting hits of the most popular search engines. The search query that is used is

    +"[language] programming"

    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.

  6. Objective-C jumped up on the basis by ClosedSource · · Score: 4, Funny

    of all the posts on Slashdot saying how much it sucks.

  7. Re:Where are the C development jobs? by localman57 · · Score: 4, Informative

    On the higher end platforms, this is true. Projects based on ARM, PowerPC, Infineon Tri-Core, etc projects are definately using a higher level of abstraction, with more developers programming at those levels, and a small number working in device drivers and board-support packages. \ But the flipside is that intellegence is being distributed into lots of devices (automotive being the best example, but also appliances, utility meters, medical devices, etc). Most of these run on small, self-contained micros which cost only a few dollars. C is far and away the language of choice on these platforms. Developers with the knowledge to allow you to get every last drop of performance out of a $2.37 micro, so you don't have to buy the $2.52 one, are in great demand. When you build 100,000 of something, you can afford some up-front development cost to save $.15

  8. Most popular language isn't C by AdmiralXyz · · Score: 4, Funny

    If Tiobe's website is to be believed, the #1 programming language right now is Whitespace.

    --
    Dislike the Electoral College? Lobby your state to join the National Popular Vote Interstate Compact.
  9. Re:Where are the C development jobs? by Chris+Burke · · Score: 4, Funny

    Where are the C development jobs? I have strong C skills, but everything is Java/C++/PHP/Ruby/worse.

    Worse? Fortran? Cobol? Ada?

    Dare I say, Intercal?

    Brainfuck?!

    --

    The enemies of Democracy are
  10. Re:Tiobe also explains how it determines it rankin by chargersfan420 · · Score: 5, Funny

    Agreed. My first thought was, "Yay, I'm not the only idiot out there programming with VB!", but after reading that, it's more like, "Yay, I'm not the only idiot out there having problems coding with VB!"

  11. It doesn't exhibit natural popularity. by Anonymous Coward · · Score: 4, Insightful

    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.

    1. Re:It doesn't exhibit natural popularity. by TheRaven64 · · Score: 4, Informative

      But more than the language I enjoy Apple's APIs. They are very consistent and nicely done. I know it wasn't always like this

      You might be surprised. Take a look at the OpenStep specification and see how much is familiar. Apple has filed off a few rough edges, but a lot of Cocoa has not changed in almost two decades.

      --
      I am TheRaven on Soylent News
  12. Re:Where are the C development jobs? by Locke2005 · · Score: 4, Funny
    --
    I've abandoned my search for truth; now I'm just looking for some useful delusions.
  13. Re:Where are the C development jobs? by DrXym · · Score: 4, Insightful
    Go for a C++ job then. Or suck it up and learn a few languages.

    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.

  14. Dinosour language by Nightlight3 · · Score: 5, Informative

    After about two years programming Obj-C/Cocoa for iPhone apps, I can't believe that this ancient experiment in OOP by an amateur compiler writer is still around. Even though it is nominally a compiled language, all the calls to methods as well as accesses to class properties are interpreted -- the name of the method & its args (args have names) is looked up in a hash table by runtime interpreter to find the address, then to push args and call it, every time you invoke it or access a property. The Obj-C creator basically didn't know how to code linker-loader address binding and so he just left that part for the runtime to decode on millions of end users CPUs from there on. He also didn't know about name mangling, and left that part of his job for the future programmers to do manually (method names and args are explicitly named, so you end up with arg named calling methods like [obj method:arg1 count:count]). For adding properties to a class you have enter the same info in triplicate (variable delcaratiom, property declaratiom, getter/setter declaration), so there is lots of cut & paste, doing by hand the job that compiler should have been doing. The syntax is very clunky, inelegant, uneconomical on programmer's time e.g. requiring lot's of jumping back and forth to match/complete nested square brackets, again simplifying compiler writer's job at the expense of busy work for countless programmers from there on.

    In addition to performance & narrow technical issues, the worst fundamental flaw of Obj-C is that the creator didn't understand the value of name space partitioning in OOP (the key tool for building layers of abstraction), so much of that's left largely to programmers, which in Cocoa (API, like win32) resulted in mind-numbing hyper-verbosity, with each class and method names dragging huge repetitive prefixes, with each name spelling out explicitly its whole ancestry back to the stone age. While the Xcode editor is doing heoric efforts in trying to guess what you meant and offer auto-completion of the names as you type, that is the lesser half of the problem (you still end up doing lots of cut & paste of the Cocoa names). The main drawback is when trying to read or modify the code later -- even the simplest algorithm looks complex, any pattern specific to the task at hand is drowned in the mind-numbing sea of repetitive Cocoa verbiage.

    In short, horrible language & API framework. Only someone who grew up with this and never knew anything better could love it. Of course, like everything Apple, buried under the idiotic Coca+Obj-C layer, there are gems of genius, especially the extremely well thought out functionality and high performance graphics & animation engines.

    1. Re:Dinosour language by binary+paladin · · Score: 4, Informative

      I have tried multiple times to get into Objective-C and Cocoa. I just can't do it and Objective-C is why. It's a shitty language with an even shittier syntax.

      You would think Objective-C 2.0 would have made a greater leap in terms of usability (like adding namespaces), but it didn't. We got garbage collection... which isn't even used in iPhone programming!

      As much as I tend to detest Microsoft, I would love to see C#, or a language like it, become more widespread. As far as syntax goes, it's my favorite take on OOP + C.

    2. Re:Dinosour language by mini+me · · Score: 4, Informative

      all the calls to methods as well as accesses to class properties are interpreted

      That is the feature, along with dynamic typing, that makes Objective-C a perfect match for interface programming. Being able to load classes and call methods from string identifiers reduces the amount of code needed considerably when compared to languages that use early binding. Have fun re-implementing something like KVC/KVO in C++.

      Objective-C's problems stem from the fact that it must be able to compile all valid C code. This severely limits the syntax available. Ruby is essentially Objective-C without the C syntax, if you are curious about the difference syntax makes.

    3. Re:Dinosour language by Sycraft-fu · · Score: 4, Insightful

      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.

    4. Re:Dinosour language by Homburg · · Score: 4, Informative

      Apple did make a new language, intended (thought not actually used) for the Newton. The Dylan language is basically Lisp with a more conventional, Algol-like syntax; it's a pretty gorgeous language, and I wish it had been successful.

    5. Re:Dinosour language by wsgeek · · Score: 5, Informative

      I understand why you might think this way, but realize that the language was created by a pretty smart guy -- Dr. Brad Cox -- and he had one main goal in mind: Be a strict superset of C (not even C++ does this: http://en.wikipedia.org/wiki/Compatibility_of_C_and_C%2B%2B#Constructs_valid_in_C_but_not_C.2B.2B)

      He also wanted it to be truly object-oriented and dynamic in every sense. Your comment therefore has some innaccuracies / unfairness to it:
      "The Obj-C creator basically didn't know how to code linker-loader address binding"

      This is by design. It allows dynamic messaging. You can even, for example, send a message to nil and everything is fine.

      "He also didn't know about name mangling"

      Again, only something you need in a statically linked object-inheritance style language like C++.

      "method names and args are explicitly named, so you end up with arg named calling methods like [obj method:arg1 count:count]"

      Again, by design. Named arguments makes Objective-C one of the best languages for code readability. You don't have to wonder what the arguments are!

      "For adding properties to a class you have enter the same info in triplicate"

      Good point -- this is frustrating even in ObjC-2.0. They should get rid of @synthesize and do it automatically.

      "the creator didn't understand the value of name space partitioning in OOP"

      Dr Cox certainly understood. He just wanted to keep things as close to "pure" C as possible, and had a different way of partitioning spaces -- use 2 letter codes. This is primitive but surprisingly effective, and why all Cocoa objects begin with NS. Think of all the typing this saves, and you never have to wonder what namespace context you're in.

      "mind-numbing hyper-verbosity"

      I agree that the Cocoa library objects / methods are verbose, but this is a GOOD thing. Also, other more recent languages do the same with there libraries, for example: http://msdn.microsoft.com/en-us/library/system(v=VS.100).aspx

      "While the Xcode editor is doing heoric efforts in trying to guess what you meant "

      I agree 100% with you -- Code completion in XCode needs to improve

      "you still end up doing lots of cut & paste of the Cocoa names"

      100% agreed -- XCode needs to have something better than their macro insertion stuff to save me a lot of typing.

    6. Re:Dinosour language by DragonWriter · · Score: 4, Informative

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

      Objective-C is a strict superset of C, so anything that can use Ojective-C can use C as well.

      Apple didn't "feel a new language was needed" for Mac OS X and adopt Objective-C; Mac OS X is, in large part, a repackaging of NeXTstep, for which Objective-C was always the primary language. NeXTstep adopted Objective-C (NeXT didn't invent it, though, they licensed the existing language) in 1988 when both it and C++ were young languages, neither one of which had much penetration.

    7. Re:Dinosour language by maccodemonkey · · Score: 4, Insightful

      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.

    8. Re:Dinosour language by furball · · Score: 4, Insightful

      I've never understood why Apple has such an obsession with Objective C

      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.

  15. he was emulating SmallTalk dynamic binding by peter303 · · Score: 4, Informative

    Steve Jobs had enticed Xerox Parc people to Apple, then NeXT. So this methodology seemed advanced at the time. Also Objective-C was commercially supported while C++ was still basically an open-source hack in the mid-1980s. I was an independent NextStep developer. It was unclear what would win. But as usual cheap and open beat a language you had to buy.

    When NeXT took over Apple (oops I mean the other way around :-), the new MacOS was NexTStep layered with old Mac APIs.

  16. Re:Strict Superset? by DragonWriter · · Score: 4, Informative

    Sorry to troll, but what exactly is a "strict superset"? A superset is a set that contains another set, in this case Objective-C contains C; all of it. If it didn't contain all of C, then it wouldn't be a superset at all. So what makes a superset strict?

    A simple analogy:

    "Strict superset" is to "superset" as ">" is to ">=".