Exceptions in C/C++

F

Flash Gordon

jacob navia wrote, On 11/12/07 11:21:
Of course there are a wealth of monster languages available but they
are the wrong solution: adding more complexity to software instead of
keeping it simple:

o C++ is *the* monster language.

You can use a subset of it.
o Java/C# Proprietary stuff that is slow, memory hungry because
of their virtual machine runtime

Not necessarily as bad as you think.
o Basic. No standard, you are at the mercy of the changes Microsoft
makes to the language.

There is a standard for Basic (although I don't know if there are any
current implementations) and you are only at the mercy of MS if you use
their implementation instead of one of the others.

Then there is Pascal (I've used several Pascal compilers targeting
embedded systems), Ada (definitely a standard for it) and many others.
The Pascal implementations I used definitely were not monsters.
The choice of C is because it is a non OO language,

There are plenty of those.
that is basically
very simple.

The Pascal's I used for embedded work were both simple and non-OO
What looks like a paradox it is not any: I want to keep the
simplicity of C and *at the same time* I want to enhance it so it
can be used a s a normal programming language.

Each enhancement adds complexity. That complexity needs justification.
The way C is headed now is to extinction,

It has a *very* long way to go for that.
and that is what most of the
"regulars" here actually want: a language that is so frozen in its
bugs that all reasonable software developers do not see it as an
alternative.

Stop talking crap. You obviously don't know what most of the regulars
want otherwise you would not keep repeating statements like this.
This is not what I have ever proposed. I proposed 2 major enhancements:
operator overloading, and try/catch. That is all.

Here is a quote from another message of yours...
| The main propositions developed here are:
| o Operator overloading
| o Garbage Collection
| o Generic functions
| o Default function arguments
| o References

Each of those sounds like a major change to me, and I count more than 2.
What do you want to say with that statement?

What he said. Different people would want different extensions so you
would end up with a far more complex language. For example, the things I
would most like added to the language are *not* the extensions you are
proposing. A try/catch mechanism would be on my list, but not one of the
top 2, and operator overloading would not be on it at all. The top two
would be fixed point arithmetic and decimal floating point. No, I would
not want operator overloading and implementing them using that, I would
want them part of the base language.

Oh, and don't you think the GNU and Linux people would want their
extensions added to C as a higher priority?
If you ask 100 C++ developers what do they need you would end up with
the same answer.

That is irrelevant.
There is nothing "special" about try/catch.

It can hide things quite effectively.
It fills a hole in C,
a hole that is needed in one of the fields where C is actually used:
embedded systems.

I can't say that I missed it in my years of embedded development, and I
can't remember any bugs that would have been less likely if we had used
a try/catch mechanism. So it is definitely not needed in all embedded
systems. By the way, I used a language with a try/catch mechanism before
a lot of my embedded work.
Operator overloading is a technique used in venerable languages like
FORTRAN, BASIC, what have you.

Not in most of the Basics that I used to use. Possibly Visual Basic (I
can't be bothered to check at the moment) but definitely not the others.
Nothing really complex.

You have not said why *your* top two extensions should be added in
preference to mine or anyone elses. Add all of them and you get a
monster language, add my top 2 and you don't get what you want, and so on.
 
K

Kenny McCormack

Mark McIntyre wrote:



Correct. So can't you guys STOP arguing with him?

Oh come on - give the kids a break!

Do you realize how totally empty RH's and MM's lives (*) would be if
you took their last shreds of happiness, namely Navia bashing, from them?

(*) Lives, yes. Pathetic, miserable excuses for lives, but lives
nonetheless (credit to anyone who can identify this reference).
 
J

jacob navia

Flash said:
Here is a quote from another message of yours...
| The main propositions developed here are:
| o Operator overloading
| o Garbage Collection

This absolutely not a change in the language. No new elements in
the language are needed at all.
| o Generic functions

This is an extension of operator overloading conceptually.
| o Default function arguments

This is handy but really not the top priority.
| o References

Each of those sounds like a major change to me, and I count more than 2.

ANYTHING is a "major" change. Remember the discussion in comp.std.c
about gets()????

Abandoning gets() would be a MAJOR change said many people.

And it happened eventually, and *because* of that discussion.
It can hide things quite effectively.


I can't say that I missed it in my years of embedded development, and I
can't remember any bugs that would have been less likely if we had used
a try/catch mechanism. So it is definitely not needed in all embedded
systems. By the way, I used a language with a try/catch mechanism before
a lot of my embedded work.

So YOU use it but you do not want it in C?

This is the attitude of many people that cry because of the
small improvements I want to introduce in C but used them every day...
 
K

Keith Thompson

jacob navia said:
Keith said:
jacob navia said:
The way C is headed now is to extinction, and that is what most of the
"regulars" here actually want: a language that is so frozen in its
bugs that all reasonable software developers do not see it as an
alternative.
[...]

Why do you keep repeating this falsehood? Can you cite one single
article in which one of the "regulars" has expressed a desire for C to
become extinct?

[big snip]

A simple "no" would suffice.

You have not cited an article in which one of the "regulars" has
expressed a desire for C to become extinct.

Here's what I think you're really saying; please correct me if I
unintentionally misrepresent your position.

You personally believe that C is becoming extinct. You have some
ideas for changes to the language (exceptions, operator overloading,
automtic garbage collection) that you believe would save the language
from extinction. When you advocate those changes here in comp.lang.c,
the reaction from the "regulars" has been negative; either they
dislike your proposals (and fail to offer better ideas for changing
the language), or they ask you to discuss them elsewhere, or both.

And therefore, it follows that the "regulars" *want* C to become
extinct.

The first few steps in (what I believe to be) your reasoning are not
entirely unreasonable. The last, in my opinion, is a huge leap not
supported by any evidence that has been offered here.
 
K

Keith Thompson

jacob navia said:
This absolutely not a change in the language. No new elements in
the language are needed at all.


This is an extension of operator overloading conceptually.

No, it isn't (unless you're using the term "generic functions" in a
very different sense than what I'm used to).

If you mean something similar to C++ template, they're *very*
different from operator overloading. An overloaded operator (a) lets
you define a function whose name is an operator symbol, and which is
called with operator syntax, and (b) requires the compiler to resolve
which function is to be called based on the types of the arguments.
(For just the latter, you can have function overloading; as I recall,
you advocate operator overloading, but not function overloading.)
There is no sharing of the implementation of different overloads of
the same operator; all they have in common is the name.

A generic function, on the other hand, lets you write a single
function-like entity that can be instantiated for multiple types.

If you mean something different by "Generic functions", please
explain.

[...]
ANYTHING is a "major" change. Remember the discussion in comp.std.c
about gets()????

Abandoning gets() would be a MAJOR change said many people.

I don't recall anyone referring to it as a "major change". A few
people opposed it because it was *a change* that would break existing
code, not because it was a *major* change.
And it happened eventually, and *because* of that discussion.

gets() has not been abandoned; it's merely been deprecated and
declared obsolescent. Conforming implementations are still required
to provide it.

[...]
So YOU use it but you do not want it in C?

Read again. He used a language with a try/catch mechanism. *Later*,
he did embedded work; in the course of that work, he didn't feel the
need for a try/catch mechanism. He's refuting your claim that
try/catch is needed for embedded work.

[...]
 
J

jacob navia

Keith said:
A simple "no" would suffice.

You have not cited an article in which one of the "regulars" has
expressed a desire for C to become extinct.

I said in this same thread:
> The fact is, that C is completely disappearing from the surface of

Heathfield answered:
> This doesn't actually matter as much as you seem to think.

C disappearing is not so bad as I would think.

Yeah. Then it's OK.
Here's what I think you're really saying; please correct me if I
unintentionally misrepresent your position.

You personally believe that C is becoming extinct.

I cited a lot of facts that you snipped.

You have some
ideas for changes to the language (exceptions, operator overloading,
automtic garbage collection) that you believe would save the language
from extinction. When you advocate those changes here in comp.lang.c,
the reaction from the "regulars" has been negative; either they
dislike your proposals (and fail to offer better ideas for changing
the language), or they ask you to discuss them elsewhere, or both.

And therefore, it follows that the "regulars" *want* C to become
extinct.

They do not want anything. They want just C89 forever. The language
becomes obsolete, people turn away from it.

Like those old homeowners amid a house in ruins
that refuse to repair anything...

"It is OK like that". I am old anyway.
 
F

Flash Gordon

jacob navia wrote, On 11/12/07 20:07:
This absolutely not a change in the language. No new elements in
the language are needed at all.

Garbage collection is a new element to the language. I and I believe at
least some others consider it to be a major new element.
This is an extension of operator overloading conceptually.

You chose to list it separately.
This is handy but really not the top priority.

It is still an extension and one that many people would consider major.

Another major change.

How about answering this point. You just claimed to have only proposed 2
major changed and I have quoted you proposing more than that.
ANYTHING is a "major" change. Remember the discussion in comp.std.c
about gets()????

Abandoning gets() would be a MAJOR change said many people.

Yes, and a lot of people who would say that were advocating the change.
And it happened eventually, and *because* of that discussion.

It has been deprecated, and I'm sure that the reason for it was not the
discussions here.

You fail to address this.
So YOU use it but you do not want it in C?

No, currently I'm programming mostly in C, XSLT, bash scripting and a
few other odd languages and since most of them do not have exceptions
I'm not using exceptions. I *have* used them in the past however.
This is the attitude of many people that cry because of the
small improvements I want to introduce in C but used them every day...

Not all embedded work requires them, so claiming that embedded systems
need them is not a valid justification. I've actually stated before that
I would like a simple exception mechanism, it is just not at the top of
my list of extensions I would like and not something I actually require
and not something I would have wanted for any of the embedded work I did.
 
K

Keith Thompson

jacob navia said:
I said in this same thread:


Heathfield answered:


C disappearing is not so bad as I would think.

Yeah. Then it's OK.

Richard did not say that he *wants* C to become extinct.

Learn to read.
I cited a lot of facts that you snipped.

Good for you.
They do not want anything. They want just C89 forever. The language
becomes obsolete, people turn away from it.

Like those old homeowners amid a house in ruins
that refuse to repair anything...

"It is OK like that". I am old anyway.

We want to discuss C as it currently exists. That implies absolutely
nothing about whether we want it to change.

A weather report discusses the weather as it actually is. It does not
discuss what the weather *should* be, or what we can do to change it;
there are other forums for such discussions. If a meteorologist
insisted on spending all his time talking about what he *wants* the
weather to be, how can I find out whether to carry an umbrella today?
 
R

Richard Heathfield

Keith Thompson said:
I don't recall anyone referring to it as a "major change". A few
people opposed it because it was *a change* that would break existing
code, not because it was a *major* change.

It can reasonably be argued that any code that would be broken by the
withdrawal of support for gets() is already broken anyway.

<snip>
 
J

jameskuyper

jacob said:
They do not want anything. They want just C89 forever. The language
becomes obsolete, people turn away from it.

That's a very different claim from your original. It's still wrong,
but it's wrong in a very different way. Just because they don't think
that the particular changes you are suggesting are improvements,
doesn't mean that they don't want to improve the language.

And going back to your original claim (now abandoned?), it very
definitely doesn't mean that they WANT the language to become extinct.
What it does mean is that either they don't agree with you that it is
going extinct, or they don't agree with you that the changes that you
want would help prevent extinction, or they think that the changes you
want may actually help speed the extinction of the language. None of
those positions is equivalent to or implies a desire for the language
to become extinct.
 
R

Richard Heathfield

Keith Thompson said:

Richard did not say that he *wants* C to become extinct.

Nor did I say that I believe it is becoming extinct. My remark was in
answer to this claim: "The fact is, that C is completely disappearing from
the surface of the visible programming languages, faster than COBOL."

And I think that's true. C is indeed becoming less "visible". It's no
longer the rising star of programming languages. It is less commonly
taught in CS than in former years (although it is clear from reading this
group that lots of people are still studying it in a formal environment).
Languages like C++, Python, and latterly C#, are far more "visible" than
C, as a quick peek at the shelves of the bookshop's CS section will
demonstrate. And it was in that context that I replied that this doesn't
actually matter all that much - which is true.

The COBOL reference is relevant, I think. COBOL has basically vanished from
view - but it is STILL THERE, under the surface, and it's still a very
important language, and people still earn good money developing new COBOL
programs. The same applies to C. It is no longer particularly "visible",
but it's still there, and people still earn good money writing new C
programs. Okay, so nowadays Joe Programmer writes his hello-world programs
in VB or C# or whatever. So what? Where C is used, it is used a *lot*. In
systems programming, in the Unix world, and in embedded devices, C is
still very much in demand.

Does it matter, then, that C isn't as visible as it used to be, that it is
no longer "on the surface", so to speak? No, not particularly. It might
matter, if C were a religion - but it's just a programming language. If
better tools come along to replace it - great! Imagine something *even
better* than C! Fabulous! But until they do, C continues to hold an
important place in the modern programming world. And for as long as that
continues to be true, it will continue to be useful to have a discussion
group that focuses on that language. This doesn't mean it isn't possible
to improve C, but to view it as some kind of endangered species that needs
to evolve quickly or die out is just silly.

We want to discuss C as it currently exists. That implies absolutely
nothing about whether we want it to change.

Precisely so.
A weather report discusses the weather as it actually is. It does not
discuss what the weather *should* be, or what we can do to change it;
there are other forums for such discussions. If a meteorologist
insisted on spending all his time talking about what he *wants* the
weather to be, how can I find out whether to carry an umbrella today?

Murphy's Law. Always carry an umbrella. If you forget it, you'll regret it.
 
J

jacob navia

Default said:
On and on and on.

Is there ANY purpose to this incessant arguing with Jacob? Do you think
accomplish anything besides give him a platform for his whacked-out
ideas?




Brian

Unable to argue, put forward any arguments.

Typical.

Just hoping that I will disappear, that C will remain in 1989
forever.
 
K

Kenny McCormack

On and on and on.

Is there ANY purpose to this incessant arguing with Jacob? Do you think
accomplish anything besides give him a platform for his whacked-out
ideas?

There you go again - trying to remove the last shreds of meaning from
their lives.
 
R

Richard Heathfield

jacob navia said:
Unable to argue, put forward any arguments.

Lots of people have put forward lots of arguments which you have seen fit
to ignore or misunderstand. It is hardly surprising that some people no
longer see any point in arguing with you. This does not imply that they
are unable to argue.
Typical.

Just hoping that I will disappear, that C will remain in 1989
forever.

Amazingly, that sentence is 50% correct. This may be some kind of record.
 
J

jacob navia

That's a very different claim from your original. It's still wrong,
but it's wrong in a very different way. Just because they don't think
that the particular changes you are suggesting are improvements,
doesn't mean that they don't want to improve the language.

I have yet to see ANY proposal from the to improve ANYTHING.
Even the small improvements of C99 will be rejected (see the
countless posts of Heathfield about how bad C99 is, non portable whatever)

And going back to your original claim (now abandoned?), it very
definitely doesn't mean that they WANT the language to become extinct.

If you do not repair a house, it will break down and disappear.
Programming languages (like all software) must be constantly kept up
to date, things that looked OK are not OK anymore in the ever changing
software environment of TODAY.

If you insist in living in the past, you can freeze the language like
Heathfield, using a compiler from the last century and feeling clever
with it, like those homeowners that always postpone any repairs
until it is too late.

There is not a engineering argumentation anymore. Heathfield argues that
COBOL still gives you enough to make a living coding for old
applications somewhere.

Obviously he thinks that C should go the same way, since
there is so much software written in C that until it disappears it will
take a while.

But not the shadow of any engineering argument.
What it does mean is that either they don't agree with you that it is
going extinct,

Heathfield agrees that C is "less visible" and thinks it is a good
thing.
or they don't agree with you that the changes that you
want would help prevent extinction,

No. They are against ANY change. Even C99 is too much change for them.
or they think that the changes you
want may actually help speed the extinction of the language.

That would be new. Up to now none of them has said something
like that, but... it is never too late :)
None of
those positions is equivalent to or implies a desire for the language
to become extinct.

As I told you above, if you do not keep software up to date it just
breaks down and is abandoned. It is NOT that you WANT that, it is
just a fact of life.
 
J

jacob navia

Flash said:
Yes, and a lot of people who would say that were advocating the change.


It has been deprecated, and I'm sure that the reason for it was not the
discussions here.

After a LONG discussion about gets() in comp.std.c,
where I participated with many
others, Mr Gwyn felt necessary to bring the matter to the committee.

He wanted a more modest proposal, where there would be an implicit
BUFSIZE limit for gets().

The committee seized the opportunity and declared gets() obsolete.
 
K

Keith Thompson

Default User said:
Keith Thompson wrote:

On and on and on.

Is there ANY purpose to this incessant arguing with Jacob? Do you think
accomplish anything besides give him a platform for his whacked-out
ideas?

You make a good point. I think it's important not to let jacob's
misstatements go entirely unanswered, but I'll consider trying not to
engage him in argument as much as I have been.
 
J

jacob navia

Richard said:
jacob navia said:


Lots of people have put forward lots of arguments which you have seen fit
to ignore or misunderstand. It is hardly surprising that some people no
longer see any point in arguing with you. This does not imply that they
are unable to argue.


Amazingly, that sentence is 50% correct. This may be some kind of record.

Yeah, you are in for a LOOOOOONG wait heathfield (with lowercase :)
 

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

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top