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."
Tiobe also explains how it determines it rankings (Score:5, Funny)
Don't they just google it like the rest of us?
Re:Tiobe also explains how it determines it rankin (Score:5, Insightful)
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.
Re:Tiobe also explains how it determines it rankin (Score:5, Funny)
Re:Tiobe also explains how it determines it rankin (Score:4, Funny)
Re: (Score:3, Funny)
Re: (Score:2)
So they don't count perl hacking, erlang development and assembly coding, then.
Re: (Score:3, Funny)
But they do count prime-time programming, which is always more popular than the other kinds.
Re: (Score:3, Insightful)
As the Fark crowd likes to say (Score:4, Insightful)
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)
Re: (Score:3, Funny)
Re: (Score:3, Insightful)
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...
Re: (Score:2)
Re: (Score:3, Insightful)
I think any useful statistics on a programming language would have to include something on the amount of code written in it and project complexity.
I have a feeling that the popularity of a programming language is actually inversely proportional to the LOC needed for a given task - unless you get paid for LOC.
What language for business logic? (Score:5, 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?
Re:What language for business logic? (Score:5, Insightful)
The answer is always C.
Re: (Score:2)
(5pts) Is the above statement...
A. Always right. B. Never right. C. Sometimes right.
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
Re:What language for business logic? (Score:5, Informative)
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.
Re:What language for business logic? (Score:5, 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.
Re:What language for business logic? (Score:5, Insightful)
Somewhat interesting to look at (e.g.) the Wolfenstein 3D iphone code...to see just how little Objective-C there can be!
Re: (Score:2)
Unfortunately Apple seems to be killing carbon and I think Java/Cocoa is officially deprecated now.
Re: (Score:3, Informative)
Not on the iPhone (and I assume neither for any of Apple's current non-laptop devices). But for the laptop, yeah, there are plenty of languages.
Where are you getting this information? I think you might be confused because OSX is not a "laptop" operating system, it covers Mac mini, laptops, and desktops (Mac Pro, imac, etc).
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 [appleinsider.com])
Re:What language for business logic? (Score:5, 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 [appleinsider.com])
Re: (Score:3, Insightful)
You're missing the point. The point is not that Objective C is somehow "closer" to Java or not (in reality it's "closer" to Smalltalk), the point is that valid C code is valid Objective C code. That's what "Objective C is a superset of C" means.
Re: (Score:3, Insightful)
All valid C code is valid Objective C code (well, all C code as of the standard at the time Objective-C was created -- I'm not sure to what extent Objective C has tracked evolution of the C standard.)
Almost no substantial valid Java code is also valid Objective C code.
Re: (Score:2)
No, I was talking about the iPhone. It's not just Objective-C or GTFO. From this page [daringfireball.net] (haven't seen the agreement itself, it's surprisingly difficult to get if I don't want to actually become an iPhone developer):
Applications must be originally written in Objective-C, C, C++, or JavaScript as executed by the iPhone OS WebKit engine...
So it's Objective-C, C, C++, JavaScript on WebKit, or GTFO.
Still sucks, but it's at least theoretically possible to develop a cross-platform C or C++ app, assuming the other platforms allow them.
Which still sucks sucks -- basically, your UI gets to be rewritten entirely for each platform, and your
Re: (Score:3, Funny)
Pseudocode.
(where "automatically" = "delegated to PFY intern.")
Re: (Score:2, Informative)
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)
Note that Qt is now also the standard SDK for Symbian, so you'll also get 50% of the smartphone market anyway.
Re: (Score:2)
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)
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
Re: (Score:3, Insightful)
Well Qt won't run on the Amiga either. Clearly, no solution is going to work for 100% of platforms, since there'll always be platforms that don't support it (even for things like Java, that are intended to run on "anything", they aren't supported on everything).
Covering Windows, Mac, Linux, Symbian is the vast majority of computing platforms out there. True, he won't cover that 5% of the phone market (in fact, a lot more of the phone market, since there's more than just Symbian and IphoneOS). Is there a sol
Re: (Score:2)
Re: (Score:3, Insightful)
A sign of any real application architecture is that it can't.
The problem isn't in the abstractions in the middle of the program. Those can generally be translated all over the place.
The problem is at the edges, where the program has to interface with the system (and via the system with the user and other peripherals).
Not many languages abstract those things in ways that allow applications to just drop in. Which is why everywhere you go someone has come up with the idea of an abstraction layer, so their go
Re:What language for business logic? (Score:5, 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).
Re: (Score:3, Interesting)
Or you know, write a run-time that plays the CLR game.
Yup, that's possible, but you'd have some impedance mismatch and you'd probably not be able to may Objective-C objects to .NET objects, which would rather defeat the point.
One of the major benefits that clang has over gcc for Objective-C is a clean abstraction layer between the runtime-specific and runtime-independent parts. This means that you can easily add support for a new runtime by adding a new subclass of CGObjCRuntime (getting GNU runtime codegen done before any Apple people started working on it
wha...? (Score:4, Insightful)
They use search engines to determine this?
Why does this seem odd to me... or even misguided?
Objective-C jumped up on the basis (Score:5, Funny)
of all the posts on Slashdot saying how much it sucks.
It doesn't exhibit natural popularity. (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.
Re: (Score:2)
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.
Re: (Score:2)
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?
Re: (Score:2)
Yes, and it tries to replicate the CLI and the .NET framework, both of which I think suck.
-dZ.
Re:It doesn't exhibit natural popularity. (Score:4, Insightful)
> 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.
Re: (Score:2)
And if I'd ask you to name another compiled language with dynamic message routing/dispatch
Erlang.
Re: (Score:2)
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)
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
Re:It doesn't exhibit natural popularity. (Score:5, 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 [gnustep.org] 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.
Re: (Score:2)
So next quarter's report will be slashdotted. Big whoop.
Most popular language isn't C (Score:5, Funny)
Re: (Score:3, Funny)
And the most popular drink is spit, and the most popular song is "why won't this compiiiii-iiiile?" and the most popular slashdot reply is "Page Down".
Re: (Score:2)
If Tiobe's website is to be believed, the #1 programming language right now is Whitespace.
I would have thought it would be http://en.wikipedia.org/wiki/Brainfuck [wikipedia.org]
Dinosour language (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.
Re:Dinosour language (Score:5, 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.
Re:Dinosour language (Score:5, 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.
Re:Dinosour language (Score:5, Informative)
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)
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.
Re: (Score:3, Interesting)
Thanks for the tips, because win32 APIs feel like a real paradise now.
Dig into the underlying implementation of a language and it's bound to get a little complicated. Stuff like objc_msgSend is not meant to be used often, it's there to enable you to do odd things that the simple and easy to use APIs don't allow. You use it carefully and build a decent set of methods around that, then use those instead of calling objc_msgSend a ton.
There's quite a bit of crusty win32 API running around that is way more complex than the internals of Cocoa.
Because it buys you speed in development (Score:4, Interesting)
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.
Re:Dinosour language (Score:5, Insightful)
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)
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)
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
Re:Dinosour language (Score:4, Insightful)
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)
.
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.
he was emulating SmallTalk dynamic binding (Score:5, Informative)
When NeXT took over Apple (oops I mean the other way around
Re:Dinosour language (Score:5, Informative)
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)
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)
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)
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:
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++:
That's a grand total of 9 relevant lines (approximately 217 characters).
Java:
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.
Re: (Score:3, Interesting)
There is nothing there that a table of functions pointers along with compiler generated indices for methods/properties, linker/loader address bindings and on rare occasions OS APIs that provide access to these function pointer tables (Windows has such capabilities), cannot accomplish 300-500 times faster (yep, I had single stepped through their method calls & getters/setters, KVO/KVC processing,... and watched tasks that any decent compiler turns into one or two instructions explode into many hundreds o
Re:Dinosour language (Score:4, Informative)
"There is nothing there that a table of functions pointers along with compiler generated indices for methods/properties, linker/loader address bindings and on rare occasions OS APIs that provide access to these function pointer tables (Windows has such capabilities), cannot accomplish 300-500 times faster (yep, I had single stepped through their method calls & getters/setters, KVO/KVC processing,... and watched tasks that any decent compiler turns into one or two instructions explode into many hundreds of instructions through their runtime interpreter every time you invoke the "feature")."
Again, you're not understanding the language.
Using things like KVO/Bindings and distributed objects REQUIRES that the functions be addressed by name, not by address.
Honestly, if you're using Obj-C as a performance language, you're an idiot. Notice how Objective C has no low level primitives? No basic math functions? No OpenGL abstraction? It's mean to be used as a GUI binding language. This is why in Objective C you are supposed to use C code for your logic (or C++ code if you're so inclined) and then Objective C for your GUI. Objective C was in no shape or form designed for low level logic. This is not a deficiency. This is because it makes a damn good language for doing GUIs.
The reason there is no linking by address is because a GUI needs to dynamically bind against different sections of code by NAME, not by address. In addition, Objective C supports dynamically adding and removing key values at runtime, which again, goes completely against linking by address.
You clearly don't know what you are talking about, which is probably why you were shut down on the Apple forum. Learn some KVO and bindings on the Mac, understand what Obj-C is for, and then you'll understand why Apple made the design decisions they did.
Re:Dinosour language (Score:5, 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.
manager to worker ratio (Score:2)
(pointy head boss)
As an old C programmer, let me say... (Score:2)
Re: (Score:3, Funny)
Surely, as an old C programmer, you rather intended to say:
Another sign... (Score:2, Interesting)
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").
Re:Where are the C development jobs? (Score:5, Insightful)
Re:Where are the C development jobs? (Score:5, Funny)
Unfortunately the number of projects that require people who can program right down to the metal has also been dropping each year.
Re:Where are the C development jobs? (Score:5, Informative)
Re: (Score:2)
When you build 100,000 of something, you can afford some up-front development cost to save $.15
That's only $15000. The thing is, these places build 10,000,000 of them. Then you realise why your cheap-ass no-name gadget has such a cheap plasticky cover.
Re: (Score:3, Funny)
The chip vendors won't even send out a salesman if your projected volume is only 100k.
You must be exceptionally rude to them, I can't get them to stay away and our volume is sub-thousand.
Re: (Score:3, Insightful)
They're everywhere! Sure, lots of people say they're writing C++ code (or, C code wrapped in C++), or application development. A lot of C development is OSS too - there's paid work in that area as well. There's TONS of maintenance work, especially in specialized industry controls, monitoring, whatever.
In other words, it's all around you - just shrouded in mystery. Not many people advertise new C development, but oftentimes it is just a another tool in a developer's arsenal.
Re:Where are the C development jobs? (Score:5, 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?!
Re:Where are the C development jobs? (Score:5, Funny)
Re: (Score:2)
Hey, there's even a modern web framework [coboloncogs.org] for Cobol!
Re: (Score:2)
C has limitations and is inefficient as a solution to many problems (though of course it is ideal for others).
If C is the only language you feel comfortable in, you need to get more practice with something else.
Honestly, if you haven't gotten enough exposure to C++ by now to be able to bluff your way into a gig, you've been slacking hard.
Re: (Score:2)
If you can tell me what this [dangermouse.net] program in Piet does (without looking at the file name) then you have a job!
Disclaimer: I wrote two different interpreters for this language and I am working on a third one. I am quite likely insane.
Re:Where are the C development jobs? (Score:5, Insightful)
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.
Re: (Score:3, Informative)
Learn Java if you enjoy solving the same business problems over and over again. Kernel programming is still C. Most "C++ jobs" neuter C++ down to the point you're really just using C with classes, easy to pick up if you know C.
I recently had lunch with a friend of mine who manages Java development. He's switching jobs because the company is switching to $10/hour Java coders, and he wants nothing to do with that. To the current business mindset, if the problem is best solved with Java, it's best solved f
Re: (Score:3, Interesting)
Why else would a business be hiring you except to solve their problems? Even kernel programming (the few places that require it) are still to address business problems. You might find yourself writing drivers for example.
I recently had lunch with a friend of mine who manages Java
Re: (Score:3, Informative)
Re: (Score:3, Interesting)
People always overestimate the number of other people that are like them in some way. You are interested in Javascript, so you overestimate how many other people it is important for.
I've programmed for 30 years; a few languages I've used a lot; many languages I've dabbled with. I've never once touched Javascript. I'm likely to underestimate how many people are program in Javascript.
Re: (Score:2)
Agreed. I've learned enough JavaScript to do a few things with Greasemonkey (mostly stuff like going straight from an article link on a news site to the print-friendly version without having to go through the non-print-friendly version first), but I've never used JavaScript in a job. My jobs have been mostly C (with a smattering of C++, but mostly C), plus a few years of Java and C#. Perl and Bash are used as the glue when needed. JavaScript just doesn't enter into it.
I'm sure there are a lot of web develop
Re: (Score:2)
Perl is awesome when it comes to parsing ascii but I think Python has an inherent edge in its readability.
Re:Strict Superset? (Score:4, Funny)
The whip and high heels.
Re: (Score:3, Informative)
Sorry to troll, but what exactly is a "strict superset"?
Well, the strict definition is that it's a superset, and it's not an identical set.
You probably want the non-strict definition which is "we haven't given up on compatibility with C, like the C++ folks did".
Re:Strict Superset? (Score:5, Informative)
A simple analogy:
"Strict superset" is to "superset" as ">" is to ">=".
Re: (Score:3, Insightful)
A simple analogy:
"Strict superset" is to "superset" as ">" is to ">=".
Technically, yes. That's what it means in a math class or a logic class. But that's not what "strict" means in this context.
What it means here is that Objective-C is a superset, in the sense that any legal and correct C program is a legal and correct Objective-C program that does the same thing. So the "strict" adjective is technically redundant. The reason it isn't redundant in practice is because other languages (notably C++) are close enough to being supersets of C that they're called supersets of