The really nice thing about Objective-C, of course, is that you can just dip in and out of plain C as the mood takes you (e.g. where speed matters, or perhaps where you're just doing numerical stuff and C is less verbose). I've come to C via Objective-C, and (like many other commenters here) have found it incredibly satisfying.
After having spent a couple years doing embedded OS development in C, Objective C is beautiful. The verbosity makes it much easier to read than typical C code and the memory management is brilliant compared to doing it yourself. It walks the line between static and dynamic types quite well, with most things being static except when dynamic makes things a lot easier. I think Objective C is brilliant considering what they were able to add to C while maintaining great speed and full compatibility with C.
I've been doing a lot of Objective-C coding the past few months, and have found it surprisingly pleasant, once I got used to the syntax. Maybe I had low usability expectations for a language based on C. :-)
I've found after learning C I have a much better appreciation for writing resource conscious programs on a computer than I did before when I was first introduced to Java.
It has certainly helped me learn Objective C and C++ a lot quicker.
I'd even go as far as to say for new people to programming and put off by C, Objective C could be a good stepping stone for them.
Folks often poo-poo Apple's choice of Objective C, but I find that a VERY graceful object oriented extension of C, and far nicer than C++ or Java (yuck!).
I really like Objective-C. I had been using mostly Ruby before I started Obj-C (to make a quick iPhone app), and I liked it so much that I ended up going even further and doing about half of my programming in C++. Obj-C was a nice introduction to using a compiled language in real code that did stuff (as opposed to CS homework, which was my only previous C experience). When I wanted to make real stuff (servers), though, Obj-C wouldn't work since it had few libraries and relied heavily (in practice) on Apple's implementation of NS* classes.
If you have programming experience, you should be able to learn 99% of Objective-C in about 5 hours.
Despite the verbosity of the NS/Cocoa/etc APIs, Objective-C is a small, flexible, and unambiguous language. It performs very well at runtime, and is amazingly quick to compile. With version 2.0 and ARC, it became productive in addition to everything else.
I get it, it was long in the tooth, and the C legacy was both a blessing and a heavy weight holding the language back, but we lost a lot of the simplicity in the move to Swift.
Objective-C is a neat little language. Don't get me wrong - I would never go back to it, largely because of runtime errors due to duck-typing - but there were definitely things to like about it.
The best part was the perfect C/C++ interop. When I was working on iOS apps in Objective C, I found myself writing a lot of pure functional code using C and it was pretty neat to be able to integrate that with the OO stuff from Obj C so easily and with a clear dividing line.
Objective C is the 6th C-like language I've used professionally. It took a bit of getting used to, but now that I know the overall design goals, and how everything's implemented under the hood, I find it to be quite an elegant language. Properly designed APIs are a joy to use in Objective C since it's very easy to describe your intent.
I might be just me, but I've always found Objective-C's syntax very nice (compared to, say, C++).
It might be verbose, but you have a clear separation between C and Objetive-C. If it doesn't contain "[]" or "@", my brain can just parse it as C code.
I'm finding Objective-C to be a powerful addition to C and refreshingly simple compared to C++. What are you comparing it to, and what should I be missing?
What a legacy. Objective-C feels like a fun toy you can play with, it really does make cool things quite easy that are really hard in most other languages, like the iOS animation system.
Indeed. C is brilliant as an intermediate language. One of the greatest things about it is that once you generate C code it's not too much of a stretch to also generate C++/Objective C specific code and take advantage of the libraries written in those languages.
Despite this, there are many people out there who view languages that compile to C as being inferior. I still don't understand it.
I just skimmed an article about that. That's quite nice.
FWIW: One of the things I really appreciated in Objective C was that I could use real C when working with a C library. It wasn't something I did often, though. But, IMO, it's definitely something that someone who wants to do low-level Mac programming should learn. Sometimes it's just easier to work with a library in C.
reply