Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

"C or C++" vs. "C/C++" :)

7 views
Skip to first unread message

Thomas

unread,
May 17, 2000, 3:00:00 AM5/17/00
to
I'm just curious, but why is it that people in this group tend to reply with
"the language C/C++ does not exist" or "C/C++ is 2, what do you mean?" when
the phrase C/C++ is used in a sentense? I mean, everybody knows that when
someone asks a question like "... how would I do this in C/C++?" means that
the he/she (as in he *or* she, not he divided by she :)) wants the answer
given in C or C++ or something that works for both languages. Other than
that this newsgroup has nothing to do with the C++ programming language,
what is the big fuss about using the phrase C/C++ as used in many books and
literature dealing with the C and C++ programming languages? Is it simply to
state that this channel has nothing to do with C++ and maybe avoid the
confusion among newbies that C and C++ are pretty much the same, or is this
a "religious" kinda thing? :)

Just curious...

Cheers.

Jack Klein

unread,
May 17, 2000, 3:00:00 AM5/17/00
to
On Wed, 17 May 2000 02:39:26 GMT, "Thomas" <bit...@c2i.net> wrote in
comp.lang.c:

Unfortunately it is more than just newbies. It is also some
experienced programmers and, tragically, at least some college level
instructors.

Why don't people talk about FORTRAN/BASIC, or Pascal/Modula2, since
the second language in each pair is based to a greater or lesser
extent on the first? C and C++ are two different languages and since
the adoption of the C++ International Standard (1998) and the recent
update to the C standard (1999) they have become farther apart than
ever.

It would be interesting to start a group like:

news:comp.lang.neither.c.nor.c++

The object would be to post code that failed to compile in either C or
C++, but for totally different reasons in each language, no error in
either language being illegal in the other.

int main(void)
{
register int new = 1;
int *class = &(++new);
return 0;
}

Jack Klein
--
Home: http://jackklein.home.att.net

Dave Vandervies

unread,
May 17, 2000, 3:00:00 AM5/17/00
to
In article <yDnU4.9542$gy4.1...@juliett.dax.net>,

Thomas <bit...@c2i.net> wrote:
>I'm just curious, but why is it that people in this group tend to reply with
>"the language C/C++ does not exist" or "C/C++ is 2, what do you mean?" when
>the phrase C/C++ is used in a sentense? I mean, everybody knows that when
>someone asks a question like "... how would I do this in C/C++?" means that
>the he/she (as in he *or* she, not he divided by she :)) wants the answer
>given in C or C++ or something that works for both languages. Other than
>that this newsgroup has nothing to do with the C++ programming language,
>what is the big fuss about using the phrase C/C++ as used in many books and
>literature dealing with the C and C++ programming languages? Is it simply to
>state that this channel has nothing to do with C++ and maybe avoid the
>confusion among newbies that C and C++ are pretty much the same, or is this
>a "religious" kinda thing? :)

It seems to me that this is because C and C++ are two rather different
languages, and constructs in one of these languages are often any or
all of illegal, deprecated, or poor coding style in the other; the
people who say `C/C++' tend to be roughly the same people who seem not
to have realized this yet.

So you could say that it's partly a religious issue, but there's a (IMO
very practical) reason for it as well. If you mean C or C++, say C or
C++; if you mean the common subset of C and C++, say the common subset
of C and C++; if you want people to think you don't know what you're
talking about, say C/C++.


Just my $0.02 worth.
dave

--
Dave Vandervies
dj3v...@student.math.uwaterloo.ca

If God is watching us, the least we can do is be entertaining.

Alex Krol

unread,
May 17, 2000, 3:00:00 AM5/17/00
to
In article <yDnU4.9542$gy4.1...@juliett.dax.net>,
"Thomas" <bit...@c2i.net> wrote:
> I'm just curious, but why is it that people in this group tend to
reply with
> "the language C/C++ does not exist" or "C/C++ is 2, what do you mean?"
when
> the phrase C/C++ is used in a sentense? I mean, everybody knows that
when
> someone asks a question like "... how would I do this in C/C++?" means
that
> the he/she (as in he *or* she, not he divided by she :)) wants the
answer
> given in C or C++ or something that works for both languages. Other
than
> that this newsgroup has nothing to do with the C++ programming
language,
> what is the big fuss about using the phrase C/C++ as used in many
books and
> literature dealing with the C and C++ programming languages? Is it
simply to
> state that this channel has nothing to do with C++ and maybe avoid the
> confusion among newbies that C and C++ are pretty much the same, or is
this
> a "religious" kinda thing? :)

Nothing religious there - just plain statement. C and C++ are
different languages, they are progressively diverging and C-way of doing
things more and more differs from a proper C++ solution.
Consider, for a moment:
in C, something like
if (status != OK_E)
is a straightforward comparison;
in C++,
if (status != deviceStatus_t::ok_e)
may invoke function call.

--
Regards,
Alex Krol
Disclaimer: I'm not speaking for CreoScitex, Creo and/or Scitex Corp.
C-FAQ: http://www.eskimo.com/~scs/C-faq/top.html


Sent via Deja.com http://www.deja.com/
Before you buy.

Malcolm

unread,
May 17, 2000, 3:00:00 AM5/17/00
to
> Just curious...
> Cheers.

It's to defend the group. If we admit that C is just a
subset of C++ then there is little reason to post here than
next door.

Of course to be pedantic it is true that C is not a true
subset of C++, and people on the ng like to be pedantic.

(My complier is also a pedant. For instance if I say

if(x == 5 || 6)

it will deliberately and evilly misinterpret).

In some ways it is useful to compile code in straight C to
force upon yourself the discipline of working in a
procedural rather than object-oriented way. However most of
my "C" code is in fact compiled under C++, for several
reasons.


* Sent from AltaVista http://www.altavista.com Where you can also find related Web Pages, Images, Audios, Videos, News, and Shopping. Smart is Beautiful

Richard Heathfield

unread,
May 17, 2000, 3:00:00 AM5/17/00
to
Malcolm wrote:
>
> In article <yDnU4.9542$gy4.1...@juliett.dax.net>,
> "Thomas" <bit...@c2i.net> wrote:
> > I'm just curious, but why is it that people in this group tend to reply with
> > "the language C/C++ does not exist" or "C/C++ is 2, what do you mean?" when
> > the phrase C/C++ is used in a sentense? I mean, everybody knows that when
> > someone asks a question like "... how would I do this in C/C++?" means that
> > the he/she (as in he *or* she, not he divided by she :)) wants the answer
> > given in C or C++ or something that works for both languages. Other than
> > that this newsgroup has nothing to do with the C++ programming language,
> > what is the big fuss about using the phrase C/C++ as used in many books and
> > literature dealing with the C and C++ programming languages? Is it simply to
> > state that this channel has nothing to do with C++ and maybe avoid the
> > confusion among newbies that C and C++ are pretty much the same, or is this
> > a "religious" kinda thing? :)
> > Just curious...
> > Cheers.
>
> It's to defend the group.

Yes. Have you seen what happens to newsgroups which don't defend their
topicality? They start off talking about, say, COBOL, and end up
discussing cobblers.

> If we admit that C is just a subset of C++ then there is little reason to post here than next door.

Why admit a falsehood? C is not a subset of C++. It has never been a
subset of C++, and it's increasingly unlikely that it ever will be a
subset of C++.

For C to be a subset of C++, all legal C programs should be legal C++
programs. And they aren't, so it isn't.

>
> Of course to be pedantic it is true that C is not a true subset of C++, and people on the ng like to be pedantic.

If you know it isn't a subset, why claim that it is?

>
> (My complier is also a pedant. For instance if I say
>
> if(x == 5 || 6)
>
> it will deliberately and evilly misinterpret).

It will deliberately interpret the code correctly, in accordance with
the Standard. It's not the compiler's fault if the programmer doesn't
understand the Standard.

>
> In some ways it is useful to compile code in straight C to
> force upon yourself the discipline of working in a
> procedural rather than object-oriented way. However most of
> my "C" code is in fact compiled under C++, for several
> reasons.

If you are not aware that this is a risky approach, you ought to be made
aware. The differences between the two languages aren't all as obvious
as

int new;

and can lead to subtle bugs.

I suspect that the "several reasons" you mention are (1) your compiler's
bundled editor defaults to saving files with a .cpp extension and (2) no
other reason.


--

Richard Heathfield

"Usenet is a strange place." - Dennis M Ritchie, 29 July 1999.

C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
37 K&R Answers: http://users.powernet.co.uk/eton/kandr2/index.html (60
to go)

Kaz Kylheku

unread,
May 17, 2000, 3:00:00 AM5/17/00
to
On Wed, 17 May 2000 02:39:26 GMT, Thomas <bit...@c2i.net> wrote:
>I'm just curious, but why is it that people in this group tend to reply with
>"the language C/C++ does not exist" or "C/C++ is 2, what do you mean?" when
>the phrase C/C++ is used in a sentense? I mean, everybody knows that when
>someone asks a question like "... how would I do this in C/C++?" means that
>the he/she (as in he *or* she, not he divided by she :)) wants the answer

Note that ``he/she'' is poor typography. I'd never use slashes this way
in a serious paper, and I would avoid the ``and/or'' construction like
a plague.

The ``C/C++'' abomination is often used by people who have no clue, thinking
that this is one language, like ``PL/1''. As in ``Loser corporation is
looking for a junior C/C++ programmer to work long hours for minimum wage.''

What do they want, a C programmer or a C++ programmer? Or someone who knows
both?

--
#exclude <windows.h>

Neej

unread,
May 17, 2000, 3:00:00 AM5/17/00
to

> > In some ways it is useful to compile code in straight C to
> > force upon yourself the discipline of working in a
> > procedural rather than object-oriented way. However most of
> > my "C" code is in fact compiled under C++, for several
> > reasons.
>
> If you are not aware that this is a risky approach, you ought to be
made
> aware. The differences between the two languages aren't all as obvious
> as
>
> int new;
>
> and can lead to subtle bugs.
>
> I suspect that the "several reasons" you mention are (1) your
compiler's
> bundled editor defaults to saving files with a .cpp extension and (2)
no
> other reason.
>

Perhaps I don't understand, but are you saying that it's not a good
idea to compile C (not C++) programs unders a C++ compiler? i.e. if I
compile my C programs w/ VC++, is this not a desirable solution? I'm
certain (almost) that at least VC++ differentiates between languages by
the .c/.cpp extension.

raw...@my-deja.com

unread,
May 17, 2000, 3:00:00 AM5/17/00
to
In article <slrn8i5sh...@ashi.FootPrints.net>,

k...@ashi.footprints.net wrote:
>
> The ``C/C++'' abomination is often used by people who have no clue,
thinking
> that this is one language, like ``PL/1''.

Did IBM use PL/2 to write OS/2 to run on the PS/2?

--
MJSR

Dann Corbit

unread,
May 17, 2000, 3:00:00 AM5/17/00
to
"Neej" <cos...@my-deja.com> wrote in message
news:8fv1p1$2sg$1...@nnrp1.deja.com...

>
> > > In some ways it is useful to compile code in straight C to
> > > force upon yourself the discipline of working in a
> > > procedural rather than object-oriented way. However most of
> > > my "C" code is in fact compiled under C++, for several
> > > reasons.
> >
> > If you are not aware that this is a risky approach, you ought to be
> made
> > aware. The differences between the two languages aren't all as obvious
> > as
> >
> > int new;
> >
> > and can lead to subtle bugs.
> >
> > I suspect that the "several reasons" you mention are (1) your
> compiler's
> > bundled editor defaults to saving files with a .cpp extension and (2)
> no
> > other reason.
> >
>
> Perhaps I don't understand, but are you saying that it's not a good
> idea to compile C (not C++) programs unders a C++ compiler?

That is correct. Unless your goal is to port to C++.

> i.e. if I
> compile my C programs w/ VC++, is this not a desirable solution?

That's a completely different issue. VC++ contains a complete and excellent
C compiler.

> I'm
> certain (almost) that at least VC++ differentiates between languages by
> the .c/.cpp extension.

That is correct. You can also use a command line flag to tell it to compile
a file as though it were C++.

There are nuances in the language where the code may behave differently as C
and as C++. That's the danger the responder was referring to. Are you
prepared to do a regression test of each module every time you switch? If
not, then you are creating something unreliable.

On the other hand, you may really know what you are doing. There is nothing
wrong with writing procedural C++ if you want to. In fact, that is what
many (most?) "C++ programmers" tend to do, according to my experience.
--
C-FAQ: http://www.eskimo.com/~scs/C-faq/top.html
"The C-FAQ Book" ISBN 0-201-84519-9
C.A.P. Newsgroup http://www.dejanews.com/~c_a_p
C.A.P. FAQ: ftp://38.168.214.175/pub/Chess%20Analysis%20Project%20FAQ.htm

Martin Ambuhl

unread,
May 17, 2000, 3:00:00 AM5/17/00
to

Neej wrote:

> Perhaps I don't understand, but are you saying that it's not a good

> idea to compile C (not C++) programs unders a C++ compiler? i.e. if I
> compile my C programs w/ VC++, is this not a desirable solution? I'm


> certain (almost) that at least VC++ differentiates between languages by
> the .c/.cpp extension.

You make think you are using a C++ compiler, but the differentiation by
extension leads to a C compiler being used. There is no problem using the
Mirosoft (or Borland) combined product when it invokes the C compiler. It you
had used a C++ extension or set the options to always compile as C++, then you
would have a problem.

--
Martin Ambuhl mam...@earthlink.net

What one knows is, in youth, of little moment; they know enough who
know how to learn. - Henry Adams

A thick skin is a gift from God. - Konrad Adenauer
__________________________________________________________
Fight spam now!
Get your free anti-spam service: http://www.brightmail.com

Mark McIntyre

unread,
May 17, 2000, 3:00:00 AM5/17/00
to
On Wed, 17 May 2000 02:39:26 GMT, "Thomas" <bit...@c2i.net> wrote:

>I'm just curious, but why is it that people in this group tend to reply with
>"the language C/C++ does not exist" or "C/C++ is 2, what do you mean?" when
>the phrase C/C++ is used in a sentense?

Because the C solution and the C++ solution could be very different.
Imagine asking "how would you do this in Basic/VB" and getting an
answer in terms of Vax Basic. Not going to mean a lot to your average
VB programmer...

>I mean, everybody knows that when
>someone asks a question like "... how would I do this in C/C++?" means that
>the he/she (as in he *or* she, not he divided by she :)) wants the answer

>given in C or C++ or something that works for both languages.

Ideally you ask for that then. "How would you do this portably in C
and C++"

>Other than
>that this newsgroup has nothing to do with the C++ programming language,
>what is the big fuss about using the phrase C/C++ as used in many books and
>literature dealing with the C and C++ programming languages?

Because its highly misleading - it implies that the languages are the
same. Consider pass by reference, strong typing, const, classes, STL,
and a host of more subtle differences such as NULL, casting etc.

--
Mark McIntyre
C- FAQ: http://www.eskimo.com/~scs/C-faq/top.html

Adams Klaus-Georg

unread,
May 18, 2000, 3:00:00 AM5/18/00
to
raw...@my-deja.com writes:

> In article <slrn8i5sh...@ashi.FootPrints.net>,
> k...@ashi.footprints.net wrote:
> >
> > The ``C/C++'' abomination is often used by people who have no clue,
> thinking
> > that this is one language, like ``PL/1''.
>
> Did IBM use PL/2 to write OS/2 to run on the PS/2?

No, they still use PL/1, but they skipped a lot of steps and use it on
OS/390 to run on the S/390. LOL

--
MfG, Klaus-Georg Adams

Decklin Foster

unread,
May 19, 2000, 3:00:00 AM5/19/00
to
Jack Klein <jack...@att.net> writes:

> Unfortunately it is more than just newbies. It is also some
> experienced programmers and, tragically, at least some college level
> instructors.

I took an exam the day before yesterday that went (in part),
``translate the following C/C++/pseudocode into x86 assembly[0]...''

I'm inclined to think that ``C/C++/pseudocode'' is theoretically OK,
as it means ``pseudocode that could borrow concepts from either C or
C++''. OTOH, the specific examples on the exam didn't use anything
that reqired C++, just constructs that were common to both languages.
Yecch. I think I would have used ``C pseudocode'' or ``pseudo-C'' or
something.

[0] Yes, my brain has been horribly disfigured. I want a RISC machine,
and if I ever have to use x86 assembly again, a book to teach me M4.

--
There is no TRUTH. There is no REALITY. There is no CONSISTENCY. There
are no ABSOLUTE STATEMENTS. I'm very probably wrong. -- BSD fortune(6)


Ben Ketcham

unread,
Jun 8, 2000, 3:00:00 AM6/8/00
to
Hmmm, well, maybe it would be useful to define a new language,
consisting of that *subset* of *C* which also constitutes valid
C++. E.g., programs which use "new" as an identifier would be
excluded, etc..

To identify that a program belongs to this subset, it would be
helpful to have a name for the subset. I know, how about "C/C++"!
Since our esteemed local pedants like to remind us that there is no
such language as "C/C++", it would seem that the name is available;
and what better use for it could there be?

As the two languages, C and C++, gradually diverge, the C/C++ language
will become smaller and smaller, but it will probably always be a
"Turing-compatible" and useful language. Given the fact that many times
one doesn't have control over whether ones code is compiled with a C
compiler or a C++ compiler, it makes sense to write to this new C/C++
language subset any time one can reasonably do so, for portability.

So now when newbies post questions about C/C++, instead of telling
them there is no such language, one should simply correct any errors
they may have in the use of that language (such as using "new", either
as an identifier or as an operator).

--ben ;)

In article <3922F0FE...@eton.powernet.co.uk>,


Richard Heathfield <bin...@eton.powernet.co.uk> wrote:
>Malcolm wrote:
>>
>> In article <yDnU4.9542$gy4.1...@juliett.dax.net>,

>> "Thomas" <bit...@c2i.net> wrote:
>> > I'm just curious, but why is it that people in this group tend to reply with
>> > "the language C/C++ does not exist" or "C/C++ is 2, what do you mean?" when

>> > the phrase C/C++ is used in a sentense? I mean, everybody knows that when


>> > someone asks a question like "... how would I do this in C/C++?" means that
>> > the he/she (as in he *or* she, not he divided by she :)) wants the answer

>> > given in C or C++ or something that works for both languages. Other than


>> > that this newsgroup has nothing to do with the C++ programming language,
>> > what is the big fuss about using the phrase C/C++ as used in many books and

>> > literature dealing with the C and C++ programming languages? Is it simply to
>> > state that this channel has nothing to do with C++ and maybe avoid the
>> > confusion among newbies that C and C++ are pretty much the same, or is this
>> > a "religious" kinda thing? :)
>> > Just curious...
>> > Cheers.
>>
>> It's to defend the group.
>
>Yes. Have you seen what happens to newsgroups which don't defend their
>topicality? They start off talking about, say, COBOL, and end up
>discussing cobblers.
>
>> If we admit that C is just a subset of C++ then there is little reason to post here than next door.
>
>Why admit a falsehood? C is not a subset of C++. It has never been a
>subset of C++, and it's increasingly unlikely that it ever will be a
>subset of C++.
>
>For C to be a subset of C++, all legal C programs should be legal C++
>programs. And they aren't, so it isn't.
>
>>
>> Of course to be pedantic it is true that C is not a true subset of C++, and people on the ng like to be pedantic.
>
>If you know it isn't a subset, why claim that it is?
>
>>
>> (My complier is also a pedant. For instance if I say
>>
>> if(x == 5 || 6)
>>
>> it will deliberately and evilly misinterpret).
>
>It will deliberately interpret the code correctly, in accordance with
>the Standard. It's not the compiler's fault if the programmer doesn't
>understand the Standard.
>
>>

>> In some ways it is useful to compile code in straight C to
>> force upon yourself the discipline of working in a
>> procedural rather than object-oriented way. However most of
>> my "C" code is in fact compiled under C++, for several
>> reasons.
>
>If you are not aware that this is a risky approach, you ought to be made
>aware. The differences between the two languages aren't all as obvious
>as
>
>int new;
>
>and can lead to subtle bugs.
>
>I suspect that the "several reasons" you mention are (1) your compiler's
>bundled editor defaults to saving files with a .cpp extension and (2) no
>other reason.
>
>

0 new messages