Sony Adopts Objective-C and GNUstep Frameworks
EMB Numbers writes "Sony has revealed that the new SNAP development environment for 'consumer electronics' is based on Objective-C and the open source GNUstep implementation of Apple's Openstep spec. While Apple has continued to update their specification in the form of Cocoa and Mac OS X, GNUstep has preserved the original standard. Anyone familiar with Cocoa Touch and iOS will feel right at home developing for Sony. There may even be some source code compatibility between the platforms. The world continues to chase apple — probably for the better."
No, Cocoa is almost a superset of OpenStep (with the exception of a couple of classes like NSDataLink that Apple ditched). We (GNUstep) track the changes from Cocoa and have done for the last ten years. We also track changes from iOS. For example, we have NSRegularExpression, which is only in iOS Foundation, not yet in OS X Foundation.
I am TheRaven on Soylent News
Or more accurately, One foreign company adopts a compiler.
I want a list of atrocities done in your name - Recoil
GNUstep's objective is to create a free and open source implementation of the Cocoa libraries, with some additional libraries. It does not target the OpenStep spec, which is antique and obsolete.
Please read the definition
Hack your mind out of its sandbox.
Qt is LGPL, it's not "owned" by Nokia - certainly not in the way Apple controls Cocoa and GNUstep strives to keep up.
That said, as far as I am concerned GNUstep is at least the second best choice of the two / it's nice to see that their efforts might finally give something big.
One that hath name thou can not otter
As others have mentioned in the comments, Objective-C was one of Apple's poorer decisions
I suppose you have a significantly better (simpler and more flexible) compiled OO language suitable for system-level programming up your sleeve, when you talk like that.
Ezekiel 23:20
Actually, Objective-C's performance is very very good, and verbosity is absolutely a good thing. The problems I might raise with objective-c would involve it's highly dynamic nature, and lack of a decent type system, not it's implementation's speed or it's code clarity, which are both positive advantages for it!
Cocoa is also one of the absolute cleanest application development frameworks out there by far (CocoaTouch improves on it a chunk though purely by binning a lot of old cruft), so I'd say sony made a bloody good choice.
For all the things Apple has done right and does well, clinging on to Objective-C is not one of them.
It'd be nice if you pointed out, you know, actual reasons rather than just make snide comments. I'm sure some knee-jerk Apple haters will vote you up though.
My issues with iOS development lie not with Objective-C, but with Apple's frameworks and libraries. It's frustrating to only have header files and not be able to check out what a method actually does when debugging. Fortunately, the documentation for their classes is top-notch. The objc runtime is also a pretty wild ride, but once you know your way around you can poke at it and find out where your messages are going at least. Can check out the source for the runtime here http://opensource.apple.com/source/objc4/
Another issue of course, is XCode. I've switched to writing most of my iOS code in vim, building my code with the xcodebuild command. I still rely on XCode to do things like add files to the xcodeproj and manage the build configurations. XCode has a mind of its own, wacky completions, a completely fucked up undo buffer, strange locations for settings, and more frustrating joys. Would love to do away with that.
Check out the cocoa.vim plugin, and also, while I'm at it, you can get your vim for your local environment pimped out in minutes with Vimlander 2: The quickening. Test driving my apps with Pivotal's Cedar framework.
Long live the BSD license
Some of the biggest NeXT clients were precisely from the military, intelligence, banking, financial services and science communities. And they chose NeXT precisely because of Objective-C and NeXTStep.
To be fair it's not that there's any inherent problem with Objective-C, that much is pretty well demonstrated by the countless great applications built on it for Apple's platforms. The real issue is really that it's like the neanderthal of languages- it evolved from C in parallel with languages like C++ and Java, but in doing so has ended up rather more ugly, and whilst it has some good bits, it also has bad bits like a lack of namespaces and operator overloading (although of course these issues aren't limited to Objective-C, Java lacks operator overloading too for example) but the combination of what is frankly a quite horrible syntax and these missing features means it's essentially just a poor man's C++. The obscurity of the syntax just builds an extra barrier that's really unnecessary in this day and age- every developer just about is comfortable with C++ style syntax so why waste time with a language syntax that's so obscure when you can just have one that people can jump straight into? This issue spills over into cross platform development somewhat in that it's much more of a headache to development multiple versions of a program when you're facing two very different sets of syntax more so than porting between programs with similar syntax.
So yeah, certainly it "works", but there's really just no point in it when other languages work just as well without the added headache of lack of things like namespaces and an obscure syntax. There are bigger issues with the development tools and libraries themselves, but really that's something else, my comment was really targetted at the language- effectively Objective-C is different without bringing anything worthwhile to the table- at least with some other languages that have more obscure syntax they also often have a redeeming feature, like say being a functional programming language for example.
Insinuating that SONY making use of Apple inspired development tools/specs/practices/whatever is validation of Apple in some way seems quite strange.
SONY is famous for being absolutely crap and producing/choosing/using development tools.
SONY's picking a development tool set related to Apple's only clear benefit is to people who have had to develop for SONY products in the past - ANYTHING is better than software that came out of SONY.
They sure used to make great hardware though, and that's starting to return a bit.
But adopting Apple-like dev environment(s)...? Water to a man dying of thirst and all that...
Loading...
Also doesn't it's dynamic runtime stuff allow certain things that C++ doesn't?
Yeah, like built-in introspection and reflextion. Stuff like RPC (remote procedure calls) is simple and flexible under Objective-C but under C++ it has to be hard-coded in and can be very brittle.
Sapere aude!
I think the extent to which the syntax is a barrier to entry for new developers is exaggerated. Square brackets denote method calls - easy. It might take a wee while before typing out method declarations in the right order is second nature, but I think that's acceptable because you gain (forced) named parameters.
I like the fact that the syntax is different, because the chances of getting caught out are reduced. There are already too many languages with similar but subtly different syntaxes out there.
"The world continues to chase apple -- probably for the better."
When did Slashdot become a forum for apple fanboys?
C++ it like a swiss army knife with a multitude of razor-sharp blades and attachments. It can do whatever you want to do, and it can do it pretty cleverly, but if you don't know the tool really, really well, you're going to end up missing fingers :D
I think a lot of people who dislike Objective-C are those who just looked it over and haven't spent too much time with it. I used to feel the same way until I got most of the way through an iPhone app recently. I view it as an acquired taste. Watching the great WWDC videos that Apple provides on it's development site helped me to understand it a lot and learn why they do the things they do with it.
Actually, it's the other way around, C++ is the poor mans objC. Unlike C++ it's a C superset, and way back with NeXT it was demonstrably leading to fewer bugs and less developer time on the same job. Apple has made some poor decisions in its role as de facto shepherd but the language is solid in its role.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Friends don't let friends enable ecmascript.
It has been a few years since it migrated from a Linux fanboy-only site to a more democratic one. Today, you'll find Linux fanboys, Apple fanboys and surprise! Even Microsoft fanboys! But more importantly, you'll also find people impartial enough to not be fanboy to anything.
http://dilbert.com/2010-12-13
Nice link on Reflection, every now and then I wish I could do that but didn't know I could.
There's a lot more to it if you dig deeper:
Objective-C Runtime Programming Guide
You can do some pretty neat stuff like dynamically creating a class and adding methods to it. Some of it should only be used as a last resort but it's nice having the tools at hand if you really need them. This kind of stuff is either extremely difficult or outright impossible in C++.
Yes, there are some performance penalties to a dynamic runtime but for most cases it is negligible. If you desire you can circumvent the dynamic aspect of Objective-C and "freeze" method calls in order to get around those penalties for performance-critical code. There's a great series of articles on this subject: The Optimizing Objective C Series
Sapere aude!
You apparently do not really understand what Objective-C is about yet. Yeah, I know, "you don't know what you are talking about" is the classical ad hominem attack in any programming language flamewar. But in my opinion, it is hard to see how anyone who has actually taken the time to look at Objective-C closely could ever refer to it as being a "poor man's C++".
Now calling it a "poor man's Smalltalk", well, you might have a point there. But C++? ObjC and C++ are both in some way descended from C, but that is where the conceptual similarities end. The ObjC runtime is dynamic, which is IMHO a blessing, compared to the strict typing and template system of C++. But I'll grant you any day that Obj-C could do with some modernisation, in particular w/r to namespaces.
But even the other thing you mention, operator overloading... that is absent for a reason, simply because software design works differently in ObjC. You don't really need it in the same way that you do with C++. Same with multiple inheritance. You have protocols for that, amongst other things.
So please give ObjC another, more in-depth look, some time. You might be surprised in a positive way, once you look past the admittedly rather weird syntax.
A.
Yes , I agree about the syntax. Instead of creating a nice consistent extension to the C language as Bjarn did with C++ (albeit with some kludges) , Obj-C really looks like someone tossed a completely different language into C because it was easier than making an effort to actually extend C nicely, and then didn't even bother to stir the resulting dogs dinner.
I laughed at this post, but then I realized you might not be trying to be funny. As a C++ programmer myself, I've never heard anyone referring to C++ in a serious way as a "nice consistent extension to the C language." C++ is an absolute monster. It's completely inconsistent in many ways and is riddled with so many "gotchas" that it takes years until you should be able to call yourself an expert. That's a long time in the context of learning a new way to describe what a computer should do.
I haven't programmed in Objective-C in years, but I do remember that it is far simpler to learn than C++. It adds comparatively little to the C language, as far as syntax goes; basically just the [] message-passing construct and the @ keywords. I think Objective-C "2.0" may have distinguished itself a little more, but I haven't looked into it.
Anyway, hopefully you're being funny. Otherwise, we have completely different opinions. Objective-C seems to have extended C in a way that is much nicer and cleaner than C++ IMO.
This author takes full ownership and responsibility for the unpopular opinions outlined above.
There is absolutely zero technical reason for this, it's all to force developers to code to Apple's APIs.
One technical reason for this is to make sure that everybody is on the same playing field when it comes to things like architecture changes.
If you know anything about Apple history, they have been able to make successful transitions between chipsets on more than one occasion. By requiring everybody to use the same development tools, any significant architecture changes are just a recompile away in an updated Xcode.
Just one of several reasons, along with UI consistency and performance amongst others, but one of the most important.
It's a Unix system - I know this.
If you track so closely, technically what's to stop GNUStep / LLVM being used as a platform to host and run iOS apps?
The only thing stopping this is the Cocoa (Cocoa Touch in the case of iOS) frameworks. They are analogous to the C++ STL but they are not free to use outside of an iOS device. Yes, you could still use them to create a binary and possibly run it on another device but you run the risk of a huge lawsuit if you do that. The GNUStep frameworks are coming along nicely and they can be used as an open-source alternative but you won't be able to take an app programmed using the Cocoa frameworks and simply compile it against the GNUStep frameworks without doing some re-working.
Even with that you can still make an app that uses the classes common to both the Cocoa and GNUStep frameworks and then has some platform-specific code in critical sections, then compile that app against either framework to create a binary that can run on multiple platforms. There are a few apps that do this kind of thing now and I expect that Sony's choice will greatly increase the numbers. It's a good time to be an Objective-C programmer.
Sapere aude!
If you're not a fan of "gui driven development", why are you commenting on an article about a framework for making GUIs for consumer electronics?
You CAN do reflection in C++ as the code base for one game I saw ... the catch is you need a super-base object, templates, and macros to pull it all off ...
but yeah, there is no _native_ language support for it.
But I'll grant you any day that Obj-C could do with some modernisation, in particular w/r to namespaces.
In the end namespaces are very little more than appending more characters on a name. You can get most of what namespaces do just by adding a unique string to part of your class name. Yes, there is a possibility for clashes if someone chooses a string which is the same as yours but how often do people use outside classes other than the ones in the Cocoa frameworks?
At best there should be some sort of prefix directory where developers can register their class prefixes and make sure that they have a unique string. Apple already uses NS and CF so most developers know do avoid using them.
Here's some good reading on the topic:
Cocoa Style for Objective-C: Part I
ChooseYourOwnPrefix
Sapere aude!
But that's a completely different argument, his point is that C++ extends the C syntax and rules pretty consistently, whilst Objective-C does not, it changes them.
The complexity of C++ stems not from the syntax per-se, but simply because you can do that much more with it- not only have you got namespaces for better code organisation in large projects, not only have you got tools such as operator overloading, true multiple inheritance, but you also have options such as template meta-programming.
You found C++ harder simply because it has more features, and more complex features to learn, not because of it's syntax. C++'s complexity stems purely from it's power, Objective-C's complexity stems from it's obscure syntax- the former is the price you pay for extra features, the latter is just simply inexcusable difference for the sake of difference and/or poor language design.
C++'s syntax change complexity is purely down to the amount of syntax that is required to implement such a rich set of features. If you base your argument purely on syntax without any consideration of why that additional syntax is there and without any consideration of language changes then you might as well just argue Java trumps them both because it's much closer to C syntactically than either of them, but that would be ignorant of the fact Java offers a completely different featureset again.
Perhaps the most obvious test though is this, write an application that's not overly complex and uses the base set of shared features the languages provide using their preferred syntax (rather than the fact you can just use C for either) and which then more closely represents a C program syntactically? you really can't argue it's anything other than C++, which is precisely why the jump to C++ is much more natural than to Objective-C as per the GP's argument.
I think you have that backwards. Objective-C doesn't change any of the rules of C. On the other hand there's a lot of C syntax that is not valid C++.
Both C++ and Objective-C started off as object oriented extensions to C, and IMO Objective-C does a much better job. C++ tried to add everything and the kitchen sink, and ended up with horrible, bastardized syntax because it's still trying to achieve C compatibility, even though it hasn't been strictly compatible with C in over a decade.
It's even more noticeable if you look at what's considered "good" code in each language. The following is valid C, Obj-C and C++, but a C++ weenie will whine that it's not using std::cout.
#include <stdio.h> int main() { printf("Hello world!\n"); return 0; }
Have you ever tried to actually do something with a Swiss army knife? Or any other knife with non-fixed blades? Sure, it's possible, but a bunch of special-purpose tools beat it hands-down every time. Which, I suppose, is a pretty good metaphor for C++ :).
Forget magic. Any technology distinguishable from divine power is insufficiently advanced.
C++ is an incredibly powerful language but ObjC is also extremely capable. Cocoa (Touch) is simply the most productive framework that I have ever used. Yes, it has a pretty steep learning curve but once you get used to the Cocoa way of doing things you can produce excellent and rich GUI applications in a fraction of the time it takes in many other development environments that I've used. I work mostly in C# in my day job too...
The fact that a single, rarely-used class is somewhat slow is in no way an argument against a langauge.
What are you talking about? The example you call insightful is very readable.
It's the brackets and the "initWithThing:x otherThing:y" paradigm that I find unintuitive and difficult to read, most especially the "let's combine the method name with the name of its first parameter!" idea. Why did they throw out perfectly understandable function call syntax in favor of surrounding everything with brackets? I know they're trying to pretend they're sending "messages", but what they ended up with is virtually identical to the standard in C except in superficial syntax.
Why did they throw out C's perfectly readable struct-definition syntax in favor of this "@interface" and "@end" and "@property" nonsense?
Why do you have to manually derive all interfaces as children of NSObject? That would be like Java requiring you to explicitly derive every class from Object. You're never not going to want your class to be derived from NSObject, so it should be assumed.
Why do they use "+" and "-" for static methods vs instance methods? Did they really think "+" and "-" were more intuitively clear than, I don't know, using the 'static' keyword that was already in the language? Is it so absurd to want method specifiers that are actually clear in their meaning?
Why did they throw out perfectly understandable pass-by-value and pass-by-address parameter passing?
None of these changes from C are for the better.
I will say that #import is an improvement over #include; I wish something similar had been adopted in C++. Still, tiny improvements like this do not offset the idiocy with which the rest of Objective-C was designed.
I suspect you are more of a "get off my lawn" type who thinks things should be done the way you learned them and anything different is to be feared.
I have used languages with widely varying syntaxes and design philosophies (I enjoyed working with Scheme, for example). I don't "fear" different ways of doing things; I do have opinions about which ways of doing things are stupid. Having a negative opinion about a specific language you like does not automatically mean I'm just shaking my bony fist in the air and shouting "get off my lawn".
Let me make myself clearer: what bothers me most about Objective-C is that it tries to pretend it's like C even while doing everything it can to be different from C without being so different that it can't have the C in its name anymore, all while retaining several of C's disadvantages and gaining very few of the advantages it claims.
renew/release isn't very difficult to understand, but if you can't keep up, Objective-C has garbage collection.
No, it's not particularly difficult to understand, but that's not my point; Objective-C's garbage collection only collects objects whose reference counts are zero. That's the whole reason you have to properly handle your reference counting. In other words, Objective-C gives you all the downsides of being forced to manage memory, combined with all the downsides of garbage collection.
(I realize garbage collection has advantages; however, by forcing you to manually handle reference counting, Objective-C negates those benefits by design. In other words, all Objective-C gains you is that instead of freeing your memory at predictable times, the garbage collector will come along at unpredictable times and slow down whatever it is your program is doing.)
Objects != string pointers, and that's a problem for you? Seems like a fairly basic idea to grasp.
It's not that, it's that nothing in Objective-C even works with char*s, other than the one init method on NSString. Want to display a char* in your UI? Hope you don't mind converting it to NSString first!
Worse, by default, string constants in your code are char*s, not NSStrings! If you want your string constant to be an NSSt
These two quotes just about sum Objective-C:
"Objective-C is simple. It just takes a genius to understand its simplicity"
and:
"Those who don't understand Objective-C are condemned to reinvent it, poorly"
With apologies to Dennis Ritchie, Henry Spencer and Unix.