Re: UT_Bool vs bool


Subject: Re: UT_Bool vs bool
From: Paul Rohr (paul@abisource.com)
Date: Mon Feb 05 2001 - 15:20:05 CST


At 09:37 PM 2/5/01 +0100, Mike Nordell wrote:
>Wasn't it? Please enlighten me (us?). If I'm not completely mistaken this
>"hack" was to allow something resembling a bool datatype on the compilers
>not supporting it at that moment. Am I completely wrong? Did you think of
>something completely different?

Nope. It's just an old defensive programming habit. You code using
reasonably modern tools for the desktop, and at a certain point you're
successful enough that people starting asking for ports to goofier and
goofier platforms. The tools available get worse and worse, not better.
And adding in the #includes to redefine something as fundamental as "bool"
after the fact is more annoying than just putting in that infrastructure
from the get go.

I guess that's a pretty backwards notion of "future platforms", huh? ;-)

>Well, we have apparently already agreed upon the fact that future C++
>compilers will be more, not less, conforming than current ones. This is
>quite certain a correct prediction re. bool. Since current ones actually
>allow bool, and it has sneaked its way into the src without any problems...
>I might also add that you _introduce_ errors by "inventing" a sort-of-bool
>datatype on compilers supporting bool. As already mentioned by lots and lots
>of people in related newsgroups, a conforming compiler evaluates any logical
>expression to a bool. If you try to fake this by any other datatype the
>compiler will bite you whenever you want to overload anything on the bool
>datatype.

Absolutely. No argument here.

>Then that is probably what we should do. Replace any instance of UT_Bool
>with plain bool, and its instance values with the "real" ones. Since the
>last one _I_ know of was MSVC4.2 (i.e. MSC 10.x), and we _require (according
>to our docs) at least MSVC5.0 to even build AW, I don't see where the
>problems could arise.

Agreed.

>But this rise another question to me, one that I'd reslly like answerded:
>If you *never* believed to support on of the basic datatype "bool", why the
>heck did you use crippled C++?! Was it just for the sake of cripple it?!

Nope. Our goal wasn't to cripple C++, it was to do a better job of
packaging C.

Oh, there were many, many days when we could have gotten lots of rabid
C-only folks on our side (kernel hackers, GNOME luminaries, etc.) by doing
even less than we did. Given the noise they make, it was very tempting
indeed. (Have a private conversation with the Eazel folks someday about
C++.)

But the minimal advantages offered by rudimentary classes (simple
inheritance, hiding behind interfaces, and destructors) were just too nice
to pass up.

>I however liked your input. In this case I regarded it non-educated (so
>shoot me) but most of the time you say something it's *really* worth the
>time to read it. So please, continue comment. And also beware, I never back
>down from a good argument! :-) (is that an invitation or what?! ;-) ).

Thanks.

>Again, I hope I didn't offend anyone, it was never my intention. My
>intention was purely to educate and enhance AbiWord.

No problem at all. It's great to have you doing what you're doing. (It's a
lot more than I am.)

Paul



This archive was generated by hypermail 2b25 : Mon Feb 05 2001 - 15:12:29 CST