Re: Current languages are a mess, what would you choose C#, Java or C++?

Discussion in 'C Programming' started by Michael Wojcik, Jan 13, 2005.

  1. In article <>, Programmer Dude <> writes:
    >
    > That's certainly the expressed fear. I just wonder sometimes how
    > many programmers ever really abused operator overloading (considering
    > every book I've read about languages that allow it seem to hammer in
    > the point about being sensible)...
    >
    > Anyone ever run into any bad examples of it?


    That's rather subjective, isn't it? Personally, I don't even like
    the use of the shift operators in C++ iostreams (and yes, I've read
    Stroustrop's explanation of why he chose them). Nor am I
    particularly keen on overloading, say, array indexing to implement
    virtual arrays.

    But many people have no quibbles with either of those.

    --
    Michael Wojcik

    Warning: may contain traces of nuts.
    -- Adapted from a sig line used by Walter Roberson
    Michael Wojcik, Jan 13, 2005
    #1
    1. Advertising

  2. Michael Wojcik

    jacob navia Guest

    Re: Current languages are a mess, what would you choose C#, Javaor C++?

    Michael Wojcik wrote:
    > In article <>, Programmer Dude <> writes:
    >
    >>That's certainly the expressed fear. I just wonder sometimes how
    >>many programmers ever really abused operator overloading (considering
    >>every book I've read about languages that allow it seem to hammer in
    >>the point about being sensible)...
    >>
    >>Anyone ever run into any bad examples of it?

    >
    >
    > That's rather subjective, isn't it? Personally, I don't even like
    > the use of the shift operators in C++ iostreams (and yes, I've read
    > Stroustrop's explanation of why he chose them). Nor am I
    > particularly keen on overloading, say, array indexing to implement
    > virtual arrays.
    >


    Why would you say that indexing a sparse/virtual array
    should not be done with operator overloading?

    Could you explain?

    Thanks


    > But many people have no quibbles with either of those.
    >
    jacob navia, Jan 13, 2005
    #2
    1. Advertising

  3. Michael Wojcik

    Ben Midgley Guest

    You are posting to comp.lang.c here so I reckon you are going to get a
    biased opinon against Java but frankly Ansi C is the only C worth using in
    anger, C++ is a bastardised version of C with a lot of problems but frankly
    it has all the benefits widely available libs and open source code so it is
    the weapon of choice, C# ..who cares and Java is at least built from the
    ground up as the 'object orientated' language it proposes to be unlike the
    other two.


    "Michael Wojcik" <> wrote in message
    news:...
    >
    > In article <>, Programmer Dude

    <> writes:
    > >
    > > That's certainly the expressed fear. I just wonder sometimes how
    > > many programmers ever really abused operator overloading (considering
    > > every book I've read about languages that allow it seem to hammer in
    > > the point about being sensible)...
    > >
    > > Anyone ever run into any bad examples of it?

    >
    > That's rather subjective, isn't it? Personally, I don't even like
    > the use of the shift operators in C++ iostreams (and yes, I've read
    > Stroustrop's explanation of why he chose them). Nor am I
    > particularly keen on overloading, say, array indexing to implement
    > virtual arrays.
    >
    > But many people have no quibbles with either of those.
    >
    > --
    > Michael Wojcik
    >
    > Warning: may contain traces of nuts.
    > -- Adapted from a sig line used by Walter Roberson
    Ben Midgley, Jan 13, 2005
    #3
  4. Michael Wojcik wrote:
    >
    > That's rather subjective, isn't it? Personally, I don't even like
    > the use of the shift operators in C++ iostreams (and yes, I've read
    > Stroustrop's explanation of why he chose them).


    No matter how he tries to justify, he wrong. I find it ironic
    that the main i/o library in C++ is one of the best examples
    of the abuse of operator overloading.

    > Nor am I
    > particularly keen on overloading, say, array indexing to implement
    > virtual arrays.


    Thats another horror.

    > But many people have no quibbles with either of those.


    Many people are fools and idiots. Many people have no taste.

    Erik
    --
    +-----------------------------------------------------------+
    Erik de Castro Lopo (Yes it's valid)
    +-----------------------------------------------------------+
    "I invented the term Object-Oriented, and I can tell you I did not
    have C++ in mind." -- Alan Kay
    Erik de Castro Lopo, Jan 13, 2005
    #4
  5. Michael Wojcik

    jacob navia Guest

    Re: Current languages are a mess, what would you choose C#, Javaor C++?

    Erik de Castro Lopo wrote:

    > Michael Wojcik wrote:
    >
    >>That's rather subjective, isn't it? Personally, I don't even like
    >>the use of the shift operators in C++ iostreams (and yes, I've read
    >>Stroustrop's explanation of why he chose them).

    >
    >
    > No matter how he tries to justify, he wrong. I find it ironic
    > that the main i/o library in C++ is one of the best examples
    > of the abuse of operator overloading.
    >


    I thought it was the visual appeal of >> (output)
    and << (input) isn't it?

    That is not so bad as string addition. That is worst,
    since a+b != b+a...

    Other bad examples include date addition, and other things
    where operator overloading is not justified.
    >
    >>Nor am I
    >>particularly keen on overloading, say, array indexing to implement
    >>virtual arrays.

    >


    Why not?

    You could build a sparse array library that allows
    the old code to be used transparently.

    Suppose you have software that uses normal arrays
    and you want to use it with sparse arrays
    since the data sets are thinly spread across the
    array.

    By redeclaring the arrays as "Sparse_array"
    (or whatever) you can use the old software
    without change, very useful.

    Besides operator overloading allows for the
    easy creation of number representations, and
    it is the best example where it is *really*
    useful.

    Lcc-win32 implements operator overloading and I think
    it is useful if used with care.
    jacob navia, Jan 13, 2005
    #5
  6. Michael Wojcik

    CBFalconer Guest

    Michael Wojcik wrote:
    >

    .... snip ...
    >
    > That's rather subjective, isn't it? Personally, I don't even like
    > the use of the shift operators in C++ iostreams (and yes, I've read
    > Stroustrop's explanation of why he chose them). ....


    That actually makes some sense to me, if you think of the operation
    of shifting data between internal buffers and external files. The
    arrows point in the direction of flow.

    --
    "If you want to post a followup via groups.google.com, don't use
    the broken "Reply" link at the bottom of the article. Click on
    "show options" at the top of the article, then click on the
    "Reply" at the bottom of the article headers." - Keith Thompson
    CBFalconer, Jan 14, 2005
    #6
  7. In article <>, (Michael Wojcik) writes:
    >
    > That's rather subjective, isn't it? Personally, I don't even like
    > the use of the shift operators in C++ iostreams ...


    Gah. That was supposed to be posted to comp.programming. xrn gets
    the newsgroups: header using the NNTP XHDR command, and Newsguy's
    NNTP server only supports XHDR for some headers, not including
    newsgroups. Consequently, I have to enter the newsgroup manually,
    until I stop procrastinating and fix xrn to extract the newsgroup
    header from the message I'm following up.

    In this case I entered the wrong group.

    Terribly sorry about that.

    --
    Michael Wojcik

    Thanks for your prompt reply and thanks for your invitatin to your
    paradise. Based on Buddihism transmigration, I realize you, European,
    might be a philanthropist in previous life!
    -- supplied by Stacy Vickers
    Michael Wojcik, Jan 14, 2005
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    1,125
  2. Deep_Feelings
    Replies:
    12
    Views:
    495
    Paul Moore
    Jul 15, 2009
  3. Alexander
    Replies:
    620
    Views:
    8,138
    Seebs
    Nov 9, 2010
  4. Alexander
    Replies:
    68
    Views:
    1,515
  5. Alexander
    Replies:
    60
    Views:
    1,434
    Thomas G. Marshall
    Nov 4, 2010
Loading...

Share This Page