Professional Web Applications Themes

Becoming a Macintosh Programming Guru [C++ & how?] - Mac Programming

In article <BBE03D57.15F3B%fr>, Eric VERGNAUD <fr> wrote:   Right. Now consider what happens when someone does this: String z1 = "174", z2 = "22"; [lots of complicated programming here] z1 = z1 + z2; Forgetting that z1 and z2 are strings and not integers. That's why overloaded operators are bad....

  1. #101

    Default Re: Becoming a Macintosh Programming Guru [C++ & how?]

    In article <BBE03D57.15F3B%fr>,
    Eric VERGNAUD <fr> wrote:
     

    Right. Now consider what happens when someone does this:

    String z1 = "174", z2 = "22";

    [lots of complicated programming here]

    z1 = z1 + z2;

    Forgetting that z1 and z2 are strings and not integers. That's
    why overloaded operators are bad.


    Simon Guest

  2. #102

    Default Re: Becoming a Macintosh Programming Guru [C++ & how?]

    dans l'article demon.co.uk, Simon Slavin à
    demon.co.uklocalhost a écrit le 21/11/03 1:18:
     
    >
    > Right. Now consider what happens when someone does this:
    >
    > String z1 = "174", z2 = "22";
    >
    > [lots of complicated programming here]
    >
    > z1 = z1 + z2;
    >
    > Forgetting that z1 and z2 are strings and not integers. That's
    > why overloaded operators are bad.
    >
    >[/ref]

    Not very convincing.

    Eric

    Eric Guest

  3. #103

    Default Re: Becoming a Macintosh Programming Guru [C++ & how?]

    In article <demon.co.uk>,
    demon.co.uklocalhost (Simon Slavin) wrote:
     
    >
    > Right. Now consider what happens when someone does this:
    >
    > String z1 = "174", z2 = "22";
    >
    > [lots of complicated programming here]
    >
    > z1 = z1 + z2;
    >
    > Forgetting that z1 and z2 are strings and not integers. That's
    > why overloaded operators are bad.[/ref]

    Uh ... no, that's why string literals not being string objects is bad.
    Or why not being able to overload built in operators on built in types
    is bad. Or why C strings and arrays being silently coerced into
    pointers is bad.

    *Luckily*, however, the compiler will not allow you to silently add two
    pointers, so things could be worse...

    -- Bruce
    Bruce Guest

  4. #104

    Default Re: Becoming a Macintosh Programming Guru [C++ & how?]

    In article <BBE1BCE8.1609E%fr>,
    Eric VERGNAUD <fr> wrote:
     

    No. Hooking things up is almost never done in code. It's
    done by pointing and clicking in Interface Builder. So it
    takes about five clicks which is even less than 11 characters.
    I can think of only one application I've written which needs
    to mess with declaring targets and actions in code and that's
    one which has to define its own interface depending on the
    structure of the data it's given to handle. This almost never
    happens.

    People keep insisting on expressing the annoyances of writing
    code. I keep telling them that you don't need to write code.


    Simon Guest

  5. #105

    Default Re: Becoming a Macintosh Programming Guru [C++ & how?]

    In article <mail-C6D9AF.10221820112003localhost>,
    Michael Ash <com> wrote:
     

    You may have failed to appreciate the advantages of having an
    object-oriented operating system when you're trying to persuade
    people to write clean object-oriented code.

    If you're trying to persuade people to use sets and iterators,
    for example, then using a Cocoa API which hands back the list
    of available displays as an array of structs forces the
    programmer to do their own conversion or to drop out of OO mind.
    Faced with the need to handle arrays and structs, presumably
    quickly and elegantly, they'll probably not bother to use OO
    techniques in that small part of their code.

    Having /everything/ returned as objects, sets or arrays, and
    operated as methods helps to keep programmers thinking along
    OO lines as they're programming.


    Simon Guest

  6. #106

    Default Re: Becoming a Macintosh Programming Guru [C++ & how?]

    In article <0.1.2>,
    demon.co.uklocalhost (Simon Slavin) wrote:
     
    >
    > You may have failed to appreciate the advantages of having an
    > object-oriented operating system when you're trying to persuade
    > people to write clean object-oriented code.[/ref]

    Hey Simon, you're right on. I want to reply to Micahel but could not get
    the referenced article.

    Michael, what gave you the idea that Apple abandoned Carbon and started
    completely from scratch with Cocoa? Cocoa was around for a long time,
    long before Apple ever even thought about OS X. It wasn't called Cocoa
    of course, it was OpenStep (I believe)...but it was intended for writing
    applications ridiculously fast and also enforcing more uniformity of
    application behavior across the OS. (By making the programmer implement
    only the behavior he wants and leaving the rest to default code in the
    frameworks).

    I like cocoa apps a lot. You can definitely tell just by running and
    looking which apps are Carbon and which are Cocoa. Cocoa apps are
    usually faster and prettier, as well as more savvy with OS X technology.

    --
    |\/| /| |2 |<
    mehaase(at)sas(dot)upenn(dot)edu
    Mark Guest

  7. #107

    Default Re: Becoming a Macintosh Programming Guru [C++ & how?]

    In article <upenn.edu>,
    Mark Haase <net> wrote:
     

    I never said anything like what you're saying, that Apple abandoned
    Carbon and started from scratch with Cocoa, so I'm not really sure what
    you're talking about. Of course I know about the history of Cocoa and
    that it's been around for a long time. I did say that Apple *would be*
    starting from scratch on a C API to Cocoa.
     

    This, I can agree with.
    Michael Guest

  8. #108

    Default Re: Becoming a Macintosh Programming Guru [C++ & how?]

    In article <0.1.2>,
    demon.co.uklocalhost (Simon Slavin) wrote:
     
    >
    > You may have failed to appreciate the advantages of having an
    > object-oriented operating system when you're trying to persuade
    > people to write clean object-oriented code.
    >
    > If you're trying to persuade people to use sets and iterators,
    > for example, then using a Cocoa API which hands back the list
    > of available displays as an array of structs forces the
    > programmer to do their own conversion or to drop out of OO mind.
    > Faced with the need to handle arrays and structs, presumably
    > quickly and elegantly, they'll probably not bother to use OO
    > techniques in that small part of their code.
    >
    > Having /everything/ returned as objects, sets or arrays, and
    > operated as methods helps to keep programmers thinking along
    > OO lines as they're programming.[/ref]

    Thus the magic of CoreFoundation. Modern Carbon code does mostly use OO
    objects, sets, and arrays, in the form of CF objects. Apple *is* moving
    towards Cocoa/Carbon convergence. Just look at CF/NS toll-free bridging,
    the ability to mix windows and event handlers in the same app, etc.

    Carbon has two goals. One is to be the procedural API, the other is for
    portability. The old really-non-OO methods have to stay around for
    portability reasons. The new OO methods, which do exactly what you're
    saying via CF objects, are quickly becoming the recommended way.

    I have never said anything about Carbon being better, or OO techniques
    being worse in a C environment, or anything like that. *All* that I have
    said is that I think it is a bad use of Apple's time to ditch Carbon and
    start over from scratch on a C wrapper API for Cocoa.

    Time to convince my news server to post the article as-is, since I don't
    want to snip anything... is this enough?

    No.... how about this?
    Michael Guest

  9. #109

    Default Re: Becoming a Macintosh Programming Guru [C++ & how?]

    In article <mail-40923D.10433024112003localhost>,
    Michael Ash <com> wrote:
     

    True..I completely misread your post. I was just glancing at the history
    of this thread and there are way too many articles (and not so many on
    my news server) that its futile for me to go back and see who did say
    that, if anybody.

    You're right though, a C API for Cocoa is unneccessary.

    --
    |\/| /| |2 |<
    mehaase(at)sas(dot)upenn(dot)edu
    Mark Guest

Page 6 of 6 FirstFirst ... 456

Similar Threads

  1. Macintosh - Font issues when viewed on macintosh
    By Steven in forum Web Design
    Replies: 1
    Last Post: July 1st, 01:45 PM
  2. Replies: 0
    Last Post: May 5th, 06:41 PM
  3. Gradiant Guru - where r u?
    By Graham_Newman@adobeforums.com in forum Adobe Illustrator Macintosh
    Replies: 12
    Last Post: February 26th, 07:22 AM
  4. Really need HELP from a GURU
    By MyaTiX in forum ASP Database
    Replies: 7
    Last Post: December 23rd, 06:51 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139