Slashdot Mirror


Modern Mac Development?

CDarklock asks: "I'm getting seriously interested in setting a new Mac next to my Windows box (to replace the Mac SE, which should tell you about how long it's been). But on Linux and Windows, I'm accustomed to writing lots of custom apps in C++ to fill the gaps around the system, but I haven't written anything on a Mac for something like fifteen years. As a professional Windows developer, what sort of expense am I facing to outfit a new Mac with development tools comparable to Microsoft's Visual Studio .NET, and what sort of learning curve should I expect?"

2 of 210 comments (clear)

  1. None - Apple gives them to you by linuxbert · · Score: 1, Redundant

    OS X comes with an x-code cd. it is all the developer tools you could ever want.

    see http://www.apple.com/macosx/developertools/

  2. Re: Obj-C learning curve by 1010011010 · · Score: 0, Redundant

    No, that's not an optimization strategy.

    The function objc_msgSend(object, messageSelector) implements Objective-C's dynamic (runtime) binding. It looks up the method (a plain C function) that object associates with messageSelector, and then calls that method.

    An objective-C message expression is nothing more than syntactic sugar for calling that function, so calling the function isn't any kind of an optimization.

    However, if you're going to be sending the same message to the same object over and over again in a tight loop, and that loop is proving to be a bottleneck, you can get a pointer to the appropriate function outside the loop, eg

    IMP functionPointer = [object methodForSelector: messageSelector];

    and then call the function (through the pointer) inside the body of the loop, completely bypassing the overhead of Objective-C's dynamic binding.


    (I mention loops because that's the only scenario in which I've ever needed to bother with this technique, and even then, it's rarely been an issue. But the API is available to use anywhere you want in your code.)

    That's the optimization you had in mind.

    PS: I know you know. But others might not.


    Thanks. :) That is what I had in mind. That's what I get for posting between meetings at work. :)
    --
    Napster-to-go says "Fill and refill your compatible MP3 player", which is a lie. It's not MP3. It's WMA with DRM.