Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror
×
Programming Apple

Objective-C Enters Top Ten In Language Popularity 351

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."
This discussion has been archived. No new comments can be posted.

Objective-C Enters Top Ten In Language Popularity

Comments Filter:
  • by Colin Smith ( 2679 ) on Wednesday June 02, 2010 @02:48PM (#32436322)

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

     

    • by IamTheRealMike ( 537420 ) on Wednesday June 02, 2010 @02:59PM (#32436472)
      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.

      • by chargersfan420 ( 1487195 ) on Wednesday June 02, 2010 @03:16PM (#32436676)
        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!"
      • by arth1 ( 260657 )

        So they don't count perl hacking, erlang development and assembly coding, then.

        • Re: (Score:3, Funny)

          by blair1q ( 305137 )

          But they do count prime-time programming, which is always more popular than the other kinds.

      • Re: (Score:3, Insightful)

        by Demonantis ( 1340557 )
        I think popular topic would mean popular language at least to some degree. Or for sure that it is a more used language as search results wouldn't discriminate preferences like actually enjoying the language. Neat to see and know, but wouldn't use it for any significant business related decisions is how I see it.
      • by Sycraft-fu ( 314770 ) on Wednesday June 02, 2010 @03:50PM (#32437134)

        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.

        • Re: (Score:3, Interesting)

          by aztracker1 ( 702135 )
          I'd say Java and .Net languages (C#, VB) are probably the most popular in terms of use, mainly because they are the most used for internal business development, which is the majority of dev, just fewer users per app. Though if you count web apps and dev, then Javascript is probably #1
      • Re: (Score:3, Insightful)

        by mdwh2 ( 535323 )

        I also wonder why the story is all about Objective C (complete with the obligatory Iphone and Ipad Slashvertisement), when obviously there are 9 other languages in the top 10. Do they all get a story too? Seems like Slashdot is becoming more and more like an Apple news site...

  • by tepples ( 727027 ) <.tepples. .at. .gmail.com.> on Wednesday June 02, 2010 @02:51PM (#32436350) Homepage Journal

    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?

    • by 0racle ( 667029 ) on Wednesday June 02, 2010 @02:59PM (#32436462)
      I believe the answer is C.

      The answer is always C.
    • Re: (Score:3, Insightful)

      There is one popular computing platform that requires all programs to be written in Objective-C.

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

      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?

      Unfortunately, the answer would probably be XML. Lots and lots of XML. Just make sure it's not Turing-complete...

      A saner answer (but one I like less) is to develop something which compiles Objective-C to CLR. Maybe it'd work at a higher level (compile Objective-C to C#), or maybe at a lower level (translate Objective-C bytecode to CLR), but either way, that's your only option, because the iStuff is the only platform which actually ba

      • by pauljlucas ( 529435 ) on Wednesday June 02, 2010 @03:18PM (#32436714) Homepage Journal

        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.

        • by dgatwood ( 11270 ) on Wednesday June 02, 2010 @03:29PM (#32436846) Homepage Journal

          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.

        • by Moridineas ( 213502 ) on Wednesday June 02, 2010 @03:37PM (#32436950) Journal

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

    • Re: (Score:3, Funny)

      by spazdor ( 902907 )

      Pseudocode.

      (where "automatically" = "delegated to PFY intern.")

    • Re: (Score:2, Informative)

      by fusiongyro ( 55524 )

      If you want to develop a cross-platform app for the iPhone and iPad, you're fucked, so don't bother.

      If you want to develop a cross-platform GUI app for Mac OS X, Linux and Windows, your best bet is probably to use Qt, which means C++.

      • Re: (Score:3, Informative)

        by mdwh2 ( 535323 )

        Note that Qt is now also the standard SDK for Symbian, so you'll also get 50% of the smartphone market anyway.

    • 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

      Dalvik.

      Oh ok then, you want C++ - iPhone can be developer using C/C++, and a subset of C++ can compile to the CLR. Just ignore managed C++ STL, its slow as you can imagine. (yes, and you can write C/C++ apps for Android too). The major thing to remember when architecting your apps is to decouple the GUI so you can slap a C#/Obj/Java GUI on top.

    • Re: (Score:3, Insightful)

      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?

      Quite obviously, a subset of Objective-C that can be compiled to verifiably type-safe bytecode (actually, the correct requirement is "memory-safe"; IL is not particularly typesafe even when it's verifiable - e.g. it lets you declare a union of overlapping int and float, and that will be verifiable).

      Is such a subset possible? I dare say I am an expert on IL, but definitely not on Obj-C, so I couldn't say for sure; but from what I know about it, it's quite possible. All Obj-C constructs seem to be mappable; t

    • Re: (Score:3, Interesting)

      by JoeMerchant ( 803320 )
      I use Qt [trolltech.com], write once (in C++), deploy on Windows, Mac, Linux, Symbian, and any number of embedded systems - with native look and feel, and C++ speed.

      I worked for a "visionary" in 2006 who wanted to start an Objective-C shop, he didn't listen to me when I told him that assimilation into Windows was highly probable - it took 6 months before he realized resistance was futile (not to me, but to the industry at large.) Luckily, we stuck with Qt and the port from OS-X to Windows took about one man-week (lots
  • wha...? (Score:4, Insightful)

    by Mark19960 ( 539856 ) <{moc.gnillibyrtnuocwol} {ta} {kraM}> on Wednesday June 02, 2010 @02:51PM (#32436354) Journal

    They use search engines to determine this?
    Why does this seem odd to me... or even misguided?

  • by ClosedSource ( 238333 ) on Wednesday June 02, 2010 @03:02PM (#32436514)

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

    • by Anonymous Coward on Wednesday June 02, 2010 @03:21PM (#32436740)

      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.

      • by dzfoo ( 772245 )

        I find Objective-C a superior language than other crap I have to deal with at work. C# is a wonderful language, in my opinion, but its ties to the .NET framework limits its platform scope and, to me at least, its appeal.

              -dZ.

        • C# is a wonderful language, in my opinion, but its ties to the .NET framework limits its platform scope and, to me at least, its appeal.

          You have heard of mono [mono-project.com] right?

          • by dzfoo ( 772245 )

            Yes, and it tries to replicate the CLI and the .NET framework, both of which I think suck.

                    -dZ.

      • by ceeam ( 39911 ) on Wednesday June 02, 2010 @03:35PM (#32436920)

        > Times have changed, and we have better programming languages available to us.

        That's interesting. And if I'd ask you to name another compiled language with dynamic message routing/dispatch it would be what? C libs compatibility is desired.

        • And if I'd ask you to name another compiled language with dynamic message routing/dispatch

          Erlang.

      • I know I will get modded troll, but I think with all the bad Apple press and the general shift towards anti-Apple
        that the fanboys are really reaching for anything.. and I mean anything to make it all go away or to paint a better picture.
        It won't be painted in Obj-C... Sorry.

      • Re: (Score:3, Interesting)

        by DarkDust ( 239124 )

        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.

        Well, over the past 20 years I've played around with a lot of languages and a lot of environments and I do enjoy writing in Objective-C. It makes a few neat things that I like easy, like Duck Typing and delegates. 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, and there are still a few dark corners if you really dig into non-common areas, but all in all it really is fun to use. More fun than most C++ APIs, IMHO, and to me also m

    • by blair1q ( 305137 )

      So next quarter's report will be slashdotted. Big whoop.

  • by AdmiralXyz ( 1378985 ) on Wednesday June 02, 2010 @03:08PM (#32436562)
    If Tiobe's website is to be believed, the #1 programming language right now is Whitespace.
  • Dinosour language (Score:5, Informative)

    by Nightlight3 ( 248096 ) on Wednesday June 02, 2010 @03:47PM (#32437088)

    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.

    • Re:Dinosour language (Score:5, Informative)

      by binary paladin ( 684759 ) <binarypaladin@@@gmail...com> on Wednesday June 02, 2010 @04:15PM (#32437400)

      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.

      • by Sycraft-fu ( 314770 ) on Wednesday June 02, 2010 @04:57PM (#32437920)

        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.

        • Re:Dinosour language (Score:5, Informative)

          by Homburg ( 213427 ) on Wednesday June 02, 2010 @05:42PM (#32438390) Homepage

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

        • Re:Dinosour language (Score:5, Informative)

          by DragonWriter ( 970822 ) on Wednesday June 02, 2010 @06:42PM (#32438958)

          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.

        • by SuperKendall ( 25149 ) on Wednesday June 02, 2010 @07:55PM (#32439630)

          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.

          After you use it for a while it grows on you substantially.

          It's simply a different path than other languages have chosen, but it has a lot of power - like KVC observing of property changes on objects, or the way I can use categories to extend libraries I don't have code for.

          And hands down Interface Builder is the most usable GUI development tool I have ever used, which stems directly from how Objective-C interacts with objects. In every other language I ended up abandoning GUI design tools to code UI by hand, but IB is a major partner in every iPhone/Mac UI I write.

          Yes the syntax is verbose but so what? Modern editors (like XCode) code complete a lot of that typing for you. And in any programming, the actual coding is small compared to thinking about approaches to a problem - so in the end it's not that much different time-wise to actually produce working code.

          On top of that though, I think there's an overall savings in time with really well thought out foundation libraries and language abilities that lead to faster coding over many other languages.

          I've used a number of other languages really heavily, from Java to C++ to Scheme - and I think Objective-C in the end, is a really good language combined with very good tools from Apple.

          I've never really seen the point in pining for other languages that do not philosophically match the platform you are targeting. When I was doing some Windows development I used C++ and the MFC. And though I could use other languages targeting the Mac or iPhone, I never much saw the point in doing so when learning the languages the core foundation libraries were written for gives you an insight into how they are likely built and meant to be used.

        • by furball ( 2853 ) on Wednesday June 02, 2010 @07:56PM (#32439640) Journal

          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.

      • Re: (Score:3, Informative)

        As much as I tend to detest Microsoft, I would love to see C#, or a language like it, become more widespread.

        Have a look at Vala [gnome.org].

    • Re:Dinosour language (Score:5, Informative)

      by mini me ( 132455 ) on Wednesday June 02, 2010 @04:23PM (#32437500)

      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.

      • Re: (Score:3, Interesting)

        by Nightlight3 ( 248096 )

        Have fun re-implementing something like KVC/KVO in C++.

        Now that you mention it, KVC/KVO is another one of ridiculous and wasteful (on end user's CPU & programmer's time) "features" of the Cocoa API. Passing simple numeric arguments of time critical functions (such as animation control) as ascii string objects (not just ascii strings, but malloced strings, which need to be parsed & converted into binary integer/float then free-ed) is utter idiocy. If you wish to get file properties, they return you m

        • by bar-agent ( 698856 ) on Thursday June 03, 2010 @02:02AM (#32441570)

          Now that you mention it, KVC/KVO is another one of ridiculous and wasteful (on end user's CPU & programmer's time) "features" of the Cocoa API. Passing simple numeric arguments of time critical functions (such as animation control) as ascii string objects (not just ascii strings, but malloced strings, which need to be parsed & converted into binary integer/float then free-ed) is utter idiocy. If you wish to get file properties, they return you malloced ascii dictionary of ascii name-value pairs, for size, time date,... (all in ascii pairs that need to be parsed back to binary values that your code needs). It's beyond stupid.

          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.

      • Re:Dinosour language (Score:4, Interesting)

        by yerM)M ( 720808 ) on Wednesday June 02, 2010 @05:58PM (#32438540) Homepage

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

        .

        It's also not quite true. Objective-c message passing is quite fast, only 4x the cost of a virtual table call in C++ [mikeash.com]. If you are really interested in what happens behind the scene, see obj-c fast-path [friday.com]

        Now, namespaces are still a honking good idea.

    • by peter303 ( 12292 ) on Wednesday June 02, 2010 @05:50PM (#32438460)
      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.
    • Re:Dinosour language (Score:5, Informative)

      by wsgeek ( 633907 ) on Wednesday June 02, 2010 @06:36PM (#32438896)
      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 [wikipedia.org])

      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 [microsoft.com]

      "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.
      • Re: (Score:3, Interesting)

        by Nightlight3 ( 248096 )

        Dr. Brad Cox -- and he had one main goal in mind: Be a strict superset of C

        That's as worthy a goal as inventing car that is strict superset of the horse carriage or a plane which is strict superset of a hot air baloon. Strict C is not suitable for OOP due to lack of overloading and creation/management of name spaces.

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

        You should't have to execute hundreds of CPU instructions to make a func

    • Re:Dinosour language (Score:4, Informative)

      by shutdown -p now ( 807394 ) on Wednesday June 02, 2010 @08:14PM (#32439762) Journal

      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.

      That's by design. It enables dynamic dispatch and delegation.

      (whether that is a good idea or not is another question, but it's intentional, and not because they "didn't know how to do better")

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

      Before commenting on programming language design, I would suggest studying the history of said language first. In case of Obj-C, it would be Smalltalk, from which the above syntax of methods names with "args" (they aren't "args", they are just parts of a single method name) comes verbatim.

      And in Smalltalk, it was, quite obviously, not done because the creator "didn't know about name mangling". It was a conscious design choice to improve readability of method calls.

      By the way, if I remember correctly nothing stops you from declaring methods that can be called as e.g. "[foo bar :1 :2 :3]" if you want.

    • Re:Dinosour language (Score:4, Informative)

      by Graff ( 532189 ) on Wednesday June 02, 2010 @10:30PM (#32440330)

      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.

      Looks pretty simple to me:

      @interface Employee : NSObject {
          @private
              int securityLevel;
      }
       
      @property(assign) int securityLevel;
       
      @implementation Employee
      @synthesize securityLevel;
      @end

      Counting just the relevant lines, that takes care of the variable declaration, its properties, and its getter and setter in 3 lines (approximately 82 characters).

      Here's the equivalent in C++:

      class Employee {
          public:
              void setSecurityLevel (int newLevel);
              int getSecurityLevel ();
          private:
              int securityLevel;
      }
       
      void Employee::setSecurityLevel (int newLevel){
              securityLevel = newLevel;
      }
       
      int Employee::getSecurityLevel (){
              return securityLevel;
      }

      That's a grand total of 9 relevant lines (approximately 217 characters).

      Java:

      class Employee{
          private int securityLevel;
       
          public int getSecurityLevel(){
              return securityLevel;
          }
       
          public void setSecurityLevel(int newLevel){
              securityLevel = newLevel;
          }
      }

      7 relevant ines (approximately 153 characters).

      So, in this circumstance Objective-C is about 1/3 of the characters or lines than the equivalent C++ code and about 1/2 of the characters or lines than the equivalent Java code. Objective-C is hardly a complicated or verbose language. I'm sure you could dig around and find languages that could do the equivalent in less code but this is by no means unreasonable.

  • Given the fact that most companies I've worked in lately have had more manager types than actual producers, the most popular language I've seen is PHB.

    (pointy head boss)

  • int main(int argc, char **argv) { printf("w00t!\n"); double_contracting_rate(); return 0; }
    • Re: (Score:3, Funny)

      Surely, as an old C programmer, you rather intended to say:

      main(argc, argv)
        int argc;
        char **argv;
      {
        stroke_beard();
        printf("w00t!\n");
        triple_contracting_rate();
      }

  • Another sign... (Score:2, Interesting)

    by leonbloy ( 812294 )
    ... I value most than Tiobe's dummy ranking, is the popularity of tags in Stackoverflow [stackoverflow.com].
    Granted, it correlates more with questions asked by programmers (many of them beginners) than with jobs.

    Anyway, you can see that also there "Objective-C" has a (surprising for me) high position (as well as "iPhone").

The opossum is a very sophisticated animal. It doesn't even get up until 5 or 6 PM.

Working...