Slashdot Mirror


Exploring the Mac OS X Object System

Philippe writes "F-Script is an integrated set of tools that makes it possible to interactively explore and manipulate Cocoa objects as well as script them using new high-level programming techniques. This new article, Exploring Cocoa with F-Script, shows you how to use some of its most impressive features and demonstrates how it can be a useful addition to your developer toolkit."

8 of 60 comments (clear)

  1. How many? by andrewman327 · · Score: 5, Interesting

    I was wondering how many Mac-specific development platforms are out there. Obviously there are loads of them for Windows, but how many just for Mac?

    As much as this will get me flamed, I code in Java when I am writing applications for Mac. I find it works well enough, but I am interested in becoming a bit more versitile.

    --
    Information wants a fueled airplane waiting at the hangar and no one gets hurt.
  2. Re:Looks nice... by Anonymous Coward · · Score: 1, Interesting

    That's was a pretty vague question, so I can only give a vague answer. In general Objective-C will favor power and flexibility over "security", and no classes or methods are truly private.

  3. Re:PyObjC? by Anonymous Coward · · Score: 1, Interesting

    PyObjC is great for Python programmers who want to access Objective-C libraries. However, as a native scripting language for Objective-C/Cocoa, it is not optimal. First, you have two different object models to deal with (Python and Objective-C), which introduces some impedance mismatch and complexity. Second, the Python syntax for invoking methods does not fit well with Objective-C's keyword syntax for methods.

  4. Live Testing is Where F-Script Really Shines by krisamico · · Score: 3, Interesting

    I have used F-Script to write tests for my applications for quite some time. In fact, pretty much everything I write has an F-Script console built into it when DEBUG is on. Naturally, OCUnit is nice for built-in unit test, but I really like being able to write an impromptu test into the F-Script console real quick to exercise some newly written or changed code. My clients often do not give me much time for writing enough built-in tests, so F-Script helps me pick up the slack with convenient, live testing. On the bad side, with F-Script, you are relegated to writing non-portable tests with odd, SmallTalky syntax, but for me it is an acceptable compromise for such a good, free (as in beer), on-the-fly testing tool. I don't remember having thanked Philippe for making it available. Thanks, Philippe!

  5. Re:Bzzt. Wrong. by spitzak · · Score: 2, Interesting

    The original poster was talking about making portable GUI code. You cannot use Cocoa, because that basically means you are using a Mac-only toolkit (GNUStep(?) is the only attempt to fix this I know of, and it isn't anywhere close yet). You instead use the interface to some portable toolkit, all the ones that are Linux+Windows have or are working on OS/X versions. As far as I can tell they *all* use the Carbon API. You would think Cocoa could be used, at least to create a blank Cocoa window and draw the tookit's widgets inside it, but there seems to be significant overhead and complexity in using Cocoa, and excessive differences from X/Windows, so that Carbon is preferred.

    So the original poster was exactly correct, you use Carbon if you want to port your program.

  6. Re:PyObjC? by Anonymous Coward · · Score: 1, Interesting

    Nothing beats F-Script when it comes to exploring objects interactively. PyObjC does not have the kind of graphical tools shown in this article. My favorite feature is F-Script Anywhere, a tool for injecting F-Script into running applications.

  7. Re:PyObjC? by Bastian · · Score: 4, Interesting

    Right, which is a huge advantage of F-Script over what I've seen of PyObjC. The only major difference between passing a message in F-Script and passing one in ObjC is that I use parentheses instead of square brackets. PyObjC has to go through some rather unnatural contortions in order to do the same, and it kind of made the code hurt my eyes a little bit, and I could see where it could make reading others' code a bit confusing.

    I'm also wondering, does PyObjC have "tab completion" for code the way the built-in F-Script console does? I've gotten really used to that in XCode; Python would have to be a damn sight better than F-Script for the switch to it to accelerate my coding more than the loss of Code Sense-style symbol completion would slow it down.

  8. Re:PyObjC? by Bastian · · Score: 2, Interesting

    F-Script can also be plugged into an app that wasn't designed to have it attached. From what I understand, PyInjector was created by following in the footsteps of FScriptAnywhere.