Re: Idiots
Leigh Johnston wrote:
"Victor Bazarov" <v.Abazarov@comAcast.net> wrote in message
news:hq4rte$kr$1@news.datemas.de...
All generalizations are wrong(TM). Absolutes never make good
sense(TM). There *is* no spoo^H^H^H^Hprohibition, don't you see? You
seem to leave out this very important part of any recommendation given
by the "regulars of this newsgroup": "...unless you know what you're
doing" or "...unless the situation calls for it". Compare: "Don't use
abstract interfaces" and "Don't use abstract interfaces unless it's
the most straightforward way to achieve your goal".
So far I have seen very little of these qualifications of which you
speak. These qualifications are entirely correct and I agree with 100%.
Do you have children? Have you tried teaching a child how to operate,
say, scissors? What is the first thing you say? "Don't run with
scissors!" Should you instead wrap it in a doctorate theses with all
disclaimers stated and exceptions spelled out? <shrug> Perhaps you've
been looking in wrong newsgroup threads if you've not seen these
qualifications of which I speak.
If one needs a more detailed explanation of different points of view on
a subject, one should probably turn to books and/or ask more specific
questions, like, "I understand that it's a rule; are there any
exceptions to that rule? Are they described anywhere?"
Can using public virtuals create code which is difficult to maintain?
Yes, especially when created by newbie programmers. Should you avoid
public virtuals because of this? No.
Now, this just _doesn't make sense_. "Can you break your legs if you
jump from the roof of a two-story building? Yes, especially if you're
not trained to land properly (and if the ground it hard). Should you
avoid jumping from the roof of a two-story building because of that?
No." WHAT?! How can it be "no"?! Yes, absolutely, avoid jumping
*because* you can break your legs, and your neck, and your arms, and
your ribs, and get a concussion while your at it... Can you still jump
if the fire is raging on the second floor and the roof is about to
collapse under your feet? Yes, if jumping (and possibly breaking your
legs) is going to save you from burning alive...
> Should you think hard before
making a virtual public? All depends on the use-case, if you are
writing an abstract interface (effectively a callback) no thought is
required, public virtuals are fine for this use-case.
<sigh> You want every "regular"'s statement to be amended with
qualifications, yet you yourself would like to use "no" when answering a
simple question of "should one avoid using a dangerous and error-prone
construct?" Why the double standard?
There are no absolutes when it comes to real life. There is no black
and white. "Should I ever dereference a NULL pointer?" - "If you know
that it leads to undefined behavior, and the undefined behavior is what
you want, then by all means, dereference it".
Am I getting my point across at all?
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask