Making C better (by borrowing from C++)

J

James Kuyper

jacob said:
WE WERE SPEAKING ABOUT THE MICROSOFT C COMPILER WHEN USED FOR
COMPILING C PROGRAMS.

That sentence refers to that compiler and its usage for C.

No, it does not. If that was the intent, then you wrote it incorrectly.
You should have written something like the following:

> I might try the commerical version of the Vista compiler and see if I
> can actually get anything useful done with it.

It produces messages saying that most of the C library is "considered
deprecated".
 
J

Joachim Schmitz

James Kuyper said:
Masood wrote:
...

I can't imagine how you intended it to be taken as anything other than
offensive; being offensive strikes me as the whole point of such an
reference.

Please note that "I apologize if you took offense" isn't really a true
apology. It implies that the real blame is on Keith (and, by implication,
myself and others) for being offended, and that you still don't understand
that it was in fact offensive.

I would prefer to hear from you something along the line of "I apologize
for inadvertently writing something offensive.


Then choose for your comparison some group other than the Taliban. The
Taliban's claim to fame is not their fundamentalism, which is
unfortunately common throughout the world. They're famous for the violence
and oppression with which they impose their understanding of God's will on
others.

The people you've designated at "the C Taleban" don't have any power
whatsoever to impose their understanding of the ISO committee's will on
anybody; I'm not saying that I know for certain that none of them would
abuse such power if they had it; but they don't have it, so it's a moot
point.
"Taliban" merely means "students". Does that still offend you?

bye, Jojo
 
J

jameskuyper

Joachim said:
"Taliban" merely means "students". Does that still offend you?

I'm well aware of the etymology of the name. If that were the only
meaning of the word, and then his use of that word would not have
offended me. It would have confused me, because that meaning doesn't
match the context in which he used the word. In context, it was quite
clear that he was using "Taleban" as a reference to the organization
which adopted that word as it's name.
 
M

Malcolm McLean

Richard Heathfield said:
He's talking nonsense. Of course VC's editor can search upwards. What's
more, it takes just a single keypress to jump to a declaration (and
another to pop back to where you came from), so he doesn't even /need/ >
the reverse search that VC does in fact have.
So does emacs. But I'm not clever enough to know how to use it. So I grep
instead and check the line numbers.

A function you don't know how to use is no different to no function at all.
 
R

Richard

James Kuyper said:
Masood wrote:
...

I can't imagine how you intended it to be taken as anything other than
offensive; being offensive strikes me as the whole point of such an
reference.

Please note that "I apologize if you took offense" isn't really a true
apology. It implies that the real blame is on Keith (and, by
implication, myself and others) for being offended, and that you still
don't understand that it was in fact offensive.

I would prefer to hear from you something along the line of "I
apologize for inadvertently writing something offensive.


Then choose for your comparison some group other than the Taliban. The
Taliban's claim to fame is not their fundamentalism, which is
unfortunately common throughout the world. They're famous for the
violence and oppression with which they impose their understanding of
God's will on others.

So like Americans then?

"Taleban" is no more offensive than being called a Yank IMO.
The people you've designated at "the C Taleban" don't have any power
whatsoever to impose their understanding of the ISO committee's will
on anybody; I'm not saying that I know for certain that none of them
would abuse such power if they had it; but they don't have it, so it's
a moot point.

Yet they insist on trying.
 
D

David Resnick

I know that this topic may inflame the "C language Taleban", but is
there any prospect of some of the neat features of C++ getting
incorporated in C? No I am not talking out the OO stuff. I am talking
about the non-OO stuff, that seems to be handled much more elegantly in
C++, as compared to C. For example new & delete, references, consts,
declaring variables just before use etc.

I am asking this question with a vested interest. I would really like
to use these features in my C programs.

Masood

Why not use a C++ compiler and voluntarily restrict yourself to the
features you want? I'm assuming you are using a system where a C++
compiler is available (not always the case of course). Yes, you get a
slightly different base language in the largely common C/C++
intersection (size of char constants, differing const semantics,
additional reserved words, etc), but once you allow for that you are
set. I wonder if anyone has compiler options that restrict which C++
features you can use, or if such is even feasible. e.g. you could set
options such as "no multiple inheritance" or "no templates" or "no
overloading" or whatever policies suit you, and have the compiler
enforce your choices. It could even be smart and not enforce them
inside system headers, if that is too painful. Just a thought. If
you like this option, discussing it in comp.lang.c++ (or a compiler
group) is the way to go...

BTW, without the OO stuff, new/delete seems useless to me. Main
feature of normal new/delete beyond allocating the memory is the use
of constructors/destructors, but you said no objects? Declaring
variables just before use is C99 feature (and fairly common extension
prior to that). Not sure what you want for const. References are OK,
but, well, so are pointers which is what references are under the
hood... I'm not sure that what you are asking for is really worth
much. I like both C and C++, and don't feel a reason for C to become
more like C++. If I want to use C++ features, well, I know where to
find them.

-David
 
R

Robert Latest

Masood said:
I didn't mean to offend anyone with the word "Taleban" - I apologize if
you took offense.

Well, OK, but back to your original question: If you lile to use certain
constructs that C++ offers in your programs, why don't you just code in C++
from the beginning?

robert
 
J

Joachim Schmitz

I'm well aware of the etymology of the name. If that were the only
meaning of the word, and then his use of that word would not have
offended me. It would have confused me, because that meaning doesn't
match the context in which he used the word. In context, it was quite
clear that he was using "Taleban" as a reference to the organization
which adopted that word as it's name.
That group would be islamic fundamentalist, so a C Taliban would be a C
fundamentalist, still no offence IMHO, but a pretty good description...

Not every Taliban is a suizide bomber and not every suizide bomber is a
taliban and those who are, haven't read their koran properly in the first
place, hence ain't proper "students"

Bye, Jojo
 
J

jameskuyper

Richard said:
So like Americans then?

"Taleban" is no more offensive than being called a Yank IMO.

I'm consider my country's attack on and occupation of Iraq to be
crimes for which, in an ideal world, George W. Bush and many of the
top members of his administration could be brought to a fair trial on
capital charges by a trustworthy entity with the legitimate authority,
will, and power to do so. Unfortunately, in the real world I know of
no entity that possess more than two of the four characteristics I
just specified. I consider that my country's re-election of George
Bush, after all the lies had been fully unveiled, makes the country as
a whole an accessory after the fact in those crimes.

So, no, I am not very proud to be a US citizen right now. It will take
a long time to remove these stains from our country's honor. But a
slim majority of us are fighting to take back control of this
government in the next election, so I see a faint hope for
improvement.

However, I would not agree that "Yank" is as much of an insult as
"Talib" (the singular form of "Taliban"). I regret that my country's
behavior has frequently been far short of the ideals it has nominally
promoted, but the Taliban's behavior has been much worse. Most
importantly, the evil behavior of the Taliban has been in accord with
their professed "ideals"; the evil behavior of the Bush administration
has been in conflict with my country's professed ideals.
 
F

Flash Gordon

Malcolm McLean wrote, On 27/12/07 15:28:
So does emacs. But I'm not clever enough to know how to use it.

So don't.
So I
grep instead and check the line numbers.

A function you don't know how to use is no different to no function at all.

If you believe that you should not be in an educational establishment.
Not as student *or* teacher.
 
J

jameskuyper

Joachim Schmitz wrote:
....
Not every Taliban is a suizide bomber

I wish they were; that would finish off the movement pretty quickly.
... and not every suizide bomber is a
taliban

Of course not; most of them are affiliated with other groups.
... and those who are, haven't read their koran properly in the first
place, hence ain't proper "students"

There appear to be many people with a lot of power who read the Koran
as permitting the use of violence against individual civilians who's
only crime was to not share the same beliefs. There appear to be some
people who read the Koran as prohibiting such things,. but I'm not
sure how many they are; they don't seem to be sufficiently numerous or
powerful to keep the first group in check. As an atheist, I don't take
the Koran as authoritative. However, from my reading of that book, for
those who do consider it to be authoritative, it seems to me that the
first group has better arguments than the second one.
 
J

jacob navia

I'm consider my country's attack on and occupation of Iraq to be
crimes for which, in an ideal world, George W. Bush and many of the
top members of his administration could be brought to a fair trial on
capital charges by a trustworthy entity with the legitimate authority,
will, and power to do so. Unfortunately, in the real world I know of
no entity that possess more than two of the four characteristics I
just specified. I consider that my country's re-election of George
Bush, after all the lies had been fully unveiled, makes the country as
a whole an accessory after the fact in those crimes.

So, no, I am not very proud to be a US citizen right now. It will take
a long time to remove these stains from our country's honor. But a
slim majority of us are fighting to take back control of this
government in the next election, so I see a faint hope for
improvement.

However, I would not agree that "Yank" is as much of an insult as
"Talib" (the singular form of "Taliban"). I regret that my country's
behavior has frequently been far short of the ideals it has nominally
promoted, but the Taliban's behavior has been much worse. Most
importantly, the evil behavior of the Taliban has been in accord with
their professed "ideals"; the evil behavior of the Bush administration
has been in conflict with my country's professed ideals.

This is a very good post.

I think, even if it is completely off topic here, that Mr Kuyper gave
a VERY GOOD answer. I agree with him.
 
C

CBFalconer

Paul said:
(e-mail address removed) wrote:
.... snip ...


Really? Personally, I cannot even make that work. VC++'s editor
does not have a backward search, nor does it have Perl compatible
RE search, nor does it have simple semantics for ping-pong
buffering between two different searches. But in C89, its hardly
needed as an eyeball scan is quick and usually sufficient.

Most allegedly intelligent programmers begin by selecting a
suitable editor, and then use a command line driven compiler
together with a make file. This manages to insulate the
programming environment from the weird ideas of such people as the
Microsoft organization. Please note that even the fouled up
Microsoft mechanisms include a command line driven compiler.

It is extremely easy to find editors implementing backward search.
 
U

user923005

... snip ...

ctrl-f, check "search up"

ctrl-f, check "use regular expressions"

Output to window 1, output to window 2
Most allegedly intelligent programmers begin by selecting a
suitable editor,

I am fond of UltraEdit32. Most amazing of all, it will edit files
from my PC on OpenVMS, Solaris, Linux, etc. and automatically update
the local version. I love it.
and then use a command line driven compiler
together with a make file.  This manages to insulate the
programming environment from the weird ideas of such people as the
Microsoft organization.  Please note that even the fouled up
Microsoft mechanisms include a command line driven compiler.

I have to admit that I also like IDEs. I tend to use Eclipse on Linux
and the like and Visual Studio on Windows.
It is extremely easy to find editors implementing backward search.

Perhaps backward search is a new feature, but I seem to remember using
it for as long as I can recall.
 
C

Chris Hills

CBFalconer said:
Nonsense. "gcc -W -Wall -ansi -pedantic" is a quite accurate ISO-C
compiler for C90, and replacing -ansi with -std=C99 makes for a
fairly accurate C99 compiler.

Not it's not but I can't be bothered to argue.
 
C

Chris Hills

CBFalconer said:
You seem incapable of telling MS FUD from fact. The C library is
NOT deprecated. Try reading the C standard.

Why read the C standard when one has the Authoritative "safe[r]" or
"secure" Microsoft Library?

"A Library which has been accepted by ISO as a TR and TR's invariably
become part of the standard" It is the like from being accepted as a TR
to TR's being part of the next revision of the standard that is the
problem. IT is true that many do but it is not automatic.

This is the argument took place well over a year ago. I voted against
the MS library for the obvious reason of MS FUD above. MS has
"depreciated" the standard library for it's own "safe(r)" library. ISO
hasn't.

The problem is that now the MS library is "official" they have started
to use official words like "depreciate" for anything else. This just
shows that a company in MS's position can subvert the standards process.

Hence the Joke "how many MS programmers does it take to change a light
bulb?"

Answer "none" (They just declare darkness a new standard.)

How true.
 
M

Malcolm McLean

Richard Heathfield said:
Out of print.

Seriously, those who really want to know will have no difficulty in
finding
out.
Don't go for a job in sales and marketing.

The book is called C Unleashed. Though the publisher has sold all his stock
that does not mean that copies are unobtainable. Amazon currently has two
copies for sale.
Why not buy one, and a copy of Basic Algorithms by me (available from the
link on my website) , and post a thread comparing the two offerings?
 
C

Chris Hills

Ben Pfaff said:
It's a matter of point of view. Microsoft can consider the C
library, or portions of it, deprecated if they want to, and it
seems that they do. The question is really whether the C
standards committee considers it deprecated. The answer is, I
presume, "no".

We agree

It is smoke and mirrors by MS however as the vast majority of their
users only use MS tools they don't really care what ISO or anyone else
does as they are in a purely MS world.

On the other hand. The other major user of C is the embedded world who
don't care at all what MS do and tend to use C95 with the last major
group being the GCC crowd who work to GCC their standards anyway.
 
C

Chris Hills

CBFalconer said:
Wrong. You can use gcc freely to develop anything at all. What
you can't do is incorporate GNU source code in your devopment
without licensing that development under GPL.

Quite a restrictive license...
 
C

Chris Hills

However, I would not agree that "Yank" is as much of an insult as
"Talib" (the singular form of "Taliban").

In many many parts of the world "yank" is a worse insult.
In fact in some parts of the world Yank has been changed to "septic" as
in septic-tank == yank.

All I can do is wish you good luck in November. But this is all way off
topic.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top