Slashdot Mirror


Cocoa Programming for Mac OS X

Michael Simmons contributed this review of what he claims is the best of the very few books out there for folks who want to learn Cocoa programming. The field is so small, in fact, that he can give a nutshell review along the way of the only other one he's encountered, O'Reilly's Learning Cocoa. Update: 12/13 15:45 GMT by T : Please note: Simmons is thanked in the acknowledgements of Hillegass' book. He explains: "I went to the Big Nerd Ranch, where the author teaches an amazing Cocoa course. While there, I received a pre-release copy of the book (it's the coursebook, actually.) I had found a bunch of errors and typos, and helped Aaron correct those errors and inconsistencies, so I'm guessing he is thanking me for my contributions to quality." Just to clear that up! Cocoa Programming for Mac OS X author Aaron Hillegass pages 416 publisher Addison-Wesley rating 8.5 reviewer Michael Simmons ISBN 0201726831 summary Learn to program OS X applications

Intro to Cocoa
If you're interested in programming for Mac OS X, you've definitely heard of Cocoa by now. Cocoa is the name of the library of frameworks that gives you the ability to write advanced applications with ease. The Cocoa frameworks enable you to perform tasks that used to take a decent amount of code and implement it in a very straightforward manner. The hardest thing about learning Cocoa is that because it's so simple, it takes some getting used to.

You can write Cocoa applications with either Objective-C or Java. If you aren't familiar with Objective-C, it's an extension to the C language that makes it object-oriented. I'm not sure why Apple decided to offer Java support for Cocoa, since almost every source of information on the Internet and all Cocoa resources seem to only refer to Objective-C. Since Java-written Cocoa applications will not run on any platform other than OS X, it was probably done as a marketing "thing" -- Apple is giving Java programmers the ability to program Cocoa applications, opening up the potential for more Cocoa engineers.

Until today, there was only one book if you wanted to learn Cocoa. That book is Learning Cocoa , which is published by O'Reilly and written by Apple Computer, Inc. The new kid on the block is Cocoa Programming for OS X, which is published by Addison-Wesley and written by Aaron Hillegass of the Big Nerd Ranch. With two books out, Cocoa programmers now have an actual choice of which book to buy. Which brings us to the point of this review -- which book is better?

Is it really O'Reilly?
Since Learning Cocoa was out first, I'll start with my analysis of it first. When I heard that O'Reilly was going to start publishing OS X programming books, I was stoked. O'Reilly books have historically been amazing -- very complete and straightforward sources that any programmer would be proud to have in his or her arsenal of knowledge. Unfortunately, Learning Cocoa falls short of the O'Reilly tradition, and makes me wonder if O'Reilly actually supervised the printing of this book.

There are some good points about the book. It was the first and only Cocoa book, so when I got my copy back in May, I was looking forward to learning the language. It does provide some good examples on how to write Cocoa applications, which allows one to dive straight into Cocoa programming. The introduction to Cocoa is really good -- it gives a very in-depth description of Object-Oriented and Cocoa program design, which I really like. Additionally, it gives a very good background to the concepts and techniques of using Cocoa.

However, there is a real problem with this book. This book reads more like it was meant to be an internal reference at Apple, rather than a book for the beginner. Another problem is that the layout and order of the content is confusing. Unlike past O'Reilly books and other quality programming books, it seems like this time they took a bunch of internal technical documents on Cocoa, and sent them to the binding machines without further editing. That the book credits "Apple Computer, Inc." as the author provides good evidence for my theory.

The heart of the problem is that the reader has to really dig and explore through this book to find that info that he or she wants. When learning a new language or programming concept, a book should be easy to follow and it should allow the reader to focus on learning the actual concepts, and not having to figure out the flow of the book.

Aaron hits a home run
The "flow" statement is a perfect segue into my analysis of Cocoa Programming For Mac OS X. Right away, I could tell that I was going to like this book. The author, Aaron Hillegass, wrote this book like he is a friend speaking directly to the reader -- he takes you through each concept like he is right there with you. This book teaches you Cocoa by specifically having you write applications, and in each new chapter, you add new features. As you add each new feature, you'll learn an important Cocoa concept.

O'Reilly's book also has the reader write applications and add features, one by one, but it does so in a very sporadic way. I was never really sure what the purpose of adding a certain method was, whereas with Aaron's book, each chapter is focused on an ordered and very specific concept, making it very clear what I was about to learn, and why.

Another part of this book that I really appreciate is the chapter on Objective-C. In just one chapter, I understood Objective-C. You must already know C and at least one object-oriented language (like C++ or Java,) but after reading this chapter, you will be able to write Cocoa applications in Objective-C.

This book comes with an online counterpart, powered by Techstra. Techstra is an online engine that allows you to enter any page of the book and get "extras." The extras include examples not in the book, solutions, errata, and even input from readers. It's very cool and very helpful.

A final and very strong point of Aaron's book is that it reflects the latest update of the Mac OS X development tools, Project Builder and Interface Builder. Apple just updated the development tools to version 10.1, substantially changing the UI and functionality, and the latest version is reflected in Aaron's book.

Conclusion
It's clear to see which book I'm giving the nod to. I know it appears like I'm being biased towards Cocoa Programming For OS X, but if can get to your local bookstore and actually compare the two books side by side, you'll see why I'm so enthusiastic about Aaron's book.

I think having both books is a good choice, as the O'Reilly book does offer very in-depth information, which is useful once you learn Cocoa using Aaron's book. If O'Reilly changed the title to After Learning Cocoa, I think my perception of the book would be different.

Cocoa allows programmers to write powerful applications in a very short amount of time. I am amazed at the power and simplicity of the Cocoa frameworks, and can't wait to see what myself and other programmers end up creating in the future. I'm sure other books will come out in the future, but for now all we have is two. The one I'd recommend is Cocoa Programming for Mac OS X, but you already knew that. :)

You can purchase this book at Fatbrain. Want to see your own review here? Read the book review guidelines first :)

300 comments

  1. other Mac OS X programming resources by Frothy+Walrus · · Score: 3, Insightful

    the NeXT Programmer's Manual (by Simson Garfinkel, i believe) is a very useful Mac OS X programming resource (although it doesn't help with Cocoa). the OS X programming environment is substantially the same as the NeXTSTEP/OPENSTEP environment. they're both based in Objective C, and even many of the windowing calls are the same (most of whose names still begin with "NS" for "NeXTSTEP"!).

    1. Re:other Mac OS X programming resources by Anonymous Coward · · Score: 0

      Supposedly 'NS' stands for 'Next/Sun' rather than NextStep...

      Tom

    2. Re:other Mac OS X programming resources by Anonymous Coward · · Score: 0

      I've been busy porting an old NeXT application to Cocoa and there are many, many similarities between the two platforms. In fact the most noticable difference is that all the defined constants and object name are now prefixed with "NS" instead of "NX", why Apple decided to change all the names, I have no clue.

      As far as references go, I've been using both the NeXT Programmer's Manual and Learning Cocoa and most of Simson's book still applies (just change NX to NS!). The Objective-C introduction is very useful and (better then Learning Cocoa) overall is much clearer and in deapth. Even going through the Interface Bulder and Project Builder tutorials can be helpful since they almost exactly the same in OSX as they were in NExT.

      Before I might have recommended both of these books for learning Cocoa but it sounds a lot like Cocoa Programming for OS X encompasses both of these earlier works.

      I would recommend to anyone interested in Cocoa (great for quick and dirty GUI tools.) that they check out Cocoa Programming for OS X and just look at the online chapters for Learning Cocoa.

    3. Re:other Mac OS X programming resources by Anonymous Coward · · Score: 0

      ...by Simson Garfinkel...
      Are you sure that's not Simon and Garfunkel?

    4. Re:other Mac OS X programming resources by Anonymous Coward · · Score: 0

      It's not. Check www.simson.net

    5. Re:other Mac OS X programming resources by Anonymous Coward · · Score: 0

      I guess you haven't used NeXT in a _really_ long time - Apple didn't change NX to NS. NeXT software did that when they created the OpenStep specification and updated NEXTSTEP to OPENSTEP. I am programming on OPENSTEP 4.2 for Intel and can compile my code with zero changes on Mac OS X.

    6. Re:other Mac OS X programming resources by tadghin · · Score: 1

      Simson is currently writing an advanced Cocoa Programming book (partly based on his old NextStep manual). It should be out from O'Reilly in May.

      A second edition of Learning Cocoa should be out at the same time.

      --
      Tim O'Reilly @ O'Reilly Media, Inc. 1005 Gravenstein Highway North, Sebastopol, CA 95472 http://www.oreilly.com
  2. The recipie by wiredog · · Score: 1, Offtopic

    Hot cocoa is made with cocoa powder (2 tbs each cocoa and sugar per 8 oz milk). Hot chocolate is made by melting chocolate in milk. (IIRC)

    1. Re:The recipie by Anonymous Coward · · Score: 0

      not so, my friend. They are, in fact, the same thing. There are many ways to make hot cocoa/hot chocolate, but any of these concoctions can be appropriately called cocoa OR chocolate.

      There ya have it.

  3. Re:Why objective C? by Frothy+Walrus · · Score: 2

    you dirty troll. Apple chose Objective C because the design they jacked for OS X, that of Steve Jobs' NeXTSTEP operating system, used Objective C.
    aside from that, calling Objective C a "kludge" while suggesting C++ doesn't make much sense if you think about it.

    have you ever even used Objective C? it's really quite nice, and you can program in ANSI C on an Objective C compiler and it's no big deal.

  4. Other (non-book) resources. by hotsauce · · Score: 4, Informative

    Two resources I've found useful in Cocoa programming are stepwise.com and O'Reilly's Mac Devcenter.

    1. Re:Other (non-book) resources. by Anonymous Coward · · Score: 2, Informative

      Also cocoadev.com and cocoadevcentral.com

  5. Wondering which was first... by rbk · · Score: 3, Insightful

    Apple's Cocoa or cocoa, the computation in commutative algebra system?

    1. Re:Wondering which was first... by RevAaron · · Score: 4, Interesting

      Actually, what came before both of them, I imagine, was Apple's long-lost *other* Cocoa.

      Cocoa was a multimedia authoring environment for kids. Apparently, a pretty interesting one too- a object-oriented IDE for kids, believe it or not. I think Alan Kay had something to do with it while he was still with Apple.

      How I long for the days when Apple would do interesting research! Am I the only one who misses it? (the original) Cocoa, Dylan, MacLisp- a lot of interesting things that they seem to have given up on.

      Actually, it looks like your Cocoa came first- they started calling it that around 1990, it appears.

      Link:
      http://hometown.aol.com/schmucker1/index.html

      --

      Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
    2. Re:Wondering which was first... by Anonymous Coward · · Score: 0

      why is this insightful? he just did a fucking google search on "cocoa." it was pretty clear that the article is about Apple's Cocoa, and I doubt anyone has ever heard of the other Cocoa.

    3. Re:Wondering which was first... by blamanj · · Score: 2

      Actually, what came before both of them, I imagine, was Apple's long-lost *other* Cocoa. Cocoa was a multimedia authoring environment for kids.

      Yes, it did come first, but it's not lost! That project was spun off from Apple into the company Stagecast. Apple retained rights to the original name. Actually, the earlier name for the project was KidSim. The prime movers for KidSim were David Smith and Alan Cypher. Larry Tesler was Stagecast president. Both Smith and Tesler originally came from Xerox PARC.

    4. Re:Wondering which was first... by casiel · · Score: 1

      Unless I'm confusing it with another project, the original name of the "Cocoa" you refer to was "KidSim". They changed the name to "Cocoa" (it sounded more friendly?) right before they killed the project.

      It was to a large degree an experiment in example-based programming for kids, using graphical rewrite rules (when a situation like THIS occurs, change things to be like THIS), with further programming available on top (ie change things to be like this if this value is > 500) through a calculator metaphor.

      The whole thing was built on top of SK8, Apple research's rapid application development environment, which was itself implemented in Macintosh Common Lisp.

      You can still download SK8 from Apple's ftp site to this day, although I don't think Cocoa/KidSim is there.

      If you want to learn more, I think the articles I read on KidSim were in the Communications of the ACM and/or SIGCHI, somewhere in the mid-to-late 1990s. (Sorry I can't be more specific!)

    5. Re:Wondering which was first... by rbk · · Score: 1

      Could you please cool down just a little bit? Well, I have been using it a lot a couple of years ago. People who are doing symbolic computation (aka computer algebra) professionally will have heard about the other Cocoa. So your doubt is inappropiate. What's your problem?

    6. Re:Wondering which was first... by eMilkshake · · Score: 1

      Wasn't the first the Tandy COlor COmputer?

    7. Re:Wondering which was first... by zonker · · Score: 0

      Of course there's also the Tandy CoCo... =)

    8. Re:Wondering which was first... by Anonymous Coward · · Score: 0

      Nope. The truly clever would note that Tandy COlor COmputer = CoCo, and not Cocoa.

    9. Re:Wondering which was first... by fatboy · · Score: 1

      Wasn't the first the Tandy COlor COmputer?

      What's really funny about that is the CoCo ran Microware's OS-9 Operating System.

      --
      --fatboy
    10. Re:Wondering which was first... by BlueGecko · · Score: 1

      Off topic, I don't care. Does Dylan really offer anything over Common LISP? (Other than an arguably more readable syntax.) It never really seemed to for me, for whatever it's worth, but then it died so quickly after being born I never looked at it very seriously.

    11. Re:Wondering which was first... by betis70 · · Score: 1

      >>They changed the name to "Cocoa" (it sounded more friendly?) right before they killed the project.

      Does this signal the end of OSX? ;-)

      --
      I forget...are we at war with Eurasia or East Asia?
  6. Re:Why objective C? by Anonymous Coward · · Score: 0

    What the heck? Objective C is a kludge, they should have used C++, the kludge of all kludges?!

    Not that I'd mind if the API were in C one bit--but I guess that's what Carbon is for.

  7. Re:Why objective C? by boltar · · Score: 1

    Syntactically it is a kludge, the objective part doesn't obey any of C's syntax rules. I'm no
    great fan of C++ myself but at least something like "class fred {" is an obvious extrapolation of
    "struct fred{ ]".

    And no I've not coded in Obj-C but I've seen code and that was enough to convince me not to bother
    and thats ignoring the fact that its a virtual irrelevancy in both the Unix and Windows worlds
    so career wise these days its about as much use as learning ALGOL or PL/1.

  8. Re:Cocoa or Chocolate: Not OT by Anonymous Coward · · Score: 0

    hot chocolate, IMHO

    And it doesn't really have anything to do with OS X programming, so it is offtopic.

  9. Re:Easy? Powerful? by entrox · · Score: 3, Insightful

    And why exactly would you want so set the mouse position? I don't want any program to control my cursor, because it can get VERY confusing and annoying. Playing with the input device of the user is a major UI sin if you ask me.

    I'd say thats the reason, why Apple didn't include such functionality into the API.

    --
    -- The plural of 'anecdote' is not 'data'.
  10. Apple Developer Connection by Sahib! · · Score: 5, Interesting

    For anyone interested in developing for Apple's platform, the Apple Developer Connection is an indespensable resource. I haven't read the O'Reilly book on Cocoa, but I suspect that, since it was written by Apple, most of the information there can be found, for free, on Apple's site. Apple has provided well-documented APIs, sample code and several tutorials for both Objective-C and Java (despite what the reviewer said, check here). Also, for those who want to develop for Mac OS X, once you have it installed, and the developer kit from Apple (after all, you won't be able to develop without it), you will find that most of the tutorials, API documentation, etc. are on your hard drive. This includes extensive documentation on the changes that Apple made to the BSD development tools (gcc, gdb, ld, ...). In short, my point is that if you are already familiar with programming in C, C++ or Java, you don't need a book to learn Cocoa. The information is all provided for free by Apple.

    --

    I prayed about it, and God said, "Don't do it!" But I thought, "I know better."

  11. Cocoa will replace Ecstasy... by yunfat · · Score: 4, Informative

    Well, maybe not, but as a everyday user of OSX its easy to see how Cocoa apps are the future. They interact better with the OS, they seem less bloated, and they just seem tighter. Cocoa apps like Okito Composer are compelling reasons to move to X... it blows away MS Word.

    --
    "Smokey, this isn't Nam, there are rules." -Walter
    1. Re:Cocoa will replace Ecstasy... by RevAaron · · Score: 2

      Not always. OmniWeb used to seem to hideiously slow and bloated on OS X, compared to iCab and even IE.

      It seems OmniWeb has caught up. Once again, it is my primary browser. And damn- I forgot how sweet pages look in OmniWeb!

      What was my point again? Oh yes. Cocoa has no intrinsic advantages as far as what the user sees- especially considering that Services are being largely ignored. The advantage comes to the developer, who is allowed more time to work on important things in their app, rather than pidly things. But Composer could've been written in Carbon or MFC- it just would've taken a lot longer. ;) (but wait! I suppose that is an advantage for end users!)

      ...and this is coming from me, a NeXTie, who still has a NeXT cube (working MO drive!) and ran OpenStep 4.2 and Rhapsody DR2/x86 on his PC until I finally just bought a Mac a year.5 ago. So, if anything, I'm positively biased toward the Cocoa API.

      --

      Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
    2. Re:Cocoa will replace Ecstasy... by Anonymous Coward · · Score: 0

      In a way, the limited API is also a feature -- it means that programmers who use cocoa write UIs that behave in a predictable manner instead of re-inventing the wheel, so to speak, as c programmers tend to do.

    3. Re:Cocoa will replace Ecstasy... by Anonymous Coward · · Score: 0

      Carbon applications are still clunky. Their event model is archaic. When an Carbon application blocks, you can't move the window out of the way like you can with Cocoa apps. This is singly the most annoying aspect of Carbon, along with not having anti-aliased fonts...

    4. Re:Cocoa will replace Ecstasy... by schwatoo · · Score: 1

      Carbon events that use the old 'classic' event model suffer from what you just described. If you use CarbonEvents you don't suffer from any of that. You are using CarbonEvents aren't you?

      --
      I have trouble with passwords among other things.
    5. Re:Cocoa will replace Ecstasy... by Anonymous Coward · · Score: 0

      On the contrary, this demonstrates to a tee the advantages of Cocoa. OmniWeb "used to seem to hideiously slow and bloated on OS X, compared to iCab and even IE", but now "It seems OmniWeb has caught up." while browsers developed in a less advanced environment have stood still.

  12. Open Source Cocoa by wiredog · · Score: 2, Funny
    (recipie)

    For each cup:

    Mix 2 tbs cocoa powder with 2 tbs sugar.
    Slowly add 8 oz milk while stirring.
    Heat on stove, but do not allow to boil!

    Add 1 shot of either orange liquer, creme de menth, or Irish Cream.

    If you don't like those froo froo 'liquers' but instead prefer real liquor, add 1 shot Southern Comfort Bourbon or Rum

    1. Re:Open Source Cocoa by Anonymous Coward · · Score: 0

      SoCo is not "real liquor", it's chix lix, dude. I tastes like 20% whiskey mixed with 80% Karo syrup.

    2. Re:Open Source Cocoa by Lars+T. · · Score: 2

      Southern Comfort is a froo froo liqueur. Try Strohrum instead.

      --

      Lars T.

      To the guy who modded me down from perfect to terrible Karma - Apple haters still suck

  13. Re:The Joy of Objective-C? by entrox · · Score: 1

    Because OS X inherited from NeXTSTEP and that in turn used Objective C. Why fix what ain't broken?

    --
    -- The plural of 'anecdote' is not 'data'.
  14. Where are the compilers? by mrseth · · Score: 1

    My dad just got a new G4 with OSX on it. He wanted to network it with his Win2K box so I thought I'd just build Samba on it. After I figured out how to get root on it, I discovered the most basic UNIX tools were not there (e.g., Make, gcc, etc.). There was nothing on the disks that shipped with it, so I went to apple.com and what they put you through to download the GNU tools is unbelievably bad. I like OSX, but it seems to me if they want people to develop for it they would want to make it easy to get the tools to do it. I had to fill out form after form after form and at the end there was still no obvious link to download the GNU tools. It was late and maybe I was just tired, so if anyone knows an easy way to get these let me know.

    1. Re:Where are the compilers? by Anonymous Coward · · Score: 0

      Dude, you go to developer.apple.com or whatever it is, click "Get Developer tools" fill out ONE FORM if you've never downloaded from them before, and you're done. What could be easier? Further, they give you nice tutorials with source and documentation that take you through concepts and tools.

    2. Re:Where are the compilers? by amRadioHed · · Score: 1

      It would be nice if the dev tools came with all copies of OS X, but they don't. If you ordered the 10.1 update from Apple (the $20 one), it came with the cd's, i think.

      Also, if your dad just wants to connect to a SMB share, that support is built into 10.1. Just type the url in the Connect To.. item in the Go menu.

      It is supposed to work well, but i have personally had troubles with it connecting to some networks.

      --
      We hope your rules and wisdom choke you / Now we are one in everlasting peace
    3. Re:Where are the compilers? by hotsauce · · Score: 1

      Unfortunately, gcc is only installed (as cc) as part of the Developer Tools. And unfortunately, you only get the Developer Tools if you shell out for a shrinkwrapped version of the OS. The good news is that you can get them for $19.95 with the OS X 10.1 upgrade.

      Otherwise, you were doing the right thing. The Developer Tools are a free download from developer.apple.com. Sign up as an Online Member.

    4. Re:Where are the compilers? by Anonymous Coward · · Score: 0

      http://www.apple.com/developer/

      sign up for a free online developer connection account. Download the tools. In addition to the gcc compiler collection and command line tools, you get a whole host of IDE tools and debugging apps.

    5. Re:Where are the compilers? by Phroggy · · Score: 2

      um, wasn't there a grey CD in the box labeled "Developer Tools"?

      --
      $x='S24;r)>63/* h@<5+oZ)32"5cz';$me='phroggy'x$];
      $x=~y+ -xz+\0-Tx+;print$_^chop$me for split'',$x;
    6. Re:Where are the compilers? by Anonymous Coward · · Score: 0
      1. OS X comes with Samba, so don't bother with the compile. Just turn it on in the Sharing control panel.
      2. The developers tools like make and gcc come on the Devlelopers Tools disk. It comes with the OS X boxed edition.
    7. Re:Where are the compilers? by Anonymous Coward · · Score: 0

      the Developer tools come on a separate CD and are not installed by default. Once you install those, gcc, make etc are there although soem of the tools have altered environment settings and options in order to work with Cocoa and OSX. GNU-Darwin has a plethora of BSD ports tweaked fo OSX. I recommend isntallign the developer tools and then going there. Samba is ported and works.

    8. Re:Where are the compilers? by Nebrie · · Score: 1

      go to connect.apple.com, register for free, download.

    9. Re:Where are the compilers? by didiken · · Score: 1

      Most user getting a Mac doesn't intend to do programming or "compile samba". They don't want a command prompt get in their way okay. It is a very logical choice to put the developer disk on a separate CD. It is just one click away and you'll get all the glories of BSD from openssh to make. I don't think gcc for OS X is bad at all. Even Apple's Project Builder use GCC and gdb. If you want to do Apple programming, learn Cocoa or Codewarrior for Carbon.

      Do you really need to compile Samba when they're ready to download from versiontracker.com ?

      I join the Apple Student Developer program and I've no trouble getting the developer tools online either. To say a fair word I don't think it is that difficult to grab the developer tools. Many folks port fantastic unix programs over to MacOS X without trouble and why can't you ? Just dig around and be familiar with it.

    10. Re:Where are the compilers? by Anonymous Coward · · Score: 0

      hey numb nuts, your OSX install disc should have come with a developer CD (for free), and if it didnt, you got screwed.
      All the developer tools are free, but they arent installed by default because, in case you haven't noticed, the tools, plus all the developer stuff (header files, documentation, etc) can span hundreds of megabytes.

    11. Re:Where are the compilers? by Rand+Race · · Score: 2, Informative
      ...if anyone knows an easy way to get these let me know.


      Try Fink, it's got, among a mass of other stuff, Make. OS X comes with a version of gcc installed called cc. Fink will probably get you all you want other than that. Here are some common compiling problems and solutions for OS X.

      --
      Insanity is the last line of defence for the master diplomat. But you have to lay the groundwork early.
    12. Re:Where are the compilers? by Anonymous Coward · · Score: 0

      OSX 10.1 already supports SMB networking from the finder. "Build Samba".... sheesh, seems to me you are trying to make a mountain out of a molehill here.

    13. Re:Where are the compilers? by 90XDoubleSide · · Score: 4, Informative

      Or you can sign up for a free web ADC membership and d/l the developer tools for free, although they are sometimes posted a few weeks after they are available on CD.

      --
      "Reality is just a convenient measure of complexity" -Alvy Ray Smith
    14. Re:Where are the compilers? by Anonymous Coward · · Score: 0

      Not in all boxes, froggy. My new iBook didn't have it.

    15. Re:Where are the compilers? by Anonymous Coward · · Score: 0

      >>OS X comes with a version of gcc installed called cc

      Oh my, that is funny. Don't any of you dorks know that cc came first?

    16. Re:Where are the compilers? by class_A · · Score: 1

      You don't get the Developer Tools in the box with a new machine - you just get a vanilla OS9/OSX dual boot install.

    17. Re:Where are the compilers? by firewort · · Score: 2

      If you install OS X yourself from the CD, you get the option of installing the gnu tools.

      I imagine Apple just pre-installs without for most regular users' convenience.

      --

    18. Re:Where are the compilers? by tbone1 · · Score: 1
      OS X comes with a version of gcc installed called cc.

      Good God, do I feel old!

      --

      The Independent: Reverend Spooner Arrested in Friar Tuck Incident - ISIHAC, Historical Headlines
    19. Re:Where are the compilers? by spitzak · · Score: 2
      Have you thought about how useful it would be for end-user applications to have guaranteed access to a compiler? Granted the programming of the application is going to be hard, but imagine things like database front ends or presentation software where the user can hit a button that says "make this thing I've built with the GUI run 100 times faster" and after 10 seconds or so there is a compiled plugin. They don't have to know C or shell scripts or type anything, but the compiler could be a huge advantage.

      The only reason to not include the compiler by default is so that Apple could make money selling it (the GPL means any buyer can give away free copies, but Apple could include something non-GPL such as a library or header file in order to make that not useful).

      But Apple seems to be giving it away for free, so I am at a loss as to why they did not include it. There is junk on the system disk dozens of times larger than all the development tools (like sample movies and images) so they are not saving much space. And it seems the sales record keeping and pressing of extra $19.95 disks and the free download site are costing more than the marginal cost of sticking them on the distribution.

    20. Re:Where are the compilers? by Fillup · · Score: 1

      free download.
      connect.apple.com

      --
      "I think there is a world market for, maybe, five computers." __ IBM Chairman, 1943 __
    21. Re:Where are the compilers? by jbloggs · · Score: 1

      while it did not come with my powermac g4 (probably because most mac users wouldn't know what the fuck it is), when I initially bought 10.0 when it came out I got a developer cd, along with my 10.1 update.

    22. Re:Where are the compilers? by Rand+Race · · Score: 1
      The cc included with OS X is a version of gcc based on 2.95.2 with extensive Apple modifications.


      Nothing funny about ignorance parading as arrogance... dork.

      --
      Insanity is the last line of defence for the master diplomat. But you have to lay the groundwork early.
  15. Re:Easy? Powerful? by Anonymous Coward · · Score: 0

    Yes, now let's all hold hands and thank our savior Steve Jobs for taking away functions which might confuse simple folk like us. His superior judgement shines through here almost as much as his continuing decision to force one-button mice down our throats lest we get baffled.

  16. Re:Setting the mouse position by Eric+Albert · · Score: 2, Informative

    You can set the mouse position through Core Graphics. No, it's not Cocoa per se, but the CG APIs can be called from Cocoa. "Direct access to memory registers" isn't required.

  17. I do NOT reccomend the o'reily book by sammy.lost-angel.com · · Score: 2, Interesting

    The review is right. It's not layed out well, it's difficult to navigate. Worst of all, most (if not all) of the examples from the book are taken from Apple's web site. Save yourself some money and time and get the book by Aaron.

    1. Re:I do NOT reccomend the o'reily book by RevAaron · · Score: 2

      I agree. I got a big kit from the ADC about Mac OS X development (it's good to be the president of your local ACM chapter [yO! Uni of MN Duluth!]), which contained Learning Cocoa.

      Not sure why anyone would spend the almost $40 cover price for this book- seemed to have the same content as the Learning Objective-C PDF that Apple has on their site!

      At least I got a few posters with the class hierarchy on them. :)

      --

      Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
    2. Re:I do NOT reccomend the o'reily book by Anonymous Coward · · Score: 0

      Yo! ACM@UIUC!
      www.acm.uiuc.edu

      I know, off-topic, sorry. :)

    3. Re:I do NOT reccomend the o'reily book by RevAaron · · Score: 2

      Midwest ACM recognize!@$! ;)

      --

      Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
  18. coco? by Heem · · Score: 1, Offtopic

    Ahh my first computer. The COCO. 16k of ram, cassette player for storing programs, 300 baud acoustic coupler. Ahh yes. Oh wait, COCOA - nevermind.

    --
    Don't Tread on Me
    1. Re:coco? by b1t+r0t · · Score: 2

      Don't forget the best 8-bit CPU every made, the 6809. I bought one of those things just so I could hack out some 6809 assembly code.

      --

      --
      "Open source is good." - Steve Jobs
      "Open source is evil." - Microsoft
  19. Re:The Joy of Objective-C? by the_2nd_coming · · Score: 1

    I hope thatthey include more languages as OS X matures....for now, they have carbon, but I bet they will begin to add cocoa support for C++ and others when they want to make the transition from both carbon and cocoa to all cocoa.

    --



    I am the Alpha and the Omega-3
  20. Re:Easy? Powerful? by the_2nd_coming · · Score: 1

    OS X supports the second mouse button dude, as well as scrolling.

    --



    I am the Alpha and the Omega-3
  21. java by Fillup · · Score: 4, Informative

    No it's not a "marketing thing." If you know anything about OO and Java programming, it's actually very easy to write a Swing program that uses the Aqua look and feel. And you can place Cocoa-access code in its own objects so that you can remove / change that code later.

    I find that it's actually very good for prototyping complex GUI apps. And the reason there isn't much information about it is that the Java API is simply a name-for-name bridge to the Objective C api. The objects (almost all of them) are provided in Java as bridges to the actual Obj C objects.

    They essentially did the Visual J++ thing but they did it __right__. Their classes are in addition to the Java 2 platform, not a sneaky replacement for it. I personally wish __more__ vendors would provide platform-level access in bridged Java classes.

    --
    "I think there is a world market for, maybe, five computers." __ IBM Chairman, 1943 __
    1. Re:java by flagstone · · Score: 1

      They essentially did the Visual J++ thing but they did it __right__. Their classes are in addition to the Java 2 platform, not a sneaky replacement for it. I personally wish __more__ vendors would provide platform-level access in bridged Java classes.


      Just to note: they've also done this with libraries other than Cocoa, such as QuickTime, Speech Framework and Spelling Framework. From their presentation at JavaOne, it sounded like they are planning to do this for other libraries/services as well. They're not cross-platform, but they do play well with pure Java (as opposed to certain other attempts to do the same thing).
      --
      These people have looked deep within my soul and assigned me a number based on the order in which I joined.
    2. Re:java by mobosplash · · Score: 1

      So to clarify on the Java-Cocoa relationship. You can write an app in Java with Swing and then later switch the UI code to Cocoa when everything is working well?

      Is the switch straight forward enought that you could easily maintain a Swing version for Linux/Win/Other and the cocoa version for OS X?

      Does it gets truly native behavior like sheets? Aqua's Swing stuff looks good but many things like open/save boxes are clearly not native.

      Since Swing is usually the slowest part of a Java app does the performance pick up a lot too?

    3. Re:java by Fillup · · Score: 1

      Aqua is actually the look and feel. You can program a pure swing app and use the pluggable look and feel api to "plug in" the Aqua L&F. Just like when you deploy the app on Windoze you can choose "Windows" L&F etc. (if you want, or you can maintain a consistent "Java" appearance if you like). It's still pure Java (official Scott McNealy-blessed), you just plug in the Aqua L&F kinda the same way you would plug in a language pack if you had an internationalized program.

      Cocoa, OTOH, is the platform. This is more difficult to explain...Cocoa's class library is kinda like the J2SE. It abstracts all the functions of the OS and platform, networking, filesystem, etc. for application development, and also provides nice convenience classes, etc.

      I have to say i have been consistently underwhelmed by the performance of the VM. It's not horrid, though, and I hear the next release is faster and Sun is even borrowing back some of the tricks Apple has put into HotSpot.

      Yes you can use Cocoa for the UI but it's really not necessary. What is nice is A. the native UI ability for tricks like sheeting, etc., that you mention and B. any services that you need or may want for whatever reason (performance, compatibility, convenience, special API's like QuickTime, etc.) you can get directly from the OS.

      I consider this to be just like using JNI. When you really need it or it would be more elegant (rare), it's there, you just make sure to put it in its own kind of little box and wrap it in pure Java so you can change the underlying implementation later or for other platforms.

      Overall, without Java apple would only be supporting Obj-C, a kind of rare and obscure language. This allows them to get the reams of Java programmers out there a little more interested in their OS, and it greatly multiplies the number of people eligible to write "native" apps for the new platform.

      --
      "I think there is a world market for, maybe, five computers." __ IBM Chairman, 1943 __
  22. Objective-C Tutorial and Reference by Jon+Abbott · · Score: 5, Informative

    For those interested in learning Objective-C (assuming a working knowledge of C), look no further than
    this PDF.

  23. Re:Open Source Cocoa- Revision 1 by alfredo · · Score: 1

    Add a touch of ceyenne instead of the booze. It will intensify the Cocoa. Trust me, it does work.

    This comes from Central America, it is not my idea.

    --
    photosMy Photostream
  24. "There is another..." by desslok · · Score: 3, Informative

    ...and it's Mac OS X Developer's Guide by Jesse Feiler. It's probably best described as "a developer's introduction." It is very broad, covering topics from the Mach kernel to the Interfact Builder. It's at least worth a look.

    1. Re:"There is another..." by pdferguson · · Score: 1

      Personally, I think Feiler's book is a complete waste of trees. Anyone considering this book should first check the reader reviews on Amazon.com before spending their money on this. With books like "Learning Cocoa" and "Cocoa Programming for Mac OS X", and a variety of online resources, I don't see a situation where this book should be recommended.

      I will recommend a new user-level Mac OS X book: "Mac OS X Unleashed" by John Ray and William Ray. It is targetted at power users who want to learn more about the BSD side of Mac OS X, especially the arcane world of Unix networking administration. The authors Ray bring a great deal of Unix experience as well as a love of the Mac, and they have written an outstanding book that bridges the two worlds. The book is broad and deep (and at more than 1400 pages, heavy) and is up to date with 10.1.

  25. So... by banky · · Score: 3, Interesting

    Java applications that only run on Windows are *bad*, and Cocoa-Java apps are... well, no one said they are good per se, but you'd think Sun would have to object on the same grounds. 'Cept that it is Apple.

    But you'd think it's Unix, too, so it potentially steals market share...

    --
    ZOMG I WOULD LOVE TO KNOW ABOUT YOUR FEELINGS ON MACINTOSH VERSUS WINDOWS, VI VERSUS EMACS, AND HOW YOU'RE NOT A DORK
    1. Re:So... by RevAaron · · Score: 2

      They won't object because it's not the same thing.

      Apple created an Objective-C/Java bridge to allow programmers to access Objective-C objects and classes from Java. An external, native library, accessed through JNI funkiness. A person not running Mac OS X just doesn't have the Cocoa library, do they cannot use apps that depend on it.

      MS fuddled with the spec, and the VM, making what could've been standard Java apps not run on other platforms and virtual machines.

      So Sun couldn't object on the same grounds- unless interfacing with any native library is grounds enough for you. And if it is, why not stop the people making GTK+ bindings for Java too?

      --

      Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
    2. Re:So... by TWR · · Score: 3, Insightful
      I can't tell if this is anti-Apple FUD, anti-Sun FUD, or anti-Java FUD.

      The fact is that Sun had no problems with MS making it easier to tie Java apps to Windows via J/Direct.

      What they objected to was MS leaving out bits of functionality by obeying the letter of the spec and not the spirit (RMI support, for example, required accessing an FTP server at MS that would change from time to time).

      Apple has been providing ways to bridge Mac OS calls and Java for about 4 years. Sun has never objected, because Apple also implements the Java spec to aching accuracy. They just add extra stuff on top of it.

      -jon

      --

      Remember Amalek.

    3. Re:So... by Anonymous Coward · · Score: 0

      They're *not* Java applications. They're Cocoa applications that just happened to be programmed in Java.

      Mac OS X does have full Java support, which is a completely separate thing.

  26. Carbon and Cocoa Application Lis by SolidCore · · Score: 2, Informative

    This page contains a list of applications that are either already Carbonized or Cocoaized or are in the process of being Carbonized or Cocoaized. Check it out at Xappeal

  27. Be careful! by BoarderPhreak · · Score: 3, Informative
    Neither this book, nor "Learning Carbon" are for beginners! There's not much in the way of introductory text in either.

    IMO, there's a MUCH better book on Carbon programming out now, which is about 1.75" thick and darned heavy - I think it's called "Carbon Programming" or vice versa... D'ohhh.

    Keep in mind, too - what the difference is between Cocoa and Carbon. The former being Objective C (object oriented and much like C++) and the "real deal" for MacOS X programming, and the latter being based on C. The benefit of the latter being that it will run on either MacOS 9 or X. Then again, there's higher level languages that you can use like RealBasic or Applescript - or hell, Perl. :)

    Be sure to check out Everything Mac for loads of MacOS X goodness.

    1. Re:Be careful! by Anonymous Coward · · Score: 0

      What does "real deal" mean? Just that Cocoa is encouraged by Apple?

      Or that Carbon is build on top Cocoa (calls to Carbon are implemented as calls to Cocoa)?

      What are the costs to using Carbon instead of Cocoa, other than what is likely a somewhat dirtier API?

    2. Re:Be careful! by Apotsy · · Score: 1
      Actually, Carbon and Cocoa live at the same level in the system, as shown by this diagram.

      Cocoa requires an Objective-C runtime to work, but Carbon does not, as it is just a library. A little known fact is that both APIs allow the use of InterfaceBuilder to layout the GUI elements. Carbon has added support for .nib files in addition to the old-style resource manager stuff. And the new Carbon event structure is actually very nice.

    3. Re:Be careful! by BoarderPhreak · · Score: 2
      Basically what Apotsy said above...

      It depends on what you're doing, too. Carbon is the easiest method, IMO and lends itself highly to porting existing applications. It contains most if not all of the previous Mac APIs and uses C, which is relatively easy to boot.

      Cocoa is better if you're writing something from scratch and by "real deal" I mean that is what specifically for-MacOS X applications are written in. Carbon is a sort of stop-gap or "migrating method" to bridge MacOS 9 and X.

    4. Re:Be careful! by Anonymous Coward · · Score: 0

      The SAMS book "Carbon Programming" is just a dead-tree version of the awesome text "Macintosh C Carbon - A Hobbyist's Guide To Programming the Mac OS in C" by K.J.Bricknell (which is a followup to an older Toolbox version by the same author, called "Macintosh C") and the entire book can be browsed online in HTML or downloaded as PDF for absolutely free (no registration required). Good writing and plenty of sample code included.

    5. Re:Be careful! by Lars+T. · · Score: 2

      Yes, Objectiv-C is (truely) object oriented, but is very much unlike C++, which is "object oriented"-like. Well, you may disagree about those definitions, but they use objects differently, actually in an incompatible way. Carbon OTOH doesn't care if you use procedural languages like C or (Real)Basic, or an OOP wrapper with languages like C++. That's why, if you want to use C++, you have to use Carbon for programming - just like Alias|Wavefront did with Maya

      --

      Lars T.

      To the guy who modded me down from perfect to terrible Karma - Apple haters still suck

    6. Re:Be careful! by Apotsy · · Score: 1
      Carbon is more than just a 'stop-gap' measure, it is a full featured API set. And like you said, it's to port to/from it than with Cocoa.

      Also, the Carbon APIs are actually a lot more robust when it comes to error handling. Nearly all of the Carbon APIs return meaningful error codes, so that your app can do the right thing in case of failure. Cocoa makes poor use of such mechanisms, opting for a simple boolean pass/fail in the best cases, and nothing at all in the worst. It also fails to take advantage of language-level exceptions for error handling. Basically, if something goes wrong in your Cocoa app, you're screwed when it comes to getting enough information to actually do something meaningful about it. And some of the newly developed software that is inherited from NeXT is even worse. CoreFoundation will simply call abort() on your app in many cases. How rude!

      I know Apple's marketing material hypes Cocoa and downplays Carbon, but in the end, apps are better off with Carbon. Even major developers who are new to the Mac are choosing to use it (i.e., Maya).

      Besides, a lot of the most interesting stuff in Mac OS X is down below the Carbon/Cocoa level. Quicktime, ColorSync, ATS, etc. are all in the Application Services level, and are thus accessible to both Carbon and Cocoa apps.

    7. Re:Be careful! by Anonymous Coward · · Score: 0

      Actually, that last statement is not true not true. Cocoa apps can use Obj-C++ now (it works with the last two revs of Project Builder), which implies that your C++ code will work with Cocoa. Obj-C++ is to C++ as Obj-C is to C, so there's a pretty logical connection between the two technologies. There are actually several apps that are beginning to use this functionality, notably Fire and some highly experimental builds from Mozilla.

  28. Python for Cocoa by eAndroid · · Score: 4, Interesting

    There is work being done to let Python be another Cocoa language by enabling python to access Objective-C objects. This is a great idea as it would let Cocoa apps be built and prototyped very fast.

    Even if you don't favor making your releases in Python few people disagee that Python is great for rapid prototyping.

    If you are interested in helping out visit the sourceforge project where work is just beginning on a rewrite to take advantage of Python 2.2's new class/type system.

    --

    I can't spell or type, but that doesn't mean I'm unusually stupid.
    1. Re:Python for Cocoa by RevAaron · · Score: 2

      Is there still active work being done on this? I've been wanting this since my NeXTSTEP days!

      --

      Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
    2. Re:Python for Cocoa by eAndroid · · Score: 1

      Yes work is still being done. Of course like many open source projects it progresses as participants have spare time to work on it.

      Many of the people involved were also NeXT users - the current verion still uses old NeXT libraries.

      --

      I can't spell or type, but that doesn't mean I'm unusually stupid.
  29. Re:Why objective C? by pete-classic · · Score: 2

    ANSI C on an Objective C compiler and it's no big deal.

    Uh, the same is true of C++.

    calling Objective C a "kludge" while suggesting C++ doesn't make much sense if you think about it.

    Sure, this is true. They are both C + OO kludged in.

    So, Objecive-C and C++ are both backward compatable, OO kludges of C.

    You haven't made much of an arguemnet for either one over the other.

    OTOH, Objective-C is used by . . . Apple. C++ is used by "everyone" (I suspect this includes Apple).

    Bottom line is that there is no rational reason to use Objective-C. Clearly this is a case of Not Invented Here on Apple's part. (AFAIR Objective-C is a NeXT thing, but six of one, half a dozen of the other; it's all Jobs.)

    -Peter

  30. Re:Why objective C? by Jeremy+Erwin · · Score: 3, Interesting

    I suppose that "private:" is an obvious extrapolation of "case:" as well. Objective C++ doesn't extend the language as much as C++.

    One of the big problems with writing GUIs in C++ is that the type system gets in the way. The kludges neccessary to support a GUI system on C++ are infamous. Most systems resort to macros. GTK-- uses templates. QT uses a preprocessor and language extensions.

  31. Re:The Joy of Objective-C? by Phroggy · · Score: 3

    Well, I understand they've already added Objective C++. I wouldn't be surprised if they added more in the future.

    --
    $x='S24;r)>63/* h@<5+oZ)32"5cz';$me='phroggy'x$];
    $x=~y+ -xz+\0-Tx+;print$_^chop$me for split'',$x;
  32. Idiots keep attacking Objective C 's syntax by lordpixel · · Score: 5, Insightful

    There are tons of posts here saying Objective C has an ugly syntax.

    What they mean is it doesn't look like C and C++ and Java.

    Of course, how it looks has no bearing on how useful a language it is (heh, think Perl ;), but these people are too ignorant or blinkered to realise this.

    Who cares what the syntax for calling a function is? So long as its not 3 pages of code its irrelevant.

    Do we see any insightful comparison of the truly powerful language features from these people? Do we see discussions of how C, C#, C++, Java and Obvjective-C's approach to types and bindings work? How they support dynamic behaviour?

    eg, I'm prepared to state that Objective-C makes generic types unnecessary, whereas C++ relies on them and Java is introducing them (slated for JDK 1.5). This is a good thing in C++, will be a good thing in Java, and I expect to see them in C# one day, because of commonality between how these languages are defined. Objective-C doesn't need them, it has another solution, more akin to Smalltalk.

    We don't see this sort of comment (shallow though my example is) from most of the posters here because frankly all that they're experienced enough to comment on _is_ the syntax.

    Even all that said - the features of the language pale into insignificance next to the quality of the class library. Java is nothing without the java.* and javax.* classes, C# is useless without the .NET runtime or at least the Base Class Libraries. C is limited without sdtlib, C++ needs the STL or on MS platforms (shudder) MFC to get the full benefits.

    This is a review of a book about Cocoa, not Objective-C. The class library, not the language. The class library will dominate any concern over the language used to program it. Learning a language takes days (or weeks if its something completely new to you like your first declarative functional or logical language). Learning a class library can take months or years (depending on the size).

    Do yourself a favour and learn some more languages. Learn about languages. Use real class libraries. Then open your big mouth!

    --

    Lord Pixel - The cat who walks through walls
    A little bigger on the inside than out

    1. Re:Idiots keep attacking Objective C 's syntax by FortKnox · · Score: 1

      Of course, how it looks has no bearing on how useful a language it is (heh, think Perl ;), but these people are too ignorant or blinkered to realise this.

      Who cares what the syntax for calling a function is? So long as its not 3 pages of code its irrelevant.


      I agree, the looks have no bearing on how useful a language is, but what the syntax looks like does have a bearing. Try writing an Object Oriented Program in Object-C, Perl, C++, and Java. Now look at them all.
      Which one is more readable?
      Which one would be easier to modify?
      Which one would -you- want to maintain?

      How clean looking code is, is significant (not as significant as other things, such as speed, if there is a noticible difference; but as far as similar bytecode produced is concerned).

      --
      Good quote, too many chars. Seriously, the slashdot 120 char limit sucks!
    2. Re:Idiots keep attacking Objective C 's syntax by Anonymous Coward · · Score: 0

      > Java is nothing without the java.* and javax.* classes, C# is useless without the .NET runtime or at least the Base Class Libraries. C is limited without sdtlib,C++ needs the STL or on MS platforms (shudder) MFC to get the full benefits
      [snip]
      > Do yourself a favour and learn some more languages. Learn about languages. Use real class libraries. Then open your big mouth!

      First off, close your own.

      Java needs java.*, but it does not need javax.*. The same goes with C#, it needs some parts of the class library, but most of it is independent of the class library. And stating that C# is useless w/o the .NET runtime is like stating that java is useless w/o the java runtime. Ever heard of gcj? $100 says there will be a gc# at some point compiling native code.

      C is not at all limited without stdlib. You could write your own stuff. The language does not depend on stdlib, it's the other way around.

      C++ [the language] does not need STL. STL depends on C++, not the other way around. However, the C++ standard [language and standard class libraries] specifies the STL as a component.

      In Windows, you DO NOT NEED MFC. In fact, forget all about MFC. Screw it. If you are into any serious Windows development, use ATL and WTL. You don't get MFC bloatness. Stating that you need MFC to get the full benefits is utter bullshit. You can do everything MFC can do and then some by using the Win32 API. MFC depends on Win32, not the other way around..

      So.. go read a book or something.

    3. Re:Idiots keep attacking Objective C 's syntax by RevAaron · · Score: 1, Flamebait

      Amen! I curse the day Bjarne was born, unleashing the mass of retards which attack us!

      --

      Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
    4. Re:Idiots keep attacking Objective C 's syntax by Anonymous Coward · · Score: 0

      ObjC syntax looks spiffy to me.. it's C++ that scares me....

      (heading back to ProjectBuilder now)

    5. Re:Idiots keep attacking Objective C 's syntax by rthille · · Score: 1
      What they mean is it doesn't look like C and C++ and Java.

      Thank God!

      I learned C in 1987, then Objective-C back in 1989, and C++ was forced on me sometime later.

      I still can't stand C++'s syntax. Looking at it gives me a headache. God, even poorly written Perl is better!

      Give me the smalltalk like syntax of Objective-C any day!

      --
      Awesome furniture, accessories and cabinetry in Santa Rosa, CA: http://humanity-home.com/
    6. Re:Idiots keep attacking Objective C 's syntax by Anonymous Coward · · Score: 1, Interesting

      What feature of Objective C makes templates unnecessary? I guess you might be referring to the fact that I can send a message (i.e. call a method) on an object without having to guess at the type of the object (with lots of instanceof ugliness like I would need in Java).

      I guess that's great for getting rid of the slightly inconvenient cast that I would need in (pre-generic) Java, but it doesn't give me any of the type safety of templates or generic types, because that's not going to stop me from adding an object of the wrong type to a vector, for example.

      But I'm not very familiar with Objective-C, so maybe you have something in mind that would give me that kind of safety?

      Objective C is kinda interesting, but the fact that it's a superset of straight C works both for and against them. It's somewhere in between C++ and Java in terms of cleanliness of the langauge (C++ being horrible, Java being decent), and if I didn't care about performance, I'd prefer Java or some other not-C compatible language. over Objective C.

      When I got mac OS 10.1, one of the docs said something about Objective C++, which sounds scary as hell...

      You're definitely right about class libraries being way harder to learn than langauges. That's why I think we need to shift some of the burden from class libraries to languages--i.e. use languages with more advanced features, even if they require more study to understand, that could make libraries and other large bodies of code easier to understand You only have to learn the programming language once, but every time you switch to a new project you've got to learn a whole lot of new libraries. More expressive type systems would really help here...

    7. Re:Idiots keep attacking Objective C 's syntax by lordpixel · · Score: 2

      You're splitting hairs.

      Of course it depends on who you are and what you want, but for most people most of the time, the libraries is where the action is at.

      Technically, you're right, of course. You don't *need* stdclib, you don't need javax.* or STL. Its just that most of the time you'd want to use these things, unless your needs are specialised. [*]

      Things like gjc are niche applications. Technically, you're right, you don't need the Java or .NET Runtime. In practice almost everyone uses or will use it. It doesn't mean I wouldn't like to see more ppl using gcj, but currently its niche.

      The reason people use it is because they perceive it will allow them to develop more complex applications more quickly (and hopefully more secure, and more robust etc). And that's what's relevant when comparing class libraries.

      To some extent I'll shut my mouth over MFC, for indeed there I don't know how much more useful it is or isn't. In this context it doesn't really matter whether its a good library or not though. My point was that its a waste of time to compare languages if you should be comparing libraries. If you compare MFC and find its unnecessary, that's a valid thing to do...

      [*] I'll give you that I should have been more specific. eg, a client side Java programmer probably doesn't need javax.*, but a server side programmer almost certainly will at some point. Sure, they could code it all from first principles, or java.* classes, but most people will never need to. So no, its not essential, its just "extremely useful". If one's splitting hairs, then yes, that's not the same thing.

      --

      Lord Pixel - The cat who walks through walls
      A little bigger on the inside than out

    8. Re:Idiots keep attacking Objective C 's syntax by lordpixel · · Score: 1

      > What feature of Objective C makes templates unnecessary?

      Confession time - I saw something that I was pretty sure would solve this when I was halfway through the objective C book, but I don't recall it off the top of my head. I posted a link to the book elsewhere on this page...
      > It's somewhere in between C++ and Java in
      > terms of cleanliness of the langauge
      Certainly the syntax has some clunkiness here and there (how you define private methods springs to mind). I think overall I might be prepared to trade these inconveniences for much later binding than Java though...

      >When I got mac OS 10.1, one of the docs
      >said something about Objective C++,
      >which sounds scary as hell...

      Actually, I think all that is is a way to call libraries written in C++ from Objective C (and maybe vice-versa?). Not scary, actually pretty useful (be a bit annoying if all you could link to was other objective c libs or C but no C++ libs)

      >That's why I think we need to shift some
      >of the burden from class libraries to languages

      I'm inclined to agree with you. Its nice to see "assert" becoming a keyword in Java rather than a library based kludge. And where would we be without try/catch/finally semantics.

      Java Reflection is an example I have mixed feelings about. Its done (almost) entirely through classes, and it sure does feel clunky sometimes. But it landed in Java 1.1 without causing many problems (because it didn't change the language...)

      Inner classes are an interesting one too. They did change the language, but not the runtime, because they were able to fake it in the compiler (actually, this is true for Java generics too, you have to use a special compiler, but it runs on straightup JDK 1.3/1.2).

      In other words, its a hard balance to get right.

      --

      Lord Pixel - The cat who walks through walls
      A little bigger on the inside than out

    9. Re:Idiots keep attacking Objective C 's syntax by Anonymous Coward · · Score: 0

      >> It's somewhere in between C++ and Java in
      >> terms of cleanliness of the langauge
      >Certainly the syntax has some clunkiness here and >there (how you define private methods springs to >mind). I think overall I might be prepared to trade >these inconveniences for much later binding than >Java though...

      Actually, all I was referring to was that you could use C code in Objective C. Presumably with all the wacky pointer tricks you want. I don't really know enough Objective C to know whether Objective C sans C would be more or less clean, syntactically or otherwise, than Java.

    10. Re:Idiots keep attacking Objective C 's syntax by nosferatu-man · · Score: 1

      Objective-C sans C would most certainly be cleaner than Java, as it would be, more or less, Smalltalk.

      Peace,
      (jfb)

      --
      To spur "enterprise Linux," Big Bang, the distributed two-phase commit.
    11. Re:Idiots keep attacking Objective C 's syntax by betis70 · · Score: 1

      >>eg, a client side Java programmer probably doesn't need javax.*

      ??? Only if the programmer wants to use AWT exclusively. Otherwise it is javax.swing.* and javax.swing.events.*

      --
      I forget...are we at war with Eurasia or East Asia?
    12. Re:Idiots keep attacking Objective C 's syntax by Anonymous Coward · · Score: 0

      >javax.swing...

      Oh yeah :) Too much applet programming for me (I'm actually fighting the AWT in another window as we speak).

      There is *so* much useful stuff in javax.*. Seems Sun just flip a coin sometimes over where to put stuff (java.* or javax.*).

    13. Re:Idiots keep attacking Objective C 's syntax by Anonymous Coward · · Score: 0

      Does smalltalk have garbage collection?

      I don't believe obj-c does...

    14. Re:Idiots keep attacking Objective C 's syntax by nosferatu-man · · Score: 1

      Yeah, Smalltalk does, and Obj-C doesn't. I suppose Stepstone didn't want to have to try and reconcile the Pointer Dance with a real garbage collector. Pity.

      Peace,
      (jfb)

      --
      To spur "enterprise Linux," Big Bang, the distributed two-phase commit.
    15. Re:Idiots keep attacking Objective C 's syntax by EvlG · · Score: 2

      The only complains I have about ObjC are the obscenely long method names, and the memory management.

      The infix notation for specifying method parameters is novel, since it allows for a message to read much like natural language. However, that tends to breed really long method names/parameters, which means the programmer is forced to type more. The collections libraries is evidence of that. I don't like typing that much. Its a minimal complaint, but it has dampened by initial enthusiasm for the language.

      As for the memory management, I hate manual reference counting. It's one of the most egegious aspects of COM on Windows, and I was quite disappointed to discover it is an issue in Objective C.

      I do still have much to learn about Cocoa and Objective C, but those two issues have been a source of frustration to me.

    16. Re:Idiots keep attacking Objective C 's syntax by spitzak · · Score: 2
      I think the complaint about Objective C is not that "[foo...]" is uglier than "foo(...)" but that it uses both styles in the same program. SmallTalk only used the square bracket syntax for all function calls.

      The problem is that the original Objective C was a C preprocessor that did not even parse things, it acted like a macro processor and replaced any "[...]" sequence preceeded by anthing other than a C identifier with a C function call taking string arguments.

      If they had worked harder to parse C some more I'm sure they would have used a syntax like "method(object,...)" so that you could easily switch function calls to method invocations.

      Or they could have used SmallTalk unchanged.

      But the actual compromise is not something anybody should be proud of!

    17. Re:Idiots keep attacking Objective C 's syntax by Anonymous Coward · · Score: 0

      However, that tends to breed really long method names/parameters, which means the programmer is forced to type more.


      Big deal. How much of my time as a programmer is spent typing new code, as opposed to designing new code or fixing old code or ... anyway, I think the payback in readability is well worth it. And ever heard of "tab completion"?
    18. Re:Idiots keep attacking Objective C 's syntax by Anonymous Coward · · Score: 0

      That's exactly right. While I agree that syntax is a poor reason to criticize a language, I can see why some people don't like Obj-C. It *is* an odd mix of two languages and it takes a little while to get used to.

    19. Re:Idiots keep attacking Objective C 's syntax by Anonymous Coward · · Score: 0

      well, technically you don't need java.*, just java.lang.Object. And then write your own

    20. Re:Idiots keep attacking Objective C 's syntax by Anonymous Coward · · Score: 0
      As for the memory management, I hate manual reference counting. It's one of the most egegious aspects of COM on Windows, and I was quite disappointed to discover it is an issue in Objective C.

      Really? I'm a Java programmer in my day job and I find Objective-C's memory management to be a godsend in my hobby coding. In Java you have absolutely no control over memory - even calling the garbage collector doesn't mean the occupied but unused memory is actually recouped. In fact, Sun warns you againt calling the gc yourself. In Objective-C you tell an object if you're using it and you're done with it - not that hard. You have the option of using autorelease to make it so that you don't have to worry about remembering to release the object in the end or when it is passed as a parameter to a method. When I watch my memory allocation for my little softsynth/sampler I wrote, memory usage is exactly as it should be at every point. That is something that could never, ever be said of Java. Java saves you some lines of code but if you want memory handling performance Obj-C is terrific.

      As for the way methods are specified, well, I find it annoying because it's forcing documentation into the actual code itself. For me it leads to redundant information with the names of the parameters (e.g "setSample:(SampleHolder *)sample ofLength"(int)sampleLength"). If there was some kind of a reason for this - such as if Project Builder had method lookup ability like in JBuilder, but it could only use the parameter titles, not the parameter names, then sure. As it is, it's utterly useless except to make methods more syntactical incompatible with C methods and since Carbon is all C with some C++ wrappers, you run into lots of interaction between your Obj-C code and regular C code if programming for OS X.

    21. Re:Idiots keep attacking Objective C 's syntax by Anonymous Coward · · Score: 0
      Smalltalk (not SmallTalk) doesn't have bracket syntax for "function" calls. Smalltalk uses brackets for block closures, which are something similar to a nameless method pointer/callback (to highly generalize). Smalltalk methods are called left-to-right on their objects in a syntax very much like Objective-C's (where do you think Brad Cox got the idea?):

      Smalltalk: myDictionary addObject:anObject.

      Objective-C: [myDictionary addObject:anObject];

      Similar, yes, but Brad needed a way to "switch" from standard C to Objective-C and chose the brackets as the trick (as myDictionary[] would ovbiously be an array). Objective-C does NOT have blocks. You are correct about the original translating the code to call a function (the dynamic dispatching mechanism), which essentially happens today, too.

      I wouldn't say one is uglier than the other, they are just different. One of the FANTASTIC advantages of Objective-C being a "compromise" language (a hybrid) is that you still have 100% access to standard C. Remember, the original NeXTcube (and even MacOS X) was a Unix box. Having direct access to all the C programs and libraries already available is a huge advantage -- one that Smalltalk would not have shared, even though Smalltalk is a purer OO language.

      /dev/mrg

    22. Re:Idiots keep attacking Objective C 's syntax by Anonymous Coward · · Score: 0

      ProjectBuilder and Emacs both allow you to do method name completion. Learn to use the tools so I can more easily read your obscenely long method names ... I mean code.

      /dev/mrg

    23. Re:Idiots keep attacking Objective C 's syntax by EvlG · · Score: 2

      I hate having to hit Control+Space all the time to do name completion - I find the name completion introduces a significant delay each time I have to use it. I'd rather just type the names myself, as I do in most every language.

      Besides, name completion doesn't help me wade through code with really long method names.

  33. Re:The Joy of Objective-C? by Anonymous Coward · · Score: 0

    Cocoa handles other object-oriented languages: C++, Java.

  34. Re:Why objective C? by bnenning · · Score: 3, Informative
    And no I've not coded in Obj-C


    Then your opinion is worth much less than those of us who have. Objective-C is more flexible, powerful, and easy to use than C++. Cocoa could not be done in C++ because it lacks the dynamic runtime of Objective-C.

    --
    How to solve most of our problems: 1.Lots of nuclear plants. 2.Cure aging.
  35. The story Slashdot is afraid to tell you. by Anonymous Coward · · Score: 0
    Hmm... Lets see... Didn't Slashdot used to report every little violation of the GPL they could find?


    But now that Red Hat is doing it, Slashdot refuses to tell the story. In fact, I don't believe I've ever had a submission get rejected so quickly.


    Perhaps Slashdot is Red Hat's little bitch.


    But anyway, here's the story. Red Hat is not allowing people to distribute Red Hat Linux. If you do, they insist you call it something else. A clear violation of the GPL if I ever saw one. I guess if its someone like Red Hat or VA, they can violate the GPL as much as they want and Slashdot could care less.

    1. Re:The story Slashdot is afraid to tell you. by Anonymous Coward · · Score: 0

      Yet another proof that open source and the almighty buck will never coexist. Not that this is a surprising turn of events, though.

      Stallman said *information* wants to be free. Not software.

      And to be honest, I'd rather have bucks than source.

  36. Re:Why objective C? by WillAdams · · Score: 1

    Objective-C was done by Brad Cox of Stepstone first. NeXT licensed it from him and later purchased it in its entirety.

    You should be able to find some articles by Brad Cox in back issues of Byte in a decent library, but his book on Objective C is long OOP :(

    William

    --
    Sphinx of black quartz, judge my vow.
  37. Re:The Joy of Objective-C? by Nebrie · · Score: 1

    If you don't want to learn Objective-C to program in cocoa, you have other options. There's Carbon (C++). Cocoa will just dramatically speed up your programming. For Cocoa, there's also Java, but most people seem to prefer Objective-C.

  38. There is another new book out there by orblee · · Score: 2, Informative
    How about Early Adopter Mac OS X Java? That covers Cocoa too, and is (to date) the only book that covers Java and Cocoa. The ISBN is 186100611X, and I am not at all biased because I was one of the editors on it :-)

    Read about it here

    1. Re:There is another new book out there by jamesoutlaw · · Score: 1

      I just got this one today... I'd recommend it to anyone who wants to do Java development on MacOS X.

    2. Re:There is another new book out there by wbajzek · · Score: 1

      Interesting... I skimmed it briefly at a bookstore the other day and it seemed to me that it provides only a very high-level overview (like, OS X uses HotSpot, Cocoa can be accessed from Java, and don't use MacOS-specific functionality when writing cross-platform Java).

      What do you find useful about it, and why would you recommend it? Did I just completely misjudge it?

    3. Re:There is another new book out there by jamesoutlaw · · Score: 1

      You are right, it's a little sketchy, but pulls together somethings that are a little difficult to find on Apple's developer web site and on other sites around the web. I thought that the chapter on Deployment and Integration provided some good information and also Chapter 5: Enhanced Integration was good. It answered some questions that I've had. Just ofr that information, I think it's worth the $25 I paid.

  39. Re:Easy? Powerful? by Anonymous Coward · · Score: 0

    Too bad you can't buy a computer from Apple without paying for a one-button mouse, though. Thank you Father Jobs!

  40. Objective-C - Apple give away whole free book by lordpixel · · Score: 5, Informative

    If you want to know more about objective c, or to prepare before reading the books above, or to gain more depth of understanding of the language if the chapter or so spent in the above books doesn't explain enough, then look no further than this:

    Object Oriented Programing and the Objective C language. Originally a Next Step book, now available free (HTML/PDF) at Apple.com or thru print on demand at Fatbrain.

    --

    Lord Pixel - The cat who walks through walls
    A little bigger on the inside than out

    1. Re:Objective-C - Apple give away whole free book by Jon+Abbott · · Score: 2

      It's pretty funny that you mention this, as I posted the same reference 14 minutes earlier -- and even more funny is that we both used "look no further" in our text! :^)

  41. Re:Easy? Powerful? by Anonymous Coward · · Score: 0

    Many games need to move the (hidden) mouse pointer to the center of the screen.

  42. Re:Why objective C? by Anonymous Coward · · Score: 0

    ALGOL? Stick to the subject. If you want to build Mac OS X GUI apps fast, learn Objective-C. It's just that simple. Like the reviewer and the author says, if you know C and C++, learning Objective-C is trivial.

  43. Re:Easy? Powerful? by Ikari+Gendo · · Score: 1
    Too bad you can't buy a computer from Apple without paying for a one-button mouse, though. Thank you Father Jobs!

    Too bad you can't buy something without paying for it! Thank you captain capitalism!

  44. Re:Why objective C? by RevAaron · · Score: 3, Interesting

    Objective-C adds very little actual syntax to C, whereas C++ adds a whole bunch. C++ is the kludge to end all kludges, Objective-C does is far better. Have you ever done a project in Objective-C, or are you just another slashkiddie talking out his ass?

    --

    Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
  45. Re:Michael Simmons by Havokmon · · Score: 0, Flamebait

    You moron. Michael Simmons (Author of said book), is not referred to on that site.

    That's Michael Sims, the Slashdot 'journalist'.

    --
    "I can't give you a brain, so I'll give you a diploma" - The Great Oz (blatently stolen sig)
  46. Re:Why objective C? by bnenning · · Score: 5, Insightful
    Bottom line is that there is no rational reason to use Objective-C. Clearly this is a case of Not Invented Here on Apple's part.


    You have no idea what you are talking about. Cocoa could not be done in C++. (Yes, Turing equivalence, I'm talking in practical terms here.) Cocoa depends on a dynamic runtime for much of its power, which C++ does not have. Simple example: given the name of a class in a string at runtime, instantiate an object of that class. One line in ObjC, not possible in C++. Another example: given an arbitrary object and the name of a method, determine whether the object has a method of that name, and if so call it. Trivial in ObjC, not in C++. These dynamic capabilities are used throughout Cocoa, and that is why a dynamic language such as ObjC or Java is required to use it.

    --
    How to solve most of our problems: 1.Lots of nuclear plants. 2.Cure aging.
  47. Another free online tutorial (ObjC AND ObjC++) by critic666 · · Score: 2, Informative

    There's a free ~40 page tutorial + sample code available at http://www.areax.net that covers both an introduction to Objective-C for C++ programmers as well as Objective-C++, the new (well, recently revived) language that lets you use C++ libraries in Cocoa. Check it out! link

  48. Apple did not make MacLisp by Frothy+Walrus · · Score: 1

    the "MAC" in MacLisp stands for "Multiple Access Computers", the department at the MIT AI Lab in which MacLisp was developed.

    MacLisp was developed in 1966, over ten years before Apple Computer got it together.

    1. Re:Apple did not make MacLisp by RevAaron · · Score: 2

      I'm not talking about that MacLisp. Apple developed a Lisp IDE that eventually became Macintosh Common Lisp (MCL), a kickass CL environment.

      http://www.digitool.com

      --

      Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
  49. Re:Why objective C? by Anonymous Coward · · Score: 0
    The kludges neccessary to support a GUI system on C++ are infamous...GTK-- uses templates.

    Why is that a kludge? The STL uses templates too, but I'd hardly call it kludgy.

  50. Re:The Joy of Objective-C? by RevAaron · · Score: 5, Insightful

    Apple's GCC support ObjC++, meaning you can mix Objective-C and C++ code in the same application. However, you cannot call/instantiate Objective-C classes, objects, and methods from C++, just have both languages in the same sources.

    I for one am glad Apple stuck with ObjC. It's good to see that at least one company has the balls to choose what is good rather than what is popular. I was scared for a little while- Apple made WO5 Java only, and I'm glad they didn't pull that on Mac OS X as well.

    As far as other languages, you can program OS X in a bunch of them. Quite a few languages have Carbon bindings, and there's no reason you couldn't write a binding for you favorite language- Carbon is just C. If you're already using another language, you don't really need a binding to Cocoa, rather than Carbon.

    Python, and F-Script both have Cocoa bridges.

    --

    Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
  51. Re:Why objective C? by blamanj · · Score: 3, Informative

    Bottom line is that there is no rational reason to use Objective-C. Clearly this is a case of Not Invented Here on Apple's part.

    I'm not a particular fan of either language (C++ or Objective-C), but the NIH accusation is simply false.

    Objective-C was invented by Brad Cox in the mid- or early- 80s, and was intended to bring Smalltalk-style capabilities to C. It was later adopted by Next. Since they now have tons of legacy code in Objective-C, they have a strong rationale to continue supporting it.

  52. Other sources by ttimes · · Score: 1

    I'm thankful for a clear review of a book that has proved very useful. Its always hard to attract a broad audience without alienating someone yet "Programming Cocoa" has achieved a nice balance. And the reviewer is right: The frameworks are extensive (the usual learning curve) but you will be surprised at how much is taken care of for you - if you don't choose to override it. Other nice sources for programming Cocoa are Jesse Feiler's new book "Developing for OS X" and a fine series of articles geared toward newbies (but not without solid insights) at O'Reilly Mac Devcenter written by Mike Beam.

  53. Re:Why objective C? by Anonymous Coward · · Score: 0

    same reason they selected pascal for the mac api, they were a bit ahead of the times and no strong contender emerged from the pack. at that time the world hadn't yet decided between pascal and c so they were forced to choose... whoops!

    when NeXT created open step no strong OO language existed so they had to choose one. Obj-C was chosen... whoops!

    in hind sight it's easy to say: "why don't they use the most popular language?" but at the time these decisions needed to be made a clear winner hadn't yet emerged.

    the mac api did have a c binding but you had to specify a pascal binding to all your functions and you had to be aware of some of the subtle bugs that might show up if you forgot a handful of golden rules.

    kinda feel sorry for them though. i would've liked to program a bit on the mac but with all the projects to choose from i'm happier finding work in something i already know and am comfortable with.

    although i guess one could make the point that at the time it was becoming more clear that c was probably going to become more popular and you could also say that during NeXT development c++ was gathering more momentum. maybe the people jobs traditionally hires to make these decisions feel "dirty" for using languages the general programming public has a perference for?! :-) i certainly know a number of professors who follow that mantra!

  54. GNUstep by Ed+Avis · · Score: 3, Interesting

    How much of this is applicable to GNUstep or NeXTStep? Any of it?

    --
    -- Ed Avis ed@membled.com
    1. Re:GNUstep by Anonymous Coward · · Score: 0

      What the heck are you talking about?

      GNUstep is a bunch of GNU weenies trying to reimplement what NeXT was years upon years ago. There's the relation, monkey see monkey do.

    2. Re:GNUstep by sellout · · Score: 4, Informative

      As far as I've been able to suss out (I haven't had a chance to play on OS X yet, but I have looked at a bunch of the developer docs), Cocoa is pretty much a relabeling of the NeXTStep API. I imagine that any code you write for Cocoa will compile fairly easily under GNUStep. In fact, the GNUStep guys are working to add a Java API (in addition to the extant Obj-C API) to match the one that Apple added for OS X.

      --
      "Whatever can go wrong, will." --Finagle's Law
    3. Re:GNUstep by am+2k · · Score: 1
      I imagine that any code you write for Cocoa will compile fairly easily under GNUStep.


      As long as you don't use sheets, drawers, CoreFoundation or anything else that doesn't exist anywhere else.

    4. Re:GNUstep by erikdalen · · Score: 1

      Well, GNUStep Base is a clone of the FoundationKit (CoreFoundation)...

      --
      Erik Dalén
    5. Re:GNUstep by am+2k · · Score: 1

      CoreFoundation is not Foundation. CoreFoundation is a C-based API for arrays, dictionaries, sockets etc. On Mac OS X, Foundation is an Objective C-wrapper around it.

    6. Re:GNUstep by Strider- · · Score: 2

      Cocoa owes everything to the NeXTStep API. Without much relabling either. Everything is still derived from NSObject. :)

      --
      ...si hoc legere nimium eruditionis habes...
  55. Re:Why objective C? by Anonymous Coward · · Score: 0


    the fact that objective-C's additions to C look completely unlike C is a *feature*,
    because the object oriented stuff is completely orthogonal to C.

    defining classes, creating objects, sending messages - C was not intended to allow you to
    do any of these things.
    The approach C++ took to making an OO language was to take C and try to extend its features into OO ones. the result, IMHO is often inconsistent and unnatural.

    the approach Obj-C took was to declare from the outset that OO programming was genuinely different from C programming, and so its syntax should be different.

    Obj-C is a very simple language. it actually adds very little to standard C.
    certainly a lot simpler (both to understand and compile) than C++!

  56. You see it coming, don't you? by still+cynical · · Score: 4, Troll

    First we had Java Beans, now Cocoa Puffs?

    --
    Ignorance is the root of all evil.
    1. Re:You see it coming, don't you? by sporty · · Score: 1, Offtopic

      You know... you are going to hell for that one.

      --

      -
      ping -f 255.255.255.255 # if only

    2. Re:You see it coming, don't you? by still+cynical · · Score: 1

      Yeah, well at least all my friends will be there. :-)

      --
      Ignorance is the root of all evil.
  57. here here! by Anonymous Coward · · Score: 1, Insightful

    I much as I dislike community-bashing, I have to agree with you on this one. The final exam for my programming languages class in in two hours and this course definitely opened my eyes to the irrelevance of syntax.

    I only knew C/C++ before taking the class. At first glance, languages like ML, lisp, and Prolog seemed ugly and stupid. Then I made a fully functioned binary search tree in 32 lines of ML code (including comments). Or how about a program that does symbolic derivation and integration in 50 lines of Prolog. The syntax didn't matter. I just adapted my programming style and got some rather impressive results.

    Syntax doesn't matter when it comes to the power of a language. Just because Japanese has a subject-object-verb sentence structure and complicated verb conjugations doesn't mean it can't express the same ideas English does. After some practice the grammar and conjugations come natural. Learning programming syntax happens the same way.

    Okay, I'm rambling and should be studying for my final.

    1. Re:here here! by Anonymous Coward · · Score: 0

      Where, where?!?

    2. Re:here here! by blafasel · · Score: 0

      thear, thear!

      --

      check your speling
  58. Re:Open Source Cocoa- Revision 1 by Anonymous Coward · · Score: 0

    so this is the first community developed patch for the opensource cocoa project :)

  59. Re:The Joy of Objective-C? by hoggy · · Score: 2, Informative

    Apple have just released the latest version of their developer toolset (probably not available for non-seed download yet) and the main new cool thing is full support for writing Cocoa apps in AppleScript (AppleScript Developer Studio).

    This is a very cool thing. For people who haven't heard of / used AppleScript before - it's a HyperTalk-type language (i.e., very verbose, almost natural language) that can be used to externally control and script many Mac OS applications. You can now basically throw together applications very quickly that have complex UI elements and interact with other applications and system components.

    A neat feature is the ability to mix-and-match ObjC and AppleScript in the same application, so you can rapid prototype in AppleScript and then code complex sections in ObjC.

    Hats off to Apple for throwing so much effort into a (IMHO) much overlooked technology. AppleScript is the key piece in a lot of custom workflow systems, and now a must-see for those who miss the old HyperCard days.

  60. Re:Mmm (In Korean) by bliss · · Score: 0, Flamebait

    "Shit, I just tried to post a witty reparte in Japanese and the FUCKING lameness filter prevented me; said I'm using too many caps. (Obviously Slashdot is fucking USELESS when it comes to UNICODE. Not that I'm surprised, knowing the quality of the so-called programming talent behind this site.)"

    or maybe you lie about your ability to actually speak Japanese let alone write it? Just a thought

    --
    The death of one man is a tragedy; the death of a million is a statistic --Joseph Stalin
  61. Re:Why objective C? by Anonymous Coward · · Score: 2, Informative

    I've had two decades of programming in the C and C++ world and have only played with Objective C for a couple of months, and it's already clear that Objective C has some very powerful advantages going for it.

    It has a dynamic structure that lets you do some things that cannot be done in most other OOP languages I've used. In Objective C you can reference a class or method by it's name, in a variable string if desired. You can create an object of variable class. You can have a piece of code which can examine an object of unknown class to see if it supports a particular method, and if so, call that method. You can compare a class name against an object to see if it's that class or a subclass. This is all powerful stuff.

    Add to that the tools Apple provides to build interfaces, which rely on those dynamic features, and you end up with one of the fastest mechanisms for building new applications I've ever worked with. This wouldn't work well with C++ or C by itself.

    Given that, I can live with the relative ugliness of the language. (And C++ has its own ugliness -- look at the template syntax... Yecch!) It's also a very easy language to learn if you know C.

  62. response by Anonymous Coward · · Score: 0

    Sie wissen dAS fuhurer DOS nicht wie fröhliche Leute. Und Sie saugt nur fucking.

  63. Re:the TRUTH about editors and modding by Anonymous Coward · · Score: 0
    You sure do post a lot for "having a life" as opposed to the "Karma Whores of Slashdot".

    Jeez! You're funny, but this is much too shallow for the average slashdotter to not recognize as an obvious troll. Keep trying though, you're new here as a troll, so I guess you've got some learning to do on how to effectively troll for Karma. Dumb-ass. Hahahaha!

  64. Re:The Joy of Objective-C? by antijava · · Score: 1

    Objective C has a dynamic runtime, C++ does not. This one difference makes ObjectiveC a much more powerful language.

  65. simple by Anonymous Coward · · Score: 0

    "(This is on topic because it's nearing the Xmas season...) Is it "hot cocoa" or "hot chocolate"? What's the difference?"

    Hot choclate is really more of a water based beverage then you add powder. Hot cocoa really (at least for me) is more like a milk based one.

    Hope that helps.

  66. resume building by bliss · · Score: 1

    "Objective-C is uglier than Brainf$ck. Is there any reason why they chose Objective-C over C++? "

    Reseume building?

    Did you know that there is a nice little guide that discusses object oriented programming in straight C? really cool.

    --
    The death of one man is a tragedy; the death of a million is a statistic --Joseph Stalin
  67. Re:Why objective C? by melatonin · · Score: 5, Informative
    Objective-C is a real Object Oriented Language. To quote Alan Kay, "I invented the term Object-Oriented, and I can tell you I did not have C++ in mind." Objective-C is the closest thing to Smalltalk in compiled form.

    C is a very nice, compact, clean language. People have historically abused it and produced ugly code, but for a well disciplined programmer, C's a dream. Except that it's not Object Oriented.

    C++ was designed by committee. Its most fundamental spec is that it is insanely strongly typed. Templates are a hack to bring dynamic programming to a strongly typed environment. Exceptions are a hack to provide messaging in an environment that doesn't allow object A to talk to object B without knowing what the type of B is.

    Objects that communicate with each other is the most fundamental thing in object oriented programming. You can't drop foreign objects into an OOP system when that system needs to know the exact type of those objects- prepare to start editing code. Great code re-use. C++ does NOT offer code re-use anymore than C does.

    You like Qt's slots mechanism? They're a hack to give C++ something that every other OO language (inc. java, but not easily) can do naturally, make two objects talk to each other without knowing their type!

    Objective-C is a dynamically typed object oriented programming language, which is a much better setup for OO programming. There's only one core syntatic addition to C, and that's to support OO programming. Not the billion-and-one keywords and obtuse syntaxes that C++ is full of (just how do you overload that operator again?). The syntax you describe is the best part. Compare this code,

    object->runProcess(processType, duration);

    [object runProcess:processType untilDate:time];

    Not the greatest example, but the point is that you focus on the messages that the objects are sending to each other (which are very descriptive in Obj-C), not the types of the objects (which in many cases in OO programming, is irrelevant, unlike procedural programming). Compiler warnings of 'unrecognized selector' (unrecognized method) are more valuable than unknown type.

    The sad thing is, I didn't think there was much wrong with C++ until I started using Objective-C several years ago. I just thought, that's the way OO programming is. Take a stab at smalltalk (www.squeak.org), and you'll see just how different things can be.

    --
    Moderators should have to take a reading comprehension test.
  68. Location of compilers by Anonymous Coward · · Score: 0

    Apple does not include the compilers in the default install. The retail box of Mac OS X includes them on a seperate install disk. If you order a new computer, you don't get the disk. I wish Apple would change that.

    However, I would not say that what they put you through is unbelievably bad. You go to ADC, get a free account, download. Sure the website could use a nice reorg so it's easier to find the tools, but it's not _that_ bad. It's much easier if you know that you have to sign up for ADC first.

    I've heard though side statements from some developers (not directly from Apple, and not directly to me, I've no inside info from Apple at all) that the reason that Apple does not include the dev tools by default is that Apple does not want to make GPL software part of the default install to avoid any possible license conflicts.

    Apple's being paranoid, but it is their property that they'd be risking if someone claimed that the GPL tools pulled in the rest of OS X and source needed be released. Apple does support Open Source projects (including GPL Software), so it's not like they are so paranoid they won't use it at all. I don't know what Apple does for Mac OS X Server.

    I'd like it if apple put a shell script in place of cc that gave instructions on how to get and download the tools. It still would be a pain that the tools aren't there, but at least anyone using the tools would know what happened, why, and how to fix it.

    1. Re:Location of compilers by mrseth · · Score: 1

      What was unbelievably bad actually was the fact that I had used my wife's account and it had been a while since she used it so they made us fill out many pages of personal info to update her account. There were at least 3 or 4 of these things. I did manage to download it this morning, so I am now happy. Thanks to all who replied.

  69. Re:Easy? Powerful? by Anonymous Coward · · Score: 0

    To bad people can't shut upo about the one-mouse button thing... go get yourself a damn MS mouse with 50 buttons and a scroll wheel.. plus if you knew how to use a damn mac you wouldn't need any buttons or a mouse for that matter....

    -Thanks Mr. Jobs for all the whiny 2+ mouse button people

  70. Re:Easy? Powerful? by Philippe · · Score: 1

    You don't need to move it, just to hide it (call HideCursor). Moving the cursor, e.g. to bring it on top of the OK button in a dialog, is confusing to the user. He/she should have complete control over it. This is not Steve Jobs gospel, but years of UI research at Apple. Ask Bruce Tognazzini.

  71. This is still true, sort of by epepke · · Score: 3, Informative

    the mac api did have a c binding but you had to specify a pascal binding to all your functions

    To the extent that this is sort of true, it is still true. Pascal has a different stack convention from the one in C. The convention that Pascal uses was shared by most other languages at the time, but C originated as a system language. C is organized such that functions like printf could take a variable number of parameters using a kludge involving pointing directly to the stack.

    However, C and C++ compilers for the Mac all accept the "pascal" keyword, which is included in all the header files for the API. Besides that, you can ignore it, except in the special case where you need to pass a pointer to the API for a callback function. Then you need to declare your function as pascal, too. You have never had to declare all your functions pascal.

    Also, the majority of the API calls are not bindings in the strict sense of the word. They use compiler extensions to produce inline traps in the code.

    1. Re:This is still true, sort of by Anonymous Coward · · Score: 0

      Pascal (and many other languages) push a procedure function's arguments onto the stack in the order they are listed. eg: x := MyPascalFunction(5, z); is compiled to: push #5 push z call MyPascalFunction mov eax,x C uses reverse order: x = cfunc(5, z); is compiled to push z push #5 call _cfunc mov eax,x add esp,8 ; caller cleans up the stack Since the C arguments are pushed in reverse order, variable-count arguments can exist, since the non-variable arguments are in a fixed position in the stack offset: fprintf(FILE *, const char *, ...) | variable arguments |------- |char * (stack-8) |------- |FILE * (stack-4) |------- |return address (stack-0)

  72. Re:Why objective C? by bnenning · · Score: 2

    Moderate the parent up, it's exactly correct.

    --
    How to solve most of our problems: 1.Lots of nuclear plants. 2.Cure aging.
  73. RTFM! by Anonymous Coward · · Score: 0

    Does everything in the Unix world have to have "g" in front of it for you to know what its called?

  74. Other Cocoa / OS X Programming Books by jamesoutlaw · · Score: 2, Informative

    Here are some more books on MacOS X / Cocoa / Carbon Programming:

    Java: "MacOS X Java" Wiliams, Albert, Hart, Hopkins and Steinberg, Wrox press. (Just got this one, reading it now)

    WebObjects 5 for Java: A Developer's Guide (With CD-ROM)
    by Jesse Feiler (Paperback)

    Java & ObjC: "Mac OS X Programming" by Dan Parks Sydow (got this one on order)

    Mac OS X Developer's Guide by Jesse Feiler (Paperback) (this is an OK text, some good examples with ObjC & Java, but lacks a lot of detail on many Cocoa topics)

    Mac OS X Carbon Developers Black Book (With CD-ROM) by Dan Parks Sydow (Paperback) (don't have this one)

    REALbasic: "REALbasic: The Definitive Guide" by Matt Neuburg (good book, but only covers development with REALbasic .. and you can develop "X-only" applications with this)

    1. Re:Other Cocoa / OS X Programming Books by Spencerian · · Score: 1

      I just helped to write a Mac OS 9/X beginners programming book as well (yes, it really is a shameless plug) using REALbasic as the basis that people who are considering jumping into Mac programming can look into. It only touches on what Cocoa programming is and isn't really a good book for that--the book reviewed here is probably a good start for Cocoa.

      Beginning Mac Programming
      http://www.premierpressbooks.com/searchdetail.as p? ID=184100

      or see Amazon.com

      /.

      --
      Vos teneo officium eram periculosus ut vos recipero is.
  75. Re:The Joy of Objective-C? by dbrutus · · Score: 2

    They're adding Applescript to the development tools right about now.

    It's supposed to be a free download from ADC this week.

    DB

  76. NeXT Step was 500% better than this new Crap by Anonymous Coward · · Score: 0

    Steve Job's NeXT Step was 500% better than this new Crap from Apple.

    They butcherred it all.

    The NeXT was great. It was nearly perfect, though one time I had trouble using their standard tools compiling a program that had one file name with ASCII spaces in the file name.

    That was so many years ago I am sure that one defect was fixed.

    But Apple killed off "Yellow Box" NeXT Step after shelling out nearly 400 million dollars to buy it.

    They broke it dead. It worked on most pc midi sound cards, most pc network cards, most good scsi cards, most common video cards, etc etc.

    It even had a huge shared 20 megabyte file that allowed your NeXT Step programs to run on Windows NT and Windows 95.

    It was glorious.

    Then they (apples morons) ripped out the OS, added incompatibility and byte endian order nightmares at the CD-ROM and hard disk volume level (pre 1997 NeXT Step OS stored all file data in only one endian order not two)

    Then they broke the ability to compile for chips easily emulated on intel such as the MC68030 code the tools used to support perfectly.

    Then they decided to kill and break everything, butchered display postscript to avoid adobe lawsuits, renegged on every promise to developers, never released a working carbon 1.0 according to official spec promised to Board of Directors at Apple and Shareholders.

    (Carbon 1.0 was promised to run on System 8.0 and offer SCSI commands and many other services apple nevber got finished without crashing or at all).

    Carbon 1.0 (whatever number you want to use) never shipped.

    Read the official original spec Apple promised if you do not believe me.

    No wonder Mac developers I know now program Windows Win32 stuff nowadays.

    Apple killed the OS by making it slower and slower every year. And then the death sentence... Mac OS X is buggy and so glacially slow of a UI that apples "equal opportunity" "quata" based hiring must have really paid off.

    Cocoa takes a damed ETERNITY to launch a hello world and blit a pixel or two to the screen.

    Cocoa is pure bloatware crap.

    The NeXT originally was so fast it was astounding. Truly stupefying.

    Now its all buggy slow polled crap.

    No interrupts, polled everything from the Carbon side of things.

    They cant even play sound without skipping.

    Heck, the first version of Mac OSX could not play sound from a pure RAM buffer without hiccups!!!

    Its the most useless crap of an OS ever.

    The best OS Apple ever shipped was System 7.5.5. It ran on everything and had no serious bugs or defects.

    The best OS Apple ver bought was OpenStep. Too bad they never shipped it.

    They should have purchased "Executor" for 20 million dollars and bundled it with OpenStep and shipped 5 years ago.

    Apples is dead. Only making sure they support System 8.1 or 8.6 on all shipping new hardware will keep them afloat.

    Otherwise people will just run Mac On Linux style emlators and VMWAre style hacks and Apple will be a footnote.

    Even their hardware is cruddier each year. The Blue and White G3 Tower's ports write Firewire (IEEE 1394) data at only 50% transfer speed vs the read speed! Its limited by firmware.

    The computer boots slower than a Quadra 840AV. (A old computer with awsome video blending and a much larger speaker).

    The Blue and Hhite CMD ATA-IDE controller chip is buggier than all hell (random lockups and xfer bugs) if you try to attach a second hard disk on the same ribbon as the DVD drive.

    The thing cant even boot from a RAM disk like all the older macs could.

    The G4s are very fast, admittedly, and in Bytemark 2.X source code beat the pants of any intel processor up to twice the megahertz, always, and in parrallel vectorized code benchmearks the ingenious C-based language compilers make altivec code run circles around most photoshop plugins that Intel paid adobe to optimize.

    But what good is a fast OS if all the offended MAc developers switch to MS Windows one by one, week after week from shame.

    1. Re:NeXT Step was 500% better than this new Crap by TellarHK · · Score: 4, Insightful

      You know, if you spent a little less time trying to troll and a little more time fashioning a rational post together, you might have been able to go someplace with this. But I'll take a few of your more coherent complaints and answer them, just because.

      First up, let me cover a few of your 'quickie' style complaints. You talk about how Apple screwed up 'Carbon 1.0', then never shipped it. Isn't this a good thing? Would you rather they release something worse than Windows 95?

      Second, you talk an awful lot about speed issues with OSX and Cocoa. I suppose you haven't used 10.1. OSX 10.1 is amazing. Coupled with Office v.X (I'm a student, need Office compatibility or I don't pass my classes) OSX 10.1 is just stunning in speed, stability, and functionality. Granted, OSX may seem a bit bloated on the surface, but I decided after ten years of using Wintel that I'd trade bloat for stability, a choice Microsoft never offered.

      Was NeXTStep awesome? Sure, seemed like it was to me anyhow. But back then, you didn't have the newer requirements of being out-of-the-box simple, and supporting so many hundreds of standards to make everything run as transparently as possible. Back in the days of NeXT, you had a NeXT if you were a developer, not an end user. Keep in mind, as a lot of people fail to do, that Apple is a company geared toward the consumer market, not simply the developer market.

      Are there flaws? Yes. Are most of the flaws you pointed out accurate representations of the issues facing the Apple userbase? Hell no.

      In November, I bought my first current Mac after only having an ancient '030 simply to say I had one. When I was younger, I felt that Apple had great hardware, but a lousy OS. Now, after X.1, I'm convinced that Apple has a far superior consumer grade OS than anyone else with market share. And simply by it's nature, it's also the best OS out there for developers. After all, you didn't have to shell out $2500 for a copy of the development tools, did you?

    2. Re:NeXT Step was 500% better than this new Crap by coult · · Score: 2, Informative

      Here's a little tidbit of info that demonstrates how completely filled with misinformation your post is:

      You complain bitterly how "their hardware is cruddier [sic] each year," giving the Blue and White G3 as an example. (I won't even comment on your assertions about the B+W G3's quality).

      The blue and white G3 was discontinued more than two years ago!

      I could go on (and on and on...), but I won't.

      --

      All is Number -Pythagoras.

    3. Re:NeXT Step was 500% better than this new Crap by Anonymous Coward · · Score: 0

      its crappier each year.

      After the B+W G3, they dropped SCSI in favor of buggy data corrupting firewire.

      They dropped the B+W G3 adb port in favor of POLLED usb ports. no adb, no way to recover from crashes in debugger correctly to program on a mac the way programmers need to at times.

      They dropped 16 bit audio in on most models, no way to accurately record vinyl to mp3, or use hifi audio human voice for dictation.

      They dropped serial ports, my B+W G3 has an after markey chip from griffin that support MIDI and LocalTalk networking.

      They dropped serial because they could not handle the interrupts in their OS.

      Apples buggy polled OS new boxes are incapable of using a stable version of the mac OS and are trojan horses to make you run thier lame newer OSs like their buggy 9.2 and their crappy 10.1.1

      Did you know that MAc OS 10.1 cannot play DVDs on a BLue and White G3 tower!!!! A machine from only 2 years ago! YOu need 10.1.1 and you need a 40 megabyte downloadable new tool from a couple weeks ago.

      Apple supports no hardware anymore, and barely supports their newest hardware.

      Thankfully Sonnet technologies can add firewire to iMacs (Harmoni 500 Mhz combo upgrade) and powerbook 500 Mhz upgrades etc.

      I will never buy new apple hardware unless it can properly use 4 processors and not cost 200% more than a 4 way AMD or 4 way Intel.

      dual cpu systems are too crappy and not worth it, especially with apples design.

      I truly think all systems after the G3 Blue and white, and WAllstreet G3 are crappier.

      A Wallstreet has SCSI, InfraRed, two cardbis slots, THREE places to install THREE 40 gigabyte drives (it has two media bays not merely one, and the wallstreet is the last mac than can play a full 125 minute DVD movie at full brightness all the way through without stopping the movie to swap batteries.

      Plus the Wallstreet is the last mac to play dvds without losing sound sync with lips. No apple software codec can do that in 2001.

      What misinformation is in my post?

      You claim misinformation!

      You claim to be able to go on and on....

      go ahead.

      tell me why a Cube mac is better than the older macs.

      It cannot play all audio CDs, especially newer copy protected audio cds from Universal records.

      The BLue and White G3 uses DA converter and can play copy protected audio cds.

      There are lots of reasons why newer macs are crappier than older macs.

    4. Re:NeXT Step was 500% better than this new Crap by Anonymous Coward · · Score: 0

      Are you a complete idiot? Do you think that made up statistics (500% better!?!) make you sound like you know what you are talking about? You are simply talking out of your ass:

      "They dropped serial because they could not handle the interrupts in their OS."

      "Apples buggy polled OS new boxes are incapable of using a stable version of the mac OS and are trojan horses to make you run thier lame newer OSs like their buggy 9.2 and their crappy 10.1.1"

      "Apple supports no hardware anymore, and barely supports their newest hardware."

      "dual cpu systems are too crappy and not worth it, especially with apple's design."

      ****
      "What misinformation is in my post?"
      ****

      Hahahha... you are an utter Troll!!

      Wake up! Mac OS X is the best UNIX system-like OS to have been written so far because it represents the happy marriage of UNIX stability/performance/utility and Macintosh human engineering/graphics/userland suitability.

      Hardware choices such as the iMac gestalt, IEEE 1394, Gigabit ethernet are revolutionary and progress! You want compatibility with archiac processors simply to emulate them on x86 boxes (nevermind that Apple supported 68k superbly!)? You think OS X is mainly a polled device system? You are either a troll or a stick in the mud. Goodbye!

    5. Re:NeXT Step was 500% better than this new Crap by Anonymous Coward · · Score: 0

      Yeah ...where is NeXT STEP now? DEAD

      LONG LIVE STEVE JOBS

  77. What about Apple's other Cocoa? by Blue+Neon+Head · · Score: 3, Interesting

    This is slightly offtopic, but Apple had another project called Cocoa which was supposed to be a visual programming language for kids to use. Anyone know about what happened to it?

    1. Re:What about Apple's other Cocoa? by krmt · · Score: 3, Insightful

      I'm not entirely sure, but I was pretty involved in it up to a point. I think they stopped developing it, but I think it was done out of house, so those guys kept working on it. That's the last I heard of it, and I'm betting it's dead and buried now.

      It's pretty unfortunate too, it was a great way to write simple little apps. I wrote a whole Mendelian genetics breeding simulation (which I still have somewhere), and I have a couple of books that have pictures and descriptions from tons of little programs people wrote. It wasn't meant for serious work, but could make some nifty little demos very easily. Great way to get kids programming. I've thought repeatedly about doing a free version for linux, but it's a lot more work than I have time for. Still, it'd be a very worthy project.

      --

      "I may not have morals, but I have standards."

    2. Re:What about Apple's other Cocoa? by jafac · · Score: 2

      I think it was called HotSauce or HotCocoa or something like that.

      --

      These are my friends, See how they glisten. See this one shine, how he smiles in the light.
    3. Re:What about Apple's other Cocoa? by krmt · · Score: 2

      Different project. HotSauce was their 3d web browser thingie.

      --

      "I may not have morals, but I have standards."

  78. I think you're a liar. by Anonymous Coward · · Score: 0

    Nice try, maybe next Apple article you can troll too!

  79. Re:Why objective C? by stripes · · Score: 2
    One of the big problems with writing GUIs in C++ is that the type system gets in the way. The kludges neccessary to support a GUI system on C++ are infamous. Most systems resort to macros. GTK-- uses templates

    Templates are not a kludge, so GTK-- being "forced" to use them isn't a big deal (in fact GTK-- is a very nice API -- it's big kludge is that it is really just a wrapper so if you write new GTK-- widgets, people using GTK in Python will have a hard time using them!).

    Now I will admit that C++ is a pretty nasty language, and my minimal exposure with ObjC makes me thing that ObjC is nicer, except it lacks templates, and thus anything like the wonderful STL. Of corse it also lacks six different kinds of multiple inheritance (or seems to at any rate), which is a good thing.

  80. Re:Why objective C? by Matthias+Wiesmann · · Score: 2

    Another example where Objective C outshines the hell out of C++ or even Java is for dynamic programming. A simple example is the proxy class. Have a class implement a particular interface at runtime and route all call to another class. Distributed environnement like CORBA need this a lot, but it is also usefull for debugging stuff.
    In objective C, this is a breeze, in Java its tricky, and AFAIK impossible to do in C++. A simple example of the flexibility of objective-C, the implements is not a reserved keyword like in Java but an object method that can be overloaded.

  81. It's easy as pie. Stop lieing. by Anonymous Coward · · Score: 0

    See you at the next Apple article, troll.

  82. Re:Easy? Powerful? by Anonymous Coward · · Score: 0

    "...but you can't do anything advanced with it..."

    What do you consider not advanced? The ability to load classes dynamically at run-time with only one obj-c method calls? Or maybe having non-fragile interfaces in your base classes? Or maybe having the ability to determine if objects implement methods by introspecting by name? Or maybe serializing interface objects into nib files? None of this is very advanced for a framework that started life almost 15 years ago, huh?

    And about controlling the mouse, why?

  83. O'Reilly vs AW by Anonymous Coward · · Score: 0

    AW has historically published all of Apple's toolbox books, etc.

    However, they decided to use OReilly for OSX and beyond (Apple wrote and edited the book, OR just prints & binds it). It's really just the newest Mac Toolbox book, which is why it reads like one.

    Which makes it interesting for a 3rd party OSX programming book to be published by AW!

  84. Re:Easy? Powerful? by Anonymous Coward · · Score: 0

    Hmmm and we can start removing buttons from everything because it is easier.

    JEEZ you are dumb. Imagine trying to use a microwave if you only had a +1 second and -1 second button.

    Not only did two mouse buttons become usefull, but the third scroll/button has become invaluable. You can do more with less hand movement that way.

    The only real reason why there is only one buton on a MAC is because the original ones couldn't handle a two button mouse. Why couldn't they handle a two button mouse? Because when the mac was developed it was rushed..... That is the reason it had only 3 colours, black-white-grey.

    Real computers like the Amiga and the Atari ST took longer to produce, and had much more flexibility and power. But as Microsoft and Apple has shown us, good products can die and crappy ones can live!

    The only thing worse then windows 3.1 is a MAC. They were the crappiest peices of crap that I ever had a chance to use. And I have used alot of crap in my life.

  85. Re:Why objective C? by stripes · · Score: 3, Informative
    There's only one core syntatic addition to C

    Er, sort of. There is one new "call syntax", which includes new syntax for unordered arguments as well as calling through an object. There is one new preprocessor macro to replace (or at least augment) #include. There is a whole new declaration syntax for objects as well. That is more like three things. And it may be as many as eight.

    Now that doesn't compare to C++ which is described in less detail by a book 5 times as thick as K&R C, but it is a little more then one change.

    (and having used both, I miss some of the C++ stuff, but not as much as I'll never mind is gone)

  86. Re:Open Source Cocoa- Revision 1 by Anonymous Coward · · Score: 0

    Also, add a beaten egg to thicken it up a bit (actual Mexican recipe)

  87. Re:Easy? Powerful? by the_2nd_coming · · Score: 1

    perhaps was a mac pre 2001/2002

    today, the mac is very nice...looks good, operates realy good, and the OS is powerful and stays out of your way.

    --



    I am the Alpha and the Omega-3
  88. Re:Easy? Powerful? by Anonymous Coward · · Score: 1, Informative

    Let' see. Send a system wide notification to ANY application thats listening, including a dictionary (HashTable of information) NO RMI stub bullshit.. That would be ONE line of code

    Publish an Object so it can receive distributed method calls from other applications ala CORBA.. (again NO stub bs, no real need to even know object type or the methods it can respond to as those can be discovered at run time. ) Ah. That would be two lines of code.

    Connect to and message that object from any other app. 1 line of code (two for error checking).
    Include basic printing, editing of a scrolling text object WITH control over fonts, color and automatic connection to other SYSTEM services like spell checking... NO lines of code.. it's built into the IDE.

    Yep.. Very cheesy, weak ass OS.. Hardly any power. Can't do squat..

    I've been using ObjC as delivered by NeXT and now Apple for about 12 years. So I WON'T take your word for it, because you don't know what the hell your talking about.

    Worse than MFC.. I don't think so.. Try this with MFC, ADD a method to the Window class. No I didn't say subclass window.. add a method to the actual window class.. You can't do it. Why? Because you don't have source and C++ doesn't have catagory methods. ObjC does.

    All stop here, cause I have about 50 more examples.

  89. Re:Why objective C? by Jeremy+Erwin · · Score: 2

    I think templates are actually the right solution-- but of course, GTK-- is forced to wrap around C. At various stages of it's development, it seemed as if the GTK-- writers were a little too weeded to the STL. Sorting and searching menubars is of limited practical value...

    Because Objective C is not strongly typed, template objects aren't needed. On the other hand, the algorithms that the STL provides are also missing.

    I really find myself missing the ability to overload operators, though. Overloading Objects is really useful for scientific computing. Writing a RK4 solver for systems of differential equations without operator overloading is more than a little messy.

  90. Re:Mmm (In Korean) by Anonymous Coward · · Score: 0

    Translation ala babelfish:

    "It receives first point under the light it will be extensive in your speed and agility there is the first which it does to me, permit. In order to attain the top of the rainwater inside our arrangement ability us by your specialty and will decrease a gratitude motive. Truly, candle call leys by the item which puts out a taste it expresses a pleasure, is a value. Again, the barn as soon as in your first point of the rainwater. Our fields which it spreads out all it is a beaconing of ability"

  91. Re:Easy? Powerful? by Dyolf+Knip · · Score: 2

    Glad it only took them 15 years to figure out that strange 'more than one mouse button' paradigm.

    --
    Dyolf Knip
  92. Re:Easy? Powerful? by Quasar1999 · · Score: 2

    And why exactly would you want so set the mouse position?

    A sin you say? And that's why Apple didn't include it? Ha! You try porting a popular game from Windows to your precious Mac platform without the ability to set the mouse position... Don't flame me, just try it... you'll be pleasently surprised.

    --

    ---
    Programming is like sex... Make one mistake and support it the rest of your life.
  93. Re:Easy? Powerful? by sjf · · Score: 1

    Yes, easy & poweful for the right projects.
    Don't confuse "OSX" development with Cocoa development.

    I'm working on porting a huge application from OS9 to OSX (macho). We're staying in C++ and it's pretty tough.

    Our diags guy, however is writing tools from scratch in ObjC/Cocoa. - it's a breeze.

    What are you talking about "direclty accessing memory registers" ? You can't do this on any system with real protected memory. Sounds like you don't know what your talking about, oh except that Apple == crap...

    -Simon

  94. Re:Why objective C? by Anonymous Coward · · Score: 0

    Bottom line is that there is no rational reason to use Objective-C.

    Next selected Objective C for a reason, dynamic binding. Also, when Next started writing the Nextstep API's 15 years ago, C++ was still very new, not ANSI, not well defined, kludgy, and it had as much mindshare as Objc-C. In those 15 years, things have changed.

  95. Re:Why objective C? by Anonymous Coward · · Score: 0
    Simple example: given the name of a class in a string at runtime, instantiate an object of that class. One line in ObjC, not possible in C++.

    Wanna bet? Get the book Design Patterns and learn about object factories.

  96. Larry Tessler turned it into Stagecast Creator by kriegsman · · Score: 2, Informative
    Larry Tessler took it with him when he left Apple several years ago. There are some resources for "the other cocoa" still out there.

    'The other Cocoa' eventually found a new home and became known as Stagecast Creator.

    -Mark

  97. Re:Easy? Powerful? by HalifaxPenguin · · Score: 1
    Ok... assuming you actually have a good reason to move the mouse cursor like that, and that it can't be done in a standard API...
    1. Hide the system mouse cursor
    2. Instead of "moving" the mouse cursor, keep x and y offsets from the actual mouse position to a new "translated" mouse position.
    3. Use these translation offsets when reading mouse coordinates, and for drawing a mouse cursor on screen (wrap that in functions or macros and never have to think about it again)
    Most games draw their own mouse cursors anyway, so the hard part is already done.
    That was so easy... I'm pleasantly surprised, just like you said.
  98. Re:Easy? Powerful? by HalifaxPenguin · · Score: 1

    ...I take it all back. That won't work. :)

    If the mouse is 10 pixels from the left edge and you translate to the center of the screen, you'll never be able to move the mouse farther left than 10 pixels from center.

  99. Re:The Joy of Objective-C? by RevAaron · · Score: 2

    Did they release that finally? From what I've read, it's pretty cool. I've been dying to have a look at it. AppleScript is way too verbose, trying too hard to be like English for my tastes. But if it will let me hack together quick GUIs and script Cocoa objects, it'll be more than what I could want!

    Another great thing about AS is that it supports SOAP pretty slicklike. With the intrinsic SOAP support, I could throw together a GUI and some other AS functions, and call the more intensive logic of the app written in another language that supports SOAP.

    --

    Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
  100. Listen you idiot... by bytes256 · · Score: 0
    First of all...this has nothing to do with the GPL...give me one single example in the GPL that says Red Hat can't do what they're doing...

    On the other hand, this has everything to do with trademark law. Red Hat is a registered trademark, and therefore if they don't want anyone else to use it, they don't have to.

    You can stil reproduce RedHat ISOs verbatim...just don't call it Red Hat...call it something similar...if people are too stupid to figure it out, they are WAY too stupid to use linux in the first place.

    --

    Slashdot, the site where everything's made up and the points don't matter
    1. Re:Listen you idiot... by Anonymous Coward · · Score: 0
      Fuck off. You don't see Apache and Perl named something else because someone is redistributing them in their distro. No, they are called Apache and Perl, because that is what they are.


      If the GPL says I have the right to redistribute Red Hat then I have the right to fucking distribute Red Hat. Get it? Now go back to your pathetic little life, and if you can't take an insult, you shouldn't be throwing them.

    2. Re:Listen you idiot... by bytes256 · · Score: 0
      No one's saying you can't fucking distribute Red Hat just call it something else. It's not like they're preventing you from distributing ISOs then I'd understand all of this bitching.

      Learn to read you stupid jack ass!

      --

      Slashdot, the site where everything's made up and the points don't matter
  101. Re:Easy? Powerful? by smack.addict · · Score: 2

    Who the hell uses the cheap mouses that come with any computer you buy? I use my two-button optical mouse just fine under OS X. And I have had to buy one for all of my Intel boxes as well.

  102. Re:Easy? Powerful? by cruentus · · Score: 1

    That will work fine. Its possible to obtain using, I think cocoa, or at least carbon events, what the mouse delta would be assuming the cursor was not on the edge of the screen.

  103. Re:Why objective C? by Jeremi · · Score: 2

    (offtopic) I always thought Be did a nice job using BMessage and BMessenger type objects for their GUI API. No language extensions or ugly macros necessary, since a BMessage is really the only data type you'll ever need :^)

    --


    I don't care if it's 90,000 hectares. That lake was not my doing.
  104. Re:Why objective C? by ebw · · Score: 1

    Actually, Java does support Dynamic Proxies. Check out this class, this Javaworld Article, and this overview at sun.

    ebw

  105. Re:Easy? Powerful? by Anonymous Coward · · Score: 0

    '==' is an evaluation, not an assignment.

  106. Re:Why objective C? by Anonymous Coward · · Score: 0

    "C++ is the kludge to end all kludges"
    All higher level languages are kludges. Anything above toggling 1's and 0's, including assembly, is a kludge, otherwise why would you have to translate (read assemble, or compile) it, link it, or load it?

    There are many kludges in the world that lengthen and alleviate one's otherwise short and brutal life.

  107. Re:Why objective C? by coult · · Score: 1

    The problem with dynamic typing is that its not as fast as static typing. I'm writing a bunch of numerical code (for scientific research and consulting), and I use C (or C++ sometimes) but never Objective-C...when you need high performance, you want everything static if possible.

    Of course, the happy middle ground is to write all the computational code in C/C++/Fortran and then make a nice GUI with Cocoa/Objective-C.

    --

    All is Number -Pythagoras.

  108. Re:Why objective C? by Anonymous Coward · · Score: 0

    With an introspective runtime, you can do it without hardcoding any references to the specific class names into the source. How do you do that in C++? Note:


    if(classname == "Foo")
    class = new Foo;
    else if(classname == "Bar")
    class = new Bar;
    ...


    doesn't count.

  109. More about Aaron Hillegass. by jcr · · Score: 2


    Have a look at his web site at

    http://www.bignerdranch.com/

    He's been in the business of training people on OpenStep and Cocoa for quite some time.

    -jcr

    --
    The only title of honor that a tyrant can grant is "Enemy of the State."
  110. Reflection on experience by Anonymous Coward · · Score: 0

    You know, watching these Objective-C vs. C++ is interesting. In general, the Objective-C supporters also have a lot of experience with C++ too (who doesn't?), but they prefer Objective-C. On the other hand, the people defending C++ are generally the ones who themselves have not done any substantial development in Objective-C. So perhaps it says something that the people who have used both languages extensively tend to prefer Objective-C?

  111. AppleScript Studio by Tokerat · · Score: 1
    AppleScript Studio may be the answer you're looking for, it is a GUI-based editor that allows you to write Cocoa-style apps and then write functions and such for your interface elements in AppleScript. Since AppleScript has been around since System 7, many many apps support it and this could easily be used to create a window with common controls for all your currently running programs. Create a nice, simple GUI for automating complex config or mainenince tasks on your G4 web server? Now we're talking!

    Much in the same style as Visual Basic, or RealBasic...

    or if you're a Mac oldskooler.........HYPERCARD!

    I always thought Apple should have taken HyperCard and just upped the technology, I mean it still ran in black & white until the day it died (96? 97? Too much ganja...), it was an amazing piece of software WELL ahead of it's time featuring things like user-authoring of programs and full scriptability, and even things we take for granted today such as hyperlinking! Everything from custom databases to slide shows, and even games, where created for it. I even saw a LaserDisc player-controlling stack once!

    APPLE! BRING BACK HYPERCARD!
    If you don't I really am going to go STAK-WILD ;-)

    --
    CAn'T CompreHend SARcaSm?
    1. Re:AppleScript Studio by krmt · · Score: 2

      Pretty cool. I've never seen Applescript studio. Unfortunatley, I kicked my Mac habit a few years back, so I won't get to try it out.

      It looks pretty different than Cocoa was though. Cocoa wasn't about creating apps really, there weren't what you'd call "widgets". Instead, the concept was to have a grid and according to the state of the grid you'd alter the objects on the grid. Now that I think about it, it's a hell of a lot like cellular automata, but as a programming method.

      So you have these different items that would appear on the board. You could make a rule saying "If the fly moves next to the frog, then the fly disappears and the frog's tongue appears." This would be done visually, by having a before and after panel, making definining state changes really easy. There would also be rules to respond to events, like "If you hit the right arrow key, move Jimmy to the right." It could play sounds too. The coolest thing about it was that there was a plugin that allowed you to view the apps in your browser. They were talking about moving the apps to java to make this easier, but it was too much work.

      Anyhow, the project was never designed to build apps that would be really useful. It was, however, a great way to get kids started on programming, and it really was fun to use. It was, by nature, the kind of app that encouraged playfulness, which I've never encountered in the same way in another environment. I've never actually worked with hypercard, but Cocoa was so insanely simple that you just had to play with it.

      --

      "I may not have morals, but I have standards."

    2. Re:AppleScript Studio by Phork · · Score: 1

      The latter versions of hyper card did support color. I think it was an ugly hack, but it was there. I still have a boxed copy of hypercard sitting around someplace that advertises that it supported color.

      --
      -- free as in swatantryam - not soujanyam.
  112. Re:The Joy of Objective-C? by am+2k · · Score: 1
    Today I've written my first AppleScript-application, a iTunes remote control. Here's the complete source:

    on clicked theObject

    tell application "iTunes"
    if name of theObject is "play" then play
    end if
    if name of theObject is "pause" then
    pause
    end if
    if name of theObject is "prev" then
    previous track
    end if
    if name of theObject is "next" then
    next track
    end if
    end tell end clicked

    I tried to do it in Objective C about a week ago, and I gave up just because it's too complicated.

  113. Origin of the one button mouse by Ukab+the+Great · · Score: 2

    Actually, the reason why the mac mouse had only one button is that the guy who first started the Macintosh project at Apple, Jef Raskin, thought more than one button would be confusing to people (he might have actually done some usability testing to confirm this. I'm not quite certain). This seems like an oversight today, but remember that in the first years of the 80's when the mac was being designed, you didn't really have mass produced computers making extensive use of *any* pointing device as part of their basic UI. The concept of using a mouse was confusing enough with one button (see Star Trek IV if you don't believe me). Raskin had actually wanted a trackball instead of a mouse because "they don't pick up those oreo cookie crumbs that are the hallmark of a good programmer".

  114. Re:The Joy of Objective-C? by Anonymous Coward · · Score: 0

    except that makes it much, much, slower than C++.

  115. Re:Easy? Powerful? by Ukab+the+Great · · Score: 2

    You think that's bad? After 30 years, the Un*x community still hasn't grasped the concept of giving system files names that are real english words, or for that matter using spaces between them. The mac (pre OSX) has had both of those since 1984.

  116. Re:The Joy of Objective-C? by am+2k · · Score: 2, Informative
    However, you cannot call/instantiate Objective-C classes, objects, and methods from C++, just have both languages in the same sources.

    That's wrong, you're talking about the regular ObjC. If you rename all your files to .mm, you will be able to mix both languages:

    class myclass { public: myclass() { NSArray *array=[NSArray array]; } };

  117. Re:Why objective C? by melatonin · · Score: 2, Informative
    The problem with dynamic typing is that its not as fast as static typing. I'm writing a bunch of numerical code (for scientific research and consulting), and I use C (or C++ sometimes) but never Objective-C...when you need high performance, you want everything static if possible.

    Yes, that is an issue with dynamic typing but that comes with the complexity of your app. Today's programs are far too complex to write in assembly, but assembly can be much faster. Static typing doesn't make things faster, that's just an implementation issue.

    In Objective-C's case, only the first time you send a message to another object takes some extra lookup time. From then on, it's cached. It's just like using a virtual table. Object Oriented programming was NEVER designed for speed. That's the tradeoff. If you try to make a balancing act of that of speed vs. OO, you're missing the point and wasting your time. If you need the speed, write the back-end in C (but not C++).

    As ESR has said in his Python introduction piece (I think it was in there, sorry if I'm misquoting), most programs nowadays don't even need compiled speed. 90% of the stuff joe user does is I/O bound, not CPU bound. Of course you can be a really sloppy programmer and waste the CPU, but that's not the language's fault :)

    --
    Moderators should have to take a reading comprehension test.
  118. Re:Easy? Powerful? by Valdrax · · Score: 2

    Hmmm and we can start removing buttons from everything because it is easier.

    Straw man.

    JEEZ you are dumb. Imagine trying to use a microwave if you only had a +1 second and -1 second button.

    Ad hominem, followed by an ad ridiculoso argument.

    The only real reason why there is only one buton on a MAC is because the original ones couldn't handle a two button mouse. Why couldn't they handle a two button mouse? Because when the mac was developed it was rushed..... That is the reason it had only 3 colours, black-white-grey.

    3 falsehoods in a row.

    The one-button mouse was a HCI decision meant to avoid confusing people. It's very well documented historically for those who actually read instead of making up nonsense. The development wasn't rushed, they just had limited resources to work with to make a more budget-friendly device than the Lisa. Finally, old Mac screens were monochromatic, like the vast majority of monitors in that day and time. They could only hand black or white. Though color monitors were available, but Mac team decided on a black-and-white screen to make it cheaper and to save on system resources. (Video took up 21K of the 128K in the original Mac.)

    Real computers like the Amiga and the Atari ST took longer to produce, and had much more flexibility and power. But as Microsoft and Apple has shown us, good products can die and crappy ones can live!

    These were later-generation computers that borrowed ideas from the Macintosh and had more resources to work with when the first versions of the OSes were created. The 128K limitation in the first Mac made the engineers make some tough compromises that would become legacy code that later computer designers didn't have to make. It's called progress.

    The only thing worse then windows 3.1 is a MAC.

    Obviously, you weren't using them both in the days of Win 3.1. The differences in functionality, stability, and power were night and day. The only reason Window won was that the price difference was also night and day.

    They were the crappiest peices of crap that I ever had a chance to use. And I have used alot of crap in my life.

    You sure seem to spew a lot of it too. (See, I can make ad hominem attacks too!)

    --
    If it's for-profit but free, you're not the customer -- you're the product (e.g., the Slashdot Beta's "audience").
  119. Re:Mmm (In Korean) by Anonymous Coward · · Score: 0

    > or maybe you lie about your ability to actually speak Japanese let alone write it? Just a thought

    Chigau yo. Ore ga itta toori, kana de mese-ji wo utteitara, yappari re-munesu firuta- ni jama sarete, ore no po-sutingu ga abo-to sarete shimau yo. "DON'T USE ALL CAPS" to iu era- mese-ji ga dete shimau.

    There, satisfied fuckface? I'd type that in kana, but Slashdot gives me the error message when I try. God, I hate little pissante know it all fuckfaces who are so easy to prove wrong.

  120. Re:Mmm (In Korean) by Anonymous Coward · · Score: 0

    Before some other fuckface points out the obvious, "mese-ji" should have been spelled, "messe-ji". I usually don't work with romaji, it's too grade 6.

  121. Re:Easy? Powerful? by Dyolf+Knip · · Score: 2

    There's a perfectly good reason why Unix keeps the system filenames obfuscated. It's to make us all look much more impressive to non-*Nix experts :)

    --
    Dyolf Knip
  122. Re:Easy? Powerful? by Quasar1999 · · Score: 1

    Yes assuming the cursor wasnt on the edge of the screen... So it works 98% of the time, except for the odd time when the cursor was at the edge of the screen. Then users would bitch that your game/program is buggy. When in reality its a limitation of the API that can be used on the Mac.

    --

    ---
    Programming is like sex... Make one mistake and support it the rest of your life.
  123. Re:Why objective C? by coult · · Score: 1

    As ESR has said in his Python... most programs nowadays don't even need compiled speed. 90% of the stuff joe user does is I/O bound, not CPU bound.

    Scientific code is a special case, I suppose...I'm talking about code that takes days or weeks to run on a small cluster. The speed of C++ code depends more heavily on the compiler than the speed of C code does, but in my experience you can write good fast scientific code in C++, with a substantial savings in development and debugging time.

    --

    All is Number -Pythagoras.

  124. Easy? Well, not as hard as you think... by Valdrax · · Score: 2

    Here are two ways that I'm aware of to do it without touching Low Memory:

    Mac OS X Only -- CoreGraphics routines.
    Mac OS 9 Only -- Cursor Components SDK.

    I believe, however, that the only was I know of to do this on both Mac OS 9 and Mac OS X (10.1+ only) is to mess with Low Memory like you're probably talking about. I can't be sure, though, since you're misusing terms. Try the above links and see if they help.

    --
    If it's for-profit but free, you're not the customer -- you're the product (e.g., the Slashdot Beta's "audience").
  125. Re:The Joy of Objective-C? by Anonymous Coward · · Score: 0

    Actually, not so!

    I offer as proof the same size set of references you did.

  126. Hmmm... Linux App vs OSX App Development by reallocate · · Score: 1

    You know, if we make the assumption that OSX developers actually want to be paid for their efforts, it will be interesting to see if OSX spawns more imaginative, innovative apps the Linux or the BSD's.

    --
    -- Slashdot: When Public Access TV Says "No"
  127. Re:(S core: 1, Troll) ???! by Anonymous Coward · · Score: 0

    and the sad part is that not enough people will know where that joke came from. Long live Mojo Nixon!!!

  128. Cocoa Resources by Anonymous Coward · · Score: 0

    Hi,
    iDevGames.com has an interview with the author, Aaron Hillegass of the Big Nerd Ranch here:
    Interview
    You can read about why the Apple/O'Reily book was "thrown" together.

    My site has Cocoa code and will be adding some Cocoa game code soon. I also recommend http://www.cocoadevcentral.com/ for more Cocoa info.

    Cheers,
    Carlos Camacho
    Editor
    iDevGames.com

  129. Books in the Pipeline? by ablair · · Score: 1

    Does anyone know of any other Cocoa dev books coming out in the near future (6-9 months)?

  130. Ho Hum. by fm6 · · Score: 2
    The NeXTStep API has been around for quite a while, and has never really had a following. It's been sold as a basic API on the original NeXT Computer. When that failed, they tried to sell just the OS. When that failed, they tried to sell it as an API that would run under Unix. When that failed, they finally managed to sell the whole ball of wax to Apple after Copeland self-destructed. (A close relationship between the chairmen of the two companies helped.) I find it terribly interesting that:
    • there's so much breathless enthusiasm for an API that has repeatedly failed to catch on;
    • people actually think that Cocoa is going to seduce a significant numbers of Carbon, Windows, or Linux/Unix developers -- isn't it a little late in the game for that kind of realignment?
    • this discussion seems to be dominated by Objective C people; wasn't a big part of the development effort to make this OS accessible to other languages?
    • why this whole thing took so long -- this isn't a new OS, it's a port of an existing one!
    1. Re:Ho Hum. by Anonymous Coward · · Score: 1, Informative

      "The NeXTStep API has been around for quite a while, and has never really had a following."

      You are confusing the original Nextstep API with Cocoa, they are not the same thing. Cocoa is a modified version of Openstep, a complete rewrite of the Nextstep API. It was designed to be portable version of the Nextstep API and also fixed many of its shortcomings. BTW, it did have a small following of very high profile people, like John Carmack and Tim Berners Lee.

      "When that failed, they tried to sell just the OS."

      The API may never have been a huge success, but it was enough of a success to keep Next in business for 10 years. It was popular in vertical markets and in RAD shops. Next abandoned the hardware and ported the softeare to Intel hardware because customers really digged the application toolkits, but didn't want to buy the hardware.

      "When that failed, they tried to sell it as an API that would run under Unix"

      I am not sure what to make of this. Nextstep was always sitting on top of BSD. If you are talking about Openstep on Solaris, Sun co-developed the Openstep API and did their own version. However, Sun killed the product after Java became successful (BTW, interfaces in Java are taken from objective-c protocols, something added to the language by Next).

      "...they finally managed to sell the whole ball of wax to Apple after Copeland self-destructed."

      Before the Apple acquisition, Next was a profitable company, buoyed by the success of WebObjects, a framework based on EOF which was based on Openstep. Apple was originally only interested in the Operating System, but when they saw WebObjects and Next's vertical market penetration, they decided to buy the *whole* company!

      (A close relationship between the chairmen of the two companies helped.)

      Where did you hear this? The acquisition of Next happened because a Next employee saw that Be was offering their OS to Apple for some ludicrous amount of money and decided to pitch Nextstep as alternative. Steve Jobs did not learn about this until later when Apple became interested.

      "people actually think that Cocoa is going to seduce a significant numbers of Carbon, Windows, or Linux/Unix developers -- isn't it a little late in the game for that kind of realignment?"

      It's amazing that people continue to say this sort of thing. Look at some of the recent languages, like PHP, how many years old is it now? It somehow realigned enough developers. Why can't it happen to another language, like Objective C?

      "why this whole thing took so long -- this isn't a new OS, it's a port of an existing one!"

      First, it is basically a new OS. Nextstep was BSD 4.3 on Mach 2.5, Mac OS X is BSD 4.4 on Mach 3.0, these are very significant changes. Second, the reason it took so long was not because of Cocoa, it was due to porting Carbon and building a new driver infrastructure. Both were very daunting tasks that took many years.

    2. Re:Ho Hum. by Anonymous Coward · · Score: 1, Interesting

      Uhm ... check your facts.

      The NeXTstep API was never sold as a basic API. It came with the NeXT systems. It was part of the overall environment. Rip it out and you had an expensive Unix console with no windowing system. Not very pretty.

      When that "failed", they just sold the OS. This is true, but it didn't fail so much as the hardware end not being too profitable (too much R&D for a small company). Oh, and the NeXTstep API was still included in that OS. Imagine that.

      They've never tried to sell it as "an API that would run under Unix." Actually, it runs under Windows, too (when you buy WebObjects for Windows).

      Also, just because something doesn't catch on, doesn't mean it is piss-poor quality. Beta kicked VHS's butt ... but that's another story.

      I don't know if a significant number of developers will jump onto Cocoa, but Cocoa doesn't need as many developers. That's not marketing hype -- I've used more OSes/languages than I care to mention and they don't touch the level of engineering as has gone into Cocoa.

      MacOS X is open to all sorts of languages, but that's more due to the Unix kernel than anything else (because lots of things run under Unix). NeXTstep had a Unix kernel from the early days (that would be the 1980's), so I don't see how you can claim OS X was specifically developed to make other languages accessible.

      It took so long because they had to make it backward compatible with 20+ million existing Macintosh users. While upgrading the UI. And the kernel. And the APIs. And adding more standards support (XML, Java, etc.). The OS wasn't the long straw in the port.

      /dev/mrg

  131. not exactly... by Anonymous Coward · · Score: 0
    1. Smalltalk did not use square brackets; it didn't use brackets at all. e.g. 'foo doStuff' is a valid message. Objective C added the square brackets because otherwise the syntax for Smalltalk-style messages would be ambiguous.
    2. a careful reading of Brad Cox's books is needed to fully appreciate Objective C, IMHO. Objective C is not a compromise between Smalltalk and C; it is a union of the best features of both. It allows you true dynamic message passing a la Smalltalk (something which is not possible in C nor C++ without re-implementing Objective C yourself), all the while letting you write real C code for machine-level performance (something not possible with Smalltalk), and you can switch between the two within the same block of code effortlessly. Instead of trying to find some mushy compromised middle between high-level and low-level programming, it offers both in all their glory, with a tiny fraction of the complexity of C++.
  132. yes, true by Anonymous Coward · · Score: 0
    In terms of execution time, using GNU's Objective C, 1 message ~= 1.5 function calls. Personally I don't think that requires a second "much": "much slower" would be sufficient. But the point remains, sending messages is slower than calling functions.

    The idea behind Objective C is the messaging of Smalltalk and the efficiency of C. If you're in a tight loop, drop back into C (or C++ if you're using ObjC++). This will only be necessary (or desired) for computationally-intensive loops (in which case the need for OO is questionable). For the remaining 99.99% of your program, the speed hit is negligible.

  133. Re:Easy? Powerful? by Anonymous Coward · · Score: 0

    Well, Cocoa always supported at least a two button mouse because the original Next machines had two button mice.

  134. Re:Why objective C? by Anonymous Coward · · Score: 0

    Actually, one of the coolest features is the ability to add methods to existing classes at run-time!

  135. Re:Why objective C? by Anonymous Coward · · Score: 0

    Have you tried using Objective-C to see if it actually runs slower in your application?

    Also, consider that if Objective-C save you development time you could spend it optimizing/profiling.

    IOW, how do you know?

  136. Re:Why objective C? by Anonymous Coward · · Score: 0

    Unless I'm mistaken, #import works perfectly well in C and C++ source, at least when compiled with gcc, where -Wno-import is set.

    I use it all the time in my C/C++ programs(compiled with cc on Mac OS X 10.1). Of course, I also include the #include hack in all of my header files.

  137. Spaces suck by togofspookware · · Score: 0

    If you have spaces in filenames, you have to go and put everything between quotes. That's why I always rename my mp3s using underscores. mpg123 is easier to type than "MP3 Player", too.

    --
    Duct tape, XML, democracy: Not doing the job? Use more.
    1. Re:Spaces suck by jeremyp · · Score: 1

      Put everything in quotes? How do you do a quote with the mouse? If I want to listen to an mp3 on my Mac I just double click it with the mouse. I don't have to *type* anything.

      I'll admit that quite often I do like to do things from a shell, but even then bash's autocomplete feature puts in backslashes before all the spaces. With current interface tools, spaces give very few problems so why care about them one way or the other?

      --
      All I want is a secure system where it's easy to do anything I want. Is that too much to ask ~~ Randall Munroe
  138. Re:Why objective C? by Anonymous Coward · · Score: 0

    Come on, everyone knows that dynamic claptrap can cost you dozens of CPU cycles at every call! No one sane would ever even consider a language like that.

  139. Re:Why objective C? by stripes · · Score: 2
    Unless I'm mistaken, #import works perfectly well in C and C++ source, at least when compiled with gcc, where -Wno-import is set.

    I don't doubt that it works in gcc, but it sure isn't part of C or C++. It is something gcc does for you (in part because it is also an ObjC compiler).

    If some day you decide to use SGI's IA64 compiler, or Intels C compiler, or Mertoworks there is a good chance that #import will just plain not work.

    It's fine if you like to use it, but understand it's no better then a Microsoft C user claiming that exception handling is part of C, not C++ just because MS decided it should work that way.

    (Of corse it's no worse then a gcc user deciding to use // comments in C code in 1998, who won the bet because as of C99 it really is part of C, not just C++ and PL/1...)

  140. Good reason by Aapje · · Score: 1

    Readme.txt:

    "Just type:
    ./configure
    ./make
    ./make install"

    Apple doesn't want to expose users to this. Including gcc will only tempt developers to take the easy route. They should make mac-software==user friendly.

    PS. The developer tools are much more than just gcc, there is a lot of Apple's software that you get for free (ProjectBuilder IDE, InterfaceBuilder, etc). It's only a download away! (I do agree that they should include the devtools with new Macs, but I don't think there is much reason to complain with the current situation, at least not until M$ gives away Visual Studio).
    .

    --

    The Drowned and the Saved - Primo Levi
    1. Re:Good reason by spitzak · · Score: 2
      Apple gives the developers plenty of other tools that can be user-unfriendly, so I don't think that is the reason there is no compiler.

      What I am proposing is that the developers have the ability to put system("gcc /tmp/the_sourc_code.c -o new_plugin.so") into the application. Yea it's hard, but no harder than any other system call, and the end user has as much need to understand it as a need to understand any other call in the system toolbox. The user only thinks they are getting a fast plugin.

  141. Re:Easy? Powerful? by jeremyp · · Score: 1

    I bought my powerbook without a one button mouse. It has a one button trackpad included and I already had a M$ optical USB mouse. Even so, when working in Aqua I hardly notice the trackpad's lack of multiple buttons. This is prabably a result of good interface design.

    Unfortunately, it completely screws copy and paste in my X server.

    --
    All I want is a secure system where it's easy to do anything I want. Is that too much to ask ~~ Randall Munroe
  142. Testing by Anonymous Coward · · Score: 0

    Fuck

  143. Re:Easy? Powerful? by jeremyp · · Score: 1

    Most Windows games use direct X to interface to the hardware. This is not (AFAIK) available for the Mac, so worrying about where the mouse is when doing a port is probably the least of your problems.

    Anyway, why do most Windows games need to move the mouse about? Sure, they may need to hide it.

    --
    All I want is a secure system where it's easy to do anything I want. Is that too much to ask ~~ Randall Munroe
  144. Re:Easy? Powerful? by jeremyp · · Score: 1

    That's what he meant:

    "Apple is equal to crap"

    not crap is assigned to apple.

    --
    All I want is a secure system where it's easy to do anything I want. Is that too much to ask ~~ Randall Munroe
  145. Re:Easy? Powerful? by fredrik70 · · Score: 1

    "You sure seem to spew a lot of it too. (See, I can make ad hominem attacks too!)"
    you know, what goes in must come out.... ;-)

    --
    if (!signature) { throw std::runtime_error("No sig!"); }
  146. practical perspective by nikko · · Score: 2, Informative

    As a long time NeXTStep, OpenStep, Webobjects (yes, WebObjects also uses ObjC) programmer I'd like to point out a few things about ObjC and the NeXTish frameworks, without religious bias.

    ObjC was a very nice language when it first came out. For a hybrid language (object semantic hacked on top of ansi C), it is much more powerful and clean than c++, which is why I made the switch. However, it is absolutely erroneous to say that there are things you can do in ObjC that cannot be done in c++. You just have to jump through hoops of fire in c++ to achieve the dynamism of ObjC. On the other hand, it WAS a hybrid language: fundamentally still C. So it was no Smalltalk. Programmers are still fundamentally responsible for memory management (there's a refcounting scheme for helping) and this requires a high skill level. In large programs, tracking memory leaks could take time. Also, ObjC was not nearly as clean as Smalltalk in other respects. Some of the object semantics in ObjC were hacked on through the use of cpp macros. You could not stay entirely in the object world-- the facade of OO was not complete. In dealing with the low level of the runtime you would have to handle c structs.

    The state of the art moves on. But ObjC doesn't, for the most part. ObjC has some features that Java is lacking: method forwarding, posing, categories, etc. Still, there are no circumstances under which I would now choose ObjC over Java. Why? Advantages of Java over ObjC:

    - Automatic memory management.
    - No direct memory access. Because of this, I can feel comfortable working with junior programmers. Not the case under ObjC.
    - Only Objects and a few sensible primitives. No other data types.
    - Unicode based.
    - Strongly typed (yep, it's an advantage, good ObjC programmers type as much as possible anyhow)
    - Exception handling first class citizen of language (it's hacked on in ObjC)
    - Fully integrated threading model (much more difficult on ObjC)
    - multi-platform. I know java isn't perfect in this respect, but ObjC and the Foundation framework was much, much worse. Basic things like threading could work differently on Solaris vs. windows under OpenStep Foundation.
    - multi-vendor.
    - A tremendous number of third party tools.
    - A tremendous amount of third party information.

    I can go on and on. I really don't see the point of Apple pursuing Cocoa, except as far as they are locked into it for legacy reasons.

    1. Re:practical perspective by Anonymous Coward · · Score: 1, Interesting

      Very good post, with very good points, but also, I think, wrong conclusions.

      I'm an experienced java programmer and also a long time Cocoa/Objective-C programmer, Smalltalk expert and C++ programmer. I confirm that Java (and for that matter Smalltalk) has some very neat features that Objective-C lacks, the biggest and most useful one being real Garbage Collecting. This one thing alone would makes Objective-C development at least two time faster and improve a lot applications stability.

      But Java has big limitations in many circumstances. Basically, Java is the Cobol of today. It is great for a vast range of enterprise application, but it is not a good platform to program games or word processors or spreadsheet or image processing programs, or industrial systems etc. In many areas like these ones, Objective-C is much better suited.

      In addition, Objective-C is much more suited for developing on Mac OS X than Java for a very important reason that will probably never change: OSX is a UNIX system. And the native programming language on UNIX is C. It has always been that way and will probably not change. UNIX is itself developed with C. All the libraries, techniques etc. are C-oriented. No one can change this. It's a fact of life. And Objective-C is superbly integrated with C, since it *is* C plus an object model. This makes Objective-C a very good language for Mac OS X (or for any UNIX). Much better than Java, at least for many kind of applications.

      I would really appreciate to have the opinion of the original poster (again, I really appreciated the post) on these arguments.

  147. Re:Easy? Powerful? by fredrik70 · · Score: 1

    You *do* get the source with MFC...
    the CWindow class is in the ATLWIN.H (yes all method implementations are in the header)

    --
    if (!signature) { throw std::runtime_error("No sig!"); }
  148. Conflict of Interest? by Anonymous Coward · · Score: 0
    An interesting tidbit from the preface of Cocoa Programming for MacOS X: A Michael Simmons is thanked for his suggestions and contributions. One can only assume that this is the same Michael Simmons who wrote this glowing review. I've seen this with other AW books as well, where someone connected with the book writes a review without acknowledging the connection.

    I don't disagree with the review. This does look like a much better beginner's book than the O'Reilly/Apple Developer Connection book (though I think that O'Reilly made the right decision to get a book out early by working with Apple to put some of their online material out in book form--this was the only Cocoa information in print for a long time and helped people get started.) But it seems a bit off color to write a review praising a book you worked on and attacking a competing book without acknowledging the connection. If this isn't the same Michael Simmons, I apologize.

    1. Re:Conflict of Interest? by Anonymous Coward · · Score: 1, Informative
      This is Michael Simmons, the author of the review (Aaron Hillegass is the author of the book) - you are correct that I was thanked in the acknowledgements for my suggestions and contributions.

      For the record, my suggestions and contributions were simply that I helped correct typos and programming example errors, and I also helped out with Apple history/factoids.

      I recently conveyed this fact to the powers that be, and I apologize for not stating this from the beginning. I didn't think it was a conflict of interest. In fact, the only reason I got involved and offered to help Aaron out was because I enjoyed the book so much (I took Aaron's class at the Big Nerd Ranch, and this is the coursebook!)

      Again, I wasn't involved directly in writing the book, I just helped polish its' appearance.

  149. Re:Easy? Powerful? by Anonymous Coward · · Score: 0

    No, then I could just infer that the value of
    (Apple == crap) is false, that they are not equal.

  150. Re:Easy? Powerful? by Anonymous Coward · · Score: 0

    MAC? With all capital letters? Let me guess - you write "PERL" too, don't you?

  151. Great scripting layers for Cocoa & Objective-C by Anonymous Coward · · Score: 0


    A big strenght of ObjC is that it integrates wonderfully with scripting languages. This is really great!

    Look at this article at O'Reilly:
    http://www.oreillynet.com/pub/a/mac/2001/11/30/scr ipting_fscript.html