Posted
by
samzenpuson Thursday November 25, 2010 @09:55AM
from the new-way-of-doing-things dept.

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

It will be interesting to see if Apple respond to this and how. My feeling is that they might try and protect their assets and restrict developers' options. I haven't really thught this through but I just can't see Apple letting people develop apps for iPads and then recycling ostensibly the same code for some Sony gadget. It is not in their nature.

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

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.

I had a difficult time moving from C++ to Objective-C. I think it would have been easier going straight from C to Objective-C. Old habits are hard to break. I thought I new OOP but it was learning Objective-C that really let it sink in.

I learned it as part of my Master's project, an iPhone application, for my graduate studies in Computer Science. I have since setup a Linux box specifically to code in Objective-C.

It really comes down to personal preference. Code in what language you like. Currently I prefer Objective-C.

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.

I like the D programming language. It's relatively new, but its well designed and multi-paradigm. It's suitable for system-level programming, but still supports higher-lever programming methods such as OO and functional programming.

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

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.

Writing apps for a phone is a like writing 1/10 of a webpage display wise. Good coding / language doesn't matter that much. What really matters is how easy it is to get things done. I've used, C, C++, all sorts of Java, C# asp.net, but C# Silverlight is by far the best. The Visual Studio IDE is great, there is a ton of free forum support, and a lot of people are using it / (lots of sample code)

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.

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

Claiming Objective-C is "familiar to far more programmers" is a stretch at best. I'm a C/C++ programmer, and I've been working with Java for a long while now, but I still find Objective-C's "messaging" syntax and its idiotic class definition syntax to be unintuitive and nigh-unreadable, despite the language's C-like appearance much of the time.

Seriously, what idiot decided "+" and "-" are better choices for distinguishing between class methods and instance method than using C's existing "static" keyword for one and defaulting to the other?

Objective-C has the most unreadable and unintuitive syntax of any language I've ever worked with

What are you talking about? The example you call insightful is very readable. As for intuitiveness, I don't think any language is truly intuitive, but once you learn it, it's very easy to understand, just like any other language. 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.

to say nothing of its memory management "best practices". What good do reference-counted pointers do me if I still have to manually release everything to avoid memory leaks?

renew/release isn't very difficult to understand, but if you can't keep up, Objective-C has garbage collection.

What good does its ability to mix C in with the Objective-C code do me when just mixing their two string types (NSString and char*) is a good way to make my program misbehave?

Objects != string pointers, and that's a problem for you? Seems like a fairly basic idea to grasp.

I can't help but conclude the language was built by a couple of guys saying "wouldn't it be cool if..."

You're referring to C (and that's not meant as a knock against C). Objective-C is a pretty awesome language, especially when coupled with quality frameworks like Cocoa.

I'm baffled how the summary can claim this is "probably for the better".

There is no shortage of developers who enjoy Objective-C and have had no trouble picking it up. Obj-C + Cocoa is very easy to develop with and leads to results very quickly and easily. This is a very smart move by Sony, and has potentially interesting implications for Linux in general. GNUstep is a pretty neat project.

You could argue that but considering that no language remotely related to C has string as a primitive, you'd be very alone. For the most part, true primitives are only included in a few languages. Smalltalk which most OOP languages are derived considers primitives as objects. Java is one of the few languages that has true primitives, and not even Java has string as a primitive. Strings are objects in Java. The most serious problem with strings as primitives is that strings do not have a fixed size. True primitives have fixed sizes.