Re: Exception Misconceptions
In article <a65d3221-02ca-4a18-907f-9027cce07e64@c34g2000yqn.googlegroups.com>, James Kanze <james.kanze@gmail.com> wrote:
On Dec 20, 3:39 pm, ta...@mongo.net (tanix) wrote:
In article
<35f3b2ed-8303-4249-8b12-3f85b4907...@s31g2000yqs.googlegroups.com>,
James Kanze <james.ka...@gmail.com> wrote:
[...]
Java's portability is
limited to machines which have a good JVM.
I don't know what is "good JVM".
Yes, the JVM as released by microsoft a way back,
that supported JDK 1.1 or 1.2 from what I recall
was not "good JVVM". Just WAy too many bugs.
Correct.
Which isn't many.
Well, about 90% of total market from what I know.
Our markets may not be the same, or perhaps we have different
definitions of a "good JVM". And Sun has, I believe, made
considerable progress. But when I was working in Java, about
the only implementation I'd have considered passably good was
the one for Windows;
Correct. Performance wise, MVM runs 2 times faster than
JVM from Sun for me, and that REALLY counts. The difference
on big jobs is days and nights.
the others (including the one for Solaris)
were really very basic interpreters, with really excessive
runtime overhead. And in the markets I've worked in in the
past, Windows is a non-runner.
5) Robustness.
And THAT is where these nasty exceptions come in handy.
You'll never be able to write a stable code, and I mean
TRULY stable, if you do not use exceptions.
Explain how applications have been running for years, without
interruption, and without using exceptions.
Well, THEORETICALLY, it can happen even without using
exceptions. In reality, it is just a joke.
It's no joke. It's an everyday reality. Most of the phone
switches and transmission systems go back to a time before
exceptions, and they work. Year in, year out, without
interruption.
Yep. No argument there. Except those apps are infantile
by todays standards.
If you tell me I have to write my code WITHOUT exeptions,
I won't take your job offer. Sorry.
Period.
There is no ifs and buts on this one for me.
I do not know why some claim the exception mechanism
is so inefficient even in cases where there are not
exceptions, but that is another matter.
I can only guess that if you want to get TOO sophosticated
and assure that you can unwind the stack even considering
the on heap allocations and things like that, and,
as a result, have to save all sorts of things prepairing
to run the exceptions bound code, may be.
Who knows?
For one thing, without exceptions your code becomes a huge
pile of spegetti code and I know what I am talking about.
Apparently not,
Apparently yes.
I just wrote too much code to make such a statement.
It is simply inevitable.
because I've worked on very large code bases,
without exceptions,
Again, this is a general purpose statement that does not
prove anything.
Either you do test of your return codes,
or you don't.
If you decide to do, and your logic runs to check all the
codes, then your code size and the amount of spagetti
is probably at least 30% bigger.
With exceptions, you do not check ANY return code
more or less. Clear to a 5 year old what it means.
and without any spaghetti. Exceptions do
make certain things easier, but you can live without them.
You can live without anything except water for more than
3 days and food for more than 40 days and things of that level.
This is the LAW, and not philosophy:
You MUST use exceptions to take care of your error conditions
in more cases than not.
(The application in question was written before C++ supported
exceptions.) Exceptions are a useful tool, for certain
things, but like all tools, you can do without (at some
development cost) if you have to.
Sorry. I can not agree with you on this one.
I think you are somehow predisposed AGAINST exceptions.
Not at all.
Yes you are. I have seen some of your posts.
It seems like a matter of principle to you.
I just don't understand what could possibly be a reason
for it.
But I was programming long before they were
generally available,
Understood. No problems with that one.
"It is hard to teach an old dog new tricks".
An old dog knows at least one thing: how to survive.
That is why he is an OLD dog.
Otherwise, he'd be dead by now, like most of other
dogs he knew.
If something works for you, you don't need to forever
chase the "fasion". Who cares what color of trousers
they think are MUST nowadays?
You have your trousers that are comfortable
and you don't feel restricted by this never ending
fashion trip.
So, why would you want to run to some store and
waste some money on something totally useless,
just because they say on the idiot box that the latest
fasihion is this and that?
You are fine as you are.
Your code runs like a tank.
Someone invents some fasion grade goubledy gook.
Do you run to the store like a zombie, just because
everybody else is running?
I don't.
In fact, I appreciate that time.
Because these zombies are busy, crawling on the top
of each other, waiting since last night when the store
opens so they can get their zombification machine
called Sony Playstation v. whatever.
At that time, you can have a break from this madness.
Because everyone is so busy running for that latest
version of zombification machine, that no one has any
time to even bother about you.
Cool.
and we still managed to write robust and
maintainable applications.
Well. I am not saying it is not possible in PRINCIPLE.
I am saying it is a royal pain on the neck.
In fact, I will make this claim:
If you do NOT use exceptions, you are just a lazy bum.
That is ALL there is to it.
Enjoy, you old wolfe.
--
Programmer's Goldmine collections:
http://preciseinfo.org
Tens of thousands of code examples and expert discussions on
C++, MFC, VC, ATL, STL, templates, Java, Python, Javascript,
organized by major topics of language, tools, methods, techniques.