Slashdot Mirror


Steve Jobs thinks Objective C is Perfect?

josht writes "Nitesh Dhanjani has posted an e-mail thread between Steve Jobs and himself. Dhanjani argues "I'd like to see Apple developers gain more choice. With every iteration of OSX, there seems to be so much effort put into innovation of desktop components, but the development environment is age old." I agree with Dhanjani. What has Apple done recently to wow the developers, and make it fun to code Cocoa components? I've looked into the Objective C and Xcode environment but compared to Microsoft's .NET solutions, it doesn't impress me at all. I think Apple can do a lot better. Steve Jobs disagrees. What do the readers think about Objective C and Xcode?"

18 of 784 comments (clear)

  1. Wowing developers... by Svartalf · · Score: 3, Interesting

    While wowing the developers is important, also providing them with a high performance, high reliability, and easy to use framework is important as well- moreso than wowing them. It does no good if it's "cool" to develop for a programming language, etc. if I'm spending 2-3 times the coding time for the other one or 2-3 times the debugging time, etc.

    C#, for all of the claims of performance, is a a JIT based interpretive language. Ditto Java.

    C#, for all of it's nicety, is little more than Java taken in MS' desired direction. If it weren't for Mono, C# wouldn't even be a subject of discussion as it'd been an MS only tool for use only on Windows (or whatever MS ends up calling thier stuff in the future...)

    C, C++, and Objective-C are stable, robust languages that have been around for some time now. C# has not been around all that long, but since it's got all the "buzz" about it, people keep trying to deploy it everywhere.

    Objective-C is actually a fairly clean OO language, moreso than C++. C++, while it's really good, has been muddied up with a bunch of conflicting design ideas that make for some...fun...with your coding if you're not paying attention to what you're doing.

    All in all, I'd say that it's decent enough for doing Apple development- if you want to adapt Mono to that interface (Which, I believe, can be done...) knock yourself out.

    --
    I am not merely a "consumer" or a "taxpayer". I am a Citizen of the State of Texas
    1. Re:Wowing developers... by Leimy · · Score: 3, Interesting

      Non-sissy programmers make mistakes that can let in all sorts of problems with buffer-overruns and other fun vulnerabilities. C is a terrible language for trying to write "secure" or "safe" code.

      I'm not saying C is bad for all situations. I just wouldn't use a saw to drive a nail.

      By the same token I try not to find problems for my solution.

      It may be very simple to do the refernce counting by hand, I'm just saying that it's possible to do a lot of this stuff automatically in a language design. See Limbo. It even has a way to get out of dreaded cycles that cause reference counting to leak memory [a cyclic keyword]. It's a shame Limbo only really works with the Inferno OS.

      Also C++ has libraries of things like shared_ptr that do the reference counting in the constructors and destructors of the object. It also can suffer from the cyclic reference leaks of course but the need to double check code or even suspect it of being wrong at the "use" level is greatly diminished.

      At the end of the day it's worth noting that no language is perfect, and just knowing the syntax doesn't make you a good coder. It takes practice... and just having a degree in CS isn't gonna make you great.

  2. .NET is a bit complex by netwiz · · Score: 4, Interesting

    Personally, I prefer Obj-C to .NET, mostly due to the (IMO) superior organization and layout of the object model. It's simpler than .NET's API, which tends toward "everything and the kitchen sink." Not that Cocoa doesn't have it's problems. It's probably more difficult to write big projects using it, but for quick development, I find it faster to just throw something together in Xcode. Besides, it doesn't hurt that Xcode and it's related dev tools are free on OSX, whereas it's a $600 investement on Windows for the equivalent software.

    A good example of the complexity is the file access models for both APIs. .NET has something like three different objects to deal with different types of file access. Cocoa implements these in a single object with multiple methods for the data access style (streaming, read the whole thing once, etc.) Now, it's probably just personal preference on my part, but why invent multiple objects when you could just roll them up as separate methods for what is essentially the same data structure? There's probably a reason, and I'd be interested in learning why this is so, but it just seems to me that Cocoa did it right in the first place.

    1. Re:.NET is a bit complex by rplacd · · Score: 3, Interesting

      Actually, that points to another place where objective-c trumps Java or .Net: you can add (your own) methods to classes you don't necessarily have the source code for; see this bit on categories.

  3. Learning ObjC/Cocoa (and others) now... by piyamaradus · · Score: 5, Interesting

    As an old-school programmer (20+ years of Fortran, C, various assembly languages, C++ many many years ago), who's spent the last dozen years or so focused almost exclusively on server-side high-performance networking systems (in other words, heavy-duty C/Unix/threading), I've taken my 'spare time' in the last few months to teach myself ObjC/Cocoa, Java, and some of the .NET technologies. I found it unfortunate that Apple deprecated Java + Cocoa in the last XCode release -- not because I particularly enjoyed Java but because it was easier to learn both Java and ObjC at the same time when I could be doing the same things with it.

    Comparing ObjC to what MSFT offers nowadays seems to be apples and oranges (no pun intended) and the learning curve is much different -- coming from straight C, ObjC is much cleaner, and I can slide more extensive Cocoaization in as I go. On the other hand, the ObjC syntax is a mess and weird for people who've never done Smalltalk ... and I'm guessing the set of people who have is extremely small nowadays.

    As for development environments, so far I've _hated_ everything to do with visual * -- it seems to be a monster to use, to customize, and to work with efficiently, at least for this old Unix hack. XCode is far far far from perfect -- I wish the SCM integration were better, that the whole thing were a _lot_ faster, and that they'd release incremental documentation updates rather than 250M batches every couple weeks -- but since it's all wrapped on gcc/g++/gdb/make at the back end, you can entirely do your stuff with vi/emacs/whatever at the command line and never use the GUI much at all, if that's your preference...

  4. Dev tools plus/minus by boatboy · · Score: 4, Interesting

    As a .NET developer, I haven't looked too hard at Mac dev tools, but I will say I could see an argument that Microsoft's rich development environment has some unexcpected consequences. Microsoft has made it easy for just about anybody to pick up software development, and as a result, just about anybody has picked up software development. =)

    This can be good, but a downside is that some of the emphasis on design, best practices, etc. is lost. An office nerd who happens to get into VB is not traditionally pushed to think about things like standard UI guidelines. So in a sense the rich toolset can detract from good software. MS seems to be aware of this, and you can see a definite push for more guidance from them. Still, they have a ways to go IMO, and finding the balance between making development easy and making it "good" is difficult.

  5. Xcode rocks. by wangmaster · · Score: 3, Interesting

    There are legions of NeXT fans that would disagree with your statement regarding .NET. The Interface Builder component has always been considered one of the most elegant, easy to use, intuitive UI constructing tools out there. It does what it needs to do, is well integrated into the rest of the tool (and the language) and just plain rocks. I have yet to use a UI layout tool that comes near the ease of use and effectiveness of InterfaceBuilder.app. When it comes to Xcode (or ProjectBuilder.app as the old NeXT fans were used to), it's also an intuitive, easy to use project management system. I don't like IDEs, I hate IDEs. I prefer vi/vim to do all my code editing. The nice thing about ProjectBuilder in old days (I'm not sure about Xcode, I haven't had the opportunity to do much with my mac mini yet) was that it did what I needed (collect all my files in a nice visual fashion, manage my building and integration with UI components, and built skeleton files). It does all those things well, without forcing the user to be hampered by some built in editor components. There are legions and legions of developers out there that consider the NeXT development tools to be the ultimate developer toolkit (and objective c is a pretty nice language). It's nice to see it didn't disappear into history :)

  6. Re:Love it by rplacd · · Score: 5, Interesting

    On the other hand, after several years of writing code in mostly python and other similar languages, the thought of going back to something like C (pointers!) doesn't really motivate me to write code for my mac. It's a good thing there are bridges like py-objc and such.

    (Disclaimer: I first became aware of Objective-C about a decade ago, and have used IB/etc on Openstep -- on a NeXT slab, even).

  7. Re:Compared to Intellij IDEA, XCode sucks by morcheeba · · Score: 3, Interesting

    Why was this modded insightful? It's just namecalling and has no information.

    Honestly, I would like to know why you think IntelliJ IDEA and the other IDEs are better than XCode. What features do you find important that are missing, or was there some unliveable annoyance? What language do you code in, and what level of debugger support are you expecting? IDEA doesn't seem to support C, so while I would get the benefit of less suckage compared to Xcode, I would have to switch programming languages.

    Your post had potential...

  8. Re:It's not like they're not doing anything by jcr · · Score: 3, Interesting

    If you think CoreData is cool, check out what you can do with Quartz Composer. Every value in the composition is reachable through keypaths.

    -jcr

    --
    The only title of honor that a tyrant can grant is "Enemy of the State."
  9. Re:Objective C was a neat idea in the 80's BUT... by caerwyn · · Score: 3, Interesting

    "Now, of course you can just call C functions, but then what is the point of objective C?"

    The point of any programming language is to give the developer the tools they need to efficiently (programmer time + machine resources) accomplish the goal they set out to do. No more, no less.

    Not using C functions simply because objective-C has methods is ridiculous; the language has the direct functional call built in for *exactly* the reason you're discussing. I write performance code for simulation data display in Objective-C; it simply requires a little thought into what functions require absolute maximum performance (and can therefore tolerate the lack of flexibility) and what functions (such as GUI functions) are better off with the dynamism that Obj-C methods provide.

    I don't care what language you're programming in, but if you completely ignore one of the tools that the language provides you and then claim that the language sucks, it's difficult to lend any credence to your opinion.

    --
    The ringing of the division bell has begun... -PF
  10. Re:objective-c is cool by spectre_240sx · · Score: 3, Interesting

    I hear that constantly, but actually it's the biggest thing that turned me away from Cocoa programming. I'm far from a professional coder, but I just can't get my head around building interfaces and connecting them to the code with all of these menus. I'd much rather just write the code myself. Maybe after working with it for a while I'd learn to like it, but it made it hard for me to get into it and I ended up going for Java instead.

  11. Re:Objective C was a neat idea in the 80's BUT... by metamatic · · Score: 4, Interesting
    If you look closly to objective C, it is really not a language, it is just C with a enhanced macro pre processor.

    C++ started out as C with a special preprocessor. So what?

    Performance is ABYSMAL compared to any modern language because message sends (the objective C equiv of a method call) has to go through a dispatch map.

    I'd be interested to see some up-to-date figures to back up your assertion. GCC 3.1 gave a 2x speed increase in method dispatch, and GCC 4.0 has -fobjc-direct-dispatch.

    msgc_ObjSend without the GCC 4.0 optimization is 22 cycles. Somehow I doubt that's really your big performance issue.

    Modern languages like Java, C# provide all the dynamsism of objective C, but do it effciently thougth vtables and reflection.

    This is the usual Java/C++ argument of 'There is no value in dynamic typing, because I can write a program that does the same thing using static typing'. Well, yes, and I can write a program that does the same thing in machine code, but that doesn't mean high level languages have no value.

    Some of us like having introspection, metaclasses, true parametric polymorphism and so on, without having to implement ugly workarounds. Personally, I think that ubiquitous (implicit) dynamic typing is a major aid to code reuse and software development agility.

    --
    GCHQ Quantum Insert installed. If only our tongues were made of glass, how much more careful we would be when we speak
  12. Re:No garbage collector by the+eric+conspiracy · · Score: 3, Interesting

    GC does not necessarily cause load spikes - as modern Java collectors have proven it is possible to to do GC without machine pauses.

    On the other hand, smart pointers fall well short of what Java offers - since smart pointer based software typically suffer from reference count bugs, and don't handle references loops. And doing the memory collection inline rather than in a seperate thread is a real disadvantage - but then it isn't like C++ has a threading model anyway.

    C++ really suffers in many ways by not having modern GC and threading support. It is really starting to look like modern technology is passing it by. THis is becommng more and more of a problem as processors become increasingly parallel.

  13. Re:Compared to Intellij IDEA, XCode sucks by laffer1 · · Score: 3, Interesting

    You don't get why people use regular expressions obviously. They are extremely useful for input validation. You do validate your input don't you? Desktop apps require it just as much as scripting or web applications. One of the joys of .NET is how easy you can create a regular expression or use built in ones (visual studio). Microsoft started pushing them for input validation because it can offer a quick way to sanitize input from sql injection and other attacks. I don't think apple developers have the same mindset about security that a MS developer has. Think about it, using a mac you forget about security. I don't run antivirus on my mac, or spyware tools and i dont' worry when i open my email or surf. On my windows machine, I worry if my virus defs and anti spyware are current or when my last scan occured. Every time I open IE, I remember that i can only go to trusted websites.

    Nothing stops you from using a third party regular expression library like pcre. Or simply use the java - objective c bridge in cocoa to use java's regex stuff. Although java is a second class citizen, it is supported to some degree with cocoa.

    As for xcode vs intellij, I would never use xcode for java after trying intellij. I use xcode for c/c++ programming all the time though. Its a great ide. I like the debugger interface as it reminds me of microsoft's vb.net debugger in some ways. One thing microsoft doesn't do is add a decent spell check library to .net. Apple's got that covered. Its also incredibly easy to create an opengl window from what i've seen. Menus look better in cocoa than vb or c# as well.

    I don't think its fair to compare cocoa and .net. Cocoa is more like MFC and its obvious apple's winning there. .NET is more like java. Now maybe one could argue apple should beef up their cocoa to java bridge and document it better to compete with microsoft. Maybe they should add a third easier language to cocoa, i.e the vb for apple machines.

    Objective c vs C++ is what people should be comparing here. I can see objections to syntax with objective C. It is much different than modern languages using the "." notation and so forth. My wife and I both have trouble remembering the syntax for objective C, but I haven't tried that hard to use it yet either.

    If you think cocoa is so bad, try to write a .NET app in managed C++ sometime. C# is java and vb is easier c#. Its like comparing real basic to C and declaring real basic easier to write a graphical text editor in.

    Apple could add more libraries to cocoa. That would be helpful. I personally found it confusing to connect buttons and objects in interface builder to backend code compared to .NET. Coming from a windows background its weird and feels like extra steps.

  14. Re:ObjC problems are many by theAtomicFireball · · Score: 5, Interesting

    Many of your complaints with the language seem to be much more a "it's different from other things, therefore wrong."

    Namespaces is the one I see foisted around the most. I can see some value to adding namespace, but not enough to muck up the language. Objective-C was designed to be the simplest wrapper around C as possible while enabling an OO approach. With the much flatter hierarchies Objective-C's weak-binding and dynamicism encourage, the lack of namespaces is a relatively minor thing. Some people want them, but there's really no compelling need for them. I, for one, am glad that Objective-C has avoided the "throw in everything but the kitch sink" approach that has caused C++ to bloat in recent years.

    Abstract class support? Again, why? The language doesn't need this. Objective-C's approach is to trust that the developer knows that he or she is doing. It doesn't take the paranoid approach that C++ and Java and the other Modula-3 inspired languages do, but that's not a flaw, it's a design choice. Objective-C is bad for stupid programmers, that I'll readily admit.

    All methods are public, but they don't have to be advertised in your header file. Again, it's the nature of the language, and the result of a conscious design choice, not a flaw. You don't need this, even though many programmers have been indoctrinated into thinking they do.

    I give you some points on the constructor issue. A language-level support for the DI or an official "constructor" method would be a good addition and add relatively little to the language and runtime. Garbage Collection is not something I personally want, but I know many people do; it's in the works. GCC 4.0 has support for it, it just hasn't been fully integrated into Cococa yet. Probably with the next release (is it Puma? I can't even remember all the cat names any more).

  15. Re:Love it by Yaztromo · · Score: 4, Interesting
    On the other hand, after several years of writing code in mostly python and other similar languages, the thought of going back to something like C (pointers!)

    If this is what is keeping you from developing with Objective-C, then you've picked a poor reason to avoid learning it.

    Pointers are as easy to avoid in Objective-C as they are in Java. In Java, all reference types are in fact a pointer, but simply a pointer which you don't need to think about. There is no pass-by-value for reference types, and no pointer arithmetic is allowed.

    In Objective-C, everything is again passed by reference (as opposed to by value). Pointer arithmetic is generally completely unnecessary (although it is technically permitted).

    I recently finished v1.0 of a decent sized Objective-C application, and the "&" operator isn't used once. The '*' operator is only used when defining a variable, return type, or parameter.

    I don't even think of pointers when coding in Objective-C. I tend to think of it as no different than Java. Extra capabilities to do pointer arithmetic are there, but I simply don't typically feel the need to use any of them.

    Yaz.

  16. Re:The emails are already gone. by soft_guy · · Score: 4, Interesting

    I'm sorry, but I have to agree with Steve and completely disagree with Mr. Dhanjani. I think that the language "choice" on .NET is silly - you can use whatever language you want so long as the language has exactly the same features as C#. For example, look at the feature set of "managed C++". No multiple inheritance and other non-C# features have been removed. Same for other languages.

    I program with Objective-C and Cocoa all the time. I am mostly happy with it and in fact I will not be using the Garbage Collection feature for my apps.

    I have complaints about Cocoa, but not being able to program in Ruby or Python is NOT one of them.

    --
    Avoid Missing Ball for High Score