Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Size of bool unspecified: why?

Reply
Thread Tools

Size of bool unspecified: why?

 
 
JBarleycorn
Guest
Posts: n/a
 
      07-25-2011
Alf P. Steinbach wrote:
> On 22.07.2011 20:01, James Kanze wrote:
>> On Jul 22, 12:29 am, "JBarleycorn"<(E-Mail Removed)> wrote:
>>
>>> A different numeric type, which there are a number to choose
>>> from. Who writes a program that doesn't have a header that
>>> tests for assumptions based upon the platform?

>>
>> Who does? In over thirty years of experience in C and C++, I've
>> yet to see any application which uses such a header.

>
> Uh, Boost (lots of them). Not to mention C99/C++0x <stdint.h>. <g>
>
>
>> I'm
>> tempted to say that someone who uses such a header doesn't
>> understand the basic philosophy behind C and C++.

>
> *hark*
>


See, Fred Kanya, you are... umm, what is it.. are you ... well you
know... you go to church but, naughty little you... are you... you like
to play with your tingly bits.... you are... umm, let me think about
this.... could you perhaps be


 
Reply With Quote
 
 
 
 
James Kanze
Guest
Posts: n/a
 
      07-30-2011
On Jul 24, 6:40 pm, Robert Wessel <(E-Mail Removed)> wrote:
> On Sun, 24 Jul 2011 03:48:08 -0700 (PDT), James Kanze
> <(E-Mail Removed)> wrote:
> >On Jul 22, 11:17 pm, "JBarleycorn" <(E-Mail Removed)> wrote:
> >> "James Kanze" <(E-Mail Removed)> wrote in message
> >>news:(E-Mail Removed)...

>
> > [...]
> >Historically, there wasn't a type bool, and a lot of programmers
> >used:
> > typedef int bool;
> >(I wouldn't be surprised if <windows.h> still has a typedef for
> >BOOL. Or maybe a macro.) I don't think that any implementation
> >on a byte addressable machine has ever made it more than a byte.
> >(But since I've never worried about it, I could be wrong.)


> Just for variety, the Windows API has BOOL, which typedefs as an int
> (and is a very old definition in Windows - back to at least Win2.x),
> plus the newer BOOLEAN, which typedefs as a char (byte).


And if I recall correctly, some of the functions which return
BOOL return 1, 0 or -1 (yes, no or maybe? true, false, or I
don't know?).

--
James Kanze
 
Reply With Quote
 
 
 
 
James Kanze
Guest
Posts: n/a
 
      07-30-2011
On Jul 25, 5:49 am, "JBarleycorn" <(E-Mail Removed)> wrote:
> James Kanze wrote:
> > On Jul 22, 11:17 pm, "JBarleycorn" <(E-Mail Removed)> wrote:
> >> "James Kanze" <(E-Mail Removed)> wrote in message
> >>news:(E-Mail Removed)...


> > [...]
> >>> Who does? In over thirty years of experience in C and C++, I've
> >>> yet to see any application which uses such a header. I'm
> >>> tempted to say that someone who uses such a header doesn't
> >>> understand the basic philosophy behind C and C++.


> >> Now we're getting somewhere! You saying that you code against a
> >> *"philosophical"* paradigm.


> > I'm saying that I use data abstraction, as a tool to manage
> > complexity.


> No, you did not say that.


I said enough that any competent programmer would have
understood it that way.

> >> The word "religion" will surface soon, I'm
> >> sure. Then you can say that my designs are unholy and yours are holy
> >> and then the congregation you belong to will ... something.


> > There's no religion about it


> scuuze me, "philosophy", as you put it then.


It's neither philosophy nor religion. It's effective, pragmatic
programming,

> > : the higher the level of
> > abstraction,


> Whoa, what would a C programmer like you know about that?


I'm a professional, that's all. Regardless of the language I
use (and I haven't used C in over 20 years), I write code
professionally. And you can obtain a pretty high level of
abstraction in C (even if a lot of programmers don't).

One of the first levels of abstraction is ignoring the number of
bits in an int.

[...]
> > the more efficient the programmer. Given a good
> > compiler (something rare),


> > Against higher levels of abstraction: it's often
> > more work (defining a class, where just using int will do), and
> > some particular interfaces (including most serialization) are
> > defined in terms of a low level of abstraction.


> Don't argue my point! (I mean if you want to win!).


Who cares about "winning"? I'm interesting in communicating and
understanding. And in an honest presentation of the facts.

[...]
> >>> Sure there is: signed char, short, int and long are all similar
> >>> types, with potentially different widths. (Don't ask me why
> >>> bool is a signed integral type, rather than an unsigned one.)


> >> Like I *said*: there is no *similar* type.


> > Except all signed integral types.


> Don't mock me. I *said*, there is no similar type.


I know what you said. And you're wrong. (If you were honest,
you'd admit it, but that seems to be asking too much.)

> > [...]

> And here I am "whining" about broken bool! But wait, it's just as bad!
> bool is like throwing a dog a bone, you know he wants the steak, but
> he'll knaw on that bone for...


I like the image. In a lot of ways, C++ is just a bone.
The problem is that there isn't any steak, and in most cases,
the other languages I've seen are empty dishes. Or as I usually
put it: C++ is about the worst language you can imagine. Except
for all of the others.

> well, till it's gone! (Good think she has
> the umbrella now, cuz that "safety doposite box" is surely just worth of,
> deposits!


> > (I wouldn't be surprised if <windows.h> still has a typedef for
> > BOOL. Or maybe a macro.)


> "To be honest", I am surprised you don't know that.


Why should I? I know that at one point in time, they did, but
it doesn't seem relevant today. I do a lot of Windows
programming, and I've never used it.

--
James Kanze
 
Reply With Quote
 
Alf P. Steinbach
Guest
Posts: n/a
 
      07-31-2011
On 30.07.2011 20:22, James Kanze wrote:
> On Jul 24, 6:40 pm, Robert Wessel<(E-Mail Removed)> wrote:
>> On Sun, 24 Jul 2011 03:48:08 -0700 (PDT), James Kanze
>> <(E-Mail Removed)> wrote:
>>> On Jul 22, 11:17 pm, "JBarleycorn"<(E-Mail Removed)> wrote:
>>>> "James Kanze"<(E-Mail Removed)> wrote in message
>>>> news:(E-Mail Removed)...

>>
>>> [...]
>>> Historically, there wasn't a type bool, and a lot of programmers
>>> used:
>>> typedef int bool;
>>> (I wouldn't be surprised if<windows.h> still has a typedef for
>>> BOOL. Or maybe a macro.) I don't think that any implementation
>>> on a byte addressable machine has ever made it more than a byte.
>>> (But since I've never worried about it, I could be wrong.)

>
>> Just for variety, the Windows API has BOOL, which typedefs as an int
>> (and is a very old definition in Windows - back to at least Win2.x),
>> plus the newer BOOLEAN, which typedefs as a char (byte).

>
> And if I recall correctly, some of the functions which return
> BOOL return 1, 0 or -1 (yes, no or maybe? true, false, or I
> don't know?).


BOOL was used as an allround x != 0 boolean type, yes, in particular as
result of dialog proc.

It's one of the reasons that writing x == true is a very bad habit.

Then there was/is VARIANT_BOOL, where true is -1. It's for the script
language interface, which was originally the Visual Basic interface.

Cheers,

- Alf
 
Reply With Quote
 
JBarleycorn
Guest
Posts: n/a
 
      07-31-2011
Ian Collins wrote:
> On 07/22/11 04:07 PM, JBarleycorn wrote:
>> Ian Collins wrote:
>>>
>>> I assume you won't give a real world example why bool is "broken"
>>> because you don't have one.

>>
>> That you wrote that and keep asking that shows you don't know what
>> the discussion is all about. I refer you to read the other posts.

>
> I keep asking because you keep making unsubstantiated claims. Time to
> put up.


Sounded like a demand. Hmm?


 
Reply With Quote
 
JBarleycorn
Guest
Posts: n/a
 
      07-31-2011
James Kanze wrote:
> On Jul 25, 5:49 am, "JBarleycorn" <(E-Mail Removed)> wrote:
>> James Kanze wrote:
>>> On Jul 22, 11:17 pm, "JBarleycorn" <(E-Mail Removed)> wrote:
>>>> "James Kanze" <(E-Mail Removed)> wrote in message
>>>> news:(E-Mail Removed)...

>
>>> [...]
>>>>> Who does? In over thirty years of experience in C and C++, I've
>>>>> yet to see any application which uses such a header. I'm
>>>>> tempted to say that someone who uses such a header doesn't
>>>>> understand the basic philosophy behind C and C++.

>
>>>> Now we're getting somewhere! You saying that you code against a
>>>> *"philosophical"* paradigm.

>
>>> I'm saying that I use data abstraction, as a tool to manage
>>> complexity.

>
>> No, you did not say that.

>
> I said enough that any competent programmer would have
> understood it that way.


You are HOW old and still trying to instigate ****ing contests? Ha! You
weren't doing that, huh, you were spewing your propaganda. I got your
"competant programmer", "right here, asshat".

>
>>>> The word "religion" will surface soon, I'm
>>>> sure. Then you can say that my designs are unholy and yours are
>>>> holy and then the congregation you belong to will ... something.

>
>>> There's no religion about it

>
>> scuuze me, "philosophy", as you put it then.

>
> It's neither philosophy nor religion. It's effective, pragmatic
> programming,


"Hello". Apparently, you don't know which way is up. Enlighten us all: Is
it a philosophy by which you propose ... WTF are you doing? Do you WANT
something? What do you want?

>
>>>> the higher the level of
>>> abstraction,

>
>> Whoa, what would a C programmer like you know about that?

>
> I'm a professional


A professional WHAT?

> , that's all.


"that's all" = weasel words.

> Regardless of the language I
> use


Yeah, regardless of "the language I use", that is good, but good for you
and not so much for me, and certainly a key exploitation of task roles.

> (and I haven't used C in over 20 years)


How much of a lie ist that? Did you know C before C++ became about? You
simply CANNOT be JUST a C++ programmer if you knew C prior. So if you
did, I'm calling you "a liar".

> , I write code
> professionally.


I believe that. It's a good job for you, and has been. I'm not knockin'
it in the least. "You go girl!".

> And you can obtain a pretty high level of
> abstraction in C (even if a lot of programmers don't).


It's irrelevant... you are rambling.

>
> One of the first levels of abstraction is ignoring the number of
> bits in an int.


So you are having a hard time with enlightenment. Don't give it another
thought. You did good: you milked it for all it was worth as a blind
follower, and you got things done. Someone has got to do the work, and
you're good at it, right? If you didn't like digging the hole all the
time you were digging it, it's not my problem, don't make it so. Don't
become an imposer/oppressor just because your candle is about to
flameout. You didn't do bad before (professionally, or maybe...
nevermind), so don't start doing (really?) bad now.

>
> [...]
>>> the more efficient the programmer. Given a good
>>> compiler (something rare),

>
>>> Against higher levels of abstraction: it's often
>>> more work (defining a class, where just using int will do), and
>>> some particular interfaces (including most serialization) are
>>> defined in terms of a low level of abstraction.

>
>> Don't argue my point! (I mean if you want to win!).

>
> Who cares about "winning"?


You do.

> I'm interesting in communicating and
> understanding.


No you're not. You just got a drift of my line of thinking and trying to
recover from your blatant hypocrysy. ( ) )

> And in an honest presentation of the facts.


You ARE "a programmer", that's for sure. It's all black or white huh. You
and Patricia in the Java NG seem to have not found each other. (I mean,
if you believe that like people attract each other).

>
> [...]
>>>>> Sure there is: signed char, short, int and long are all similar
>>>>> types, with potentially different widths. (Don't ask me why
>>>>> bool is a signed integral type, rather than an unsigned one.)

>
>>>> Like I *said*: there is no *similar* type.

>
>>> Except all signed integral types.

>
>> Don't mock me. I *said*, there is no similar type.

>
> I know what you said.


No you don't.

> And you're wrong.


No I'm not. And it's an easy construct. 1st grade. I would "call you"
"paradigmically blind", but I don't understand people who act smart, but
aren't. I'm not saying there isn't value in that. I just want to
understand it.

> (If you were honest,
> you'd admit it, but that seems to be asking too much.)


I am honest, that's why you can't win. I mean why you can't win here. You
will win. Because you have more ICBMs. It's not like I don't get it/you.
But it's not that I'm here just observing you "tards".... <more thoughts,
but out of fuel>.

(I'm NOT picking on you. I wouldn't do that. Do you know why?).

>
>>> [...]

>> And here I am "whining" about broken bool! But wait, it's just as
>> bad! bool is like throwing a dog a bone, you know he wants the
>> steak, but he'll knaw on that bone for...

>
> I like the image.


"I have my moments".

> In a lot of ways, C++ is just a bone.


Oh shut up and go milk it. (enjoy).

> The problem is that there isn't any steak, and in most cases,
> the other languages I've seen are empty dishes. Or as I usually
> put it: C++ is about the worst language you can imagine. Except
> for all of the others.


So it's MY fault now?!

>
>> well, till it's gone! (Good think she has
>> the umbrella now, cuz that "safety doposite box" is surely just
>> worth of, deposits!

>
>>> (I wouldn't be surprised if <windows.h> still has a typedef for
>>> BOOL. Or maybe a macro.)

>
>> "To be honest", I am surprised you don't know that.

>
> Why should I? I know that at one point in time, they did, but
> it doesn't seem relevant today. I do a lot of Windows
> programming, and I've never used it.


I remember you when you were just a SPARC. "You have come a long way
grasshopper".


 
Reply With Quote
 
Ian Collins
Guest
Posts: n/a
 
      07-31-2011
On 07/31/11 05:52 PM, JBarleycorn wrote:
> Ian Collins wrote:
>> On 07/22/11 04:07 PM, JBarleycorn wrote:
>>> Ian Collins wrote:
>>>>
>>>> I assume you won't give a real world example why bool is "broken"
>>>> because you don't have one.
>>>
>>> That you wrote that and keep asking that shows you don't know what
>>> the discussion is all about. I refer you to read the other posts.

>>
>> I keep asking because you keep making unsubstantiated claims. Time to
>> put up.

>
> Sounded like a demand. Hmm?


Looks like a troll who changes his address...

--
Ian Collins
 
Reply With Quote
 
JBarleycorn
Guest
Posts: n/a
 
      07-31-2011
Ian Collins wrote:
> On 07/31/11 05:52 PM, JBarleycorn wrote:
>> Ian Collins wrote:
>>> On 07/22/11 04:07 PM, JBarleycorn wrote:
>>>> Ian Collins wrote:
>>>>>
>>>>> I assume you won't give a real world example why bool is "broken"
>>>>> because you don't have one.
>>>>
>>>> That you wrote that and keep asking that shows you don't know what
>>>> the discussion is all about. I refer you to read the other posts.
>>>
>>> I keep asking because you keep making unsubstantiated claims. Time
>>> to put up.

>>
>> Sounded like a demand. Hmm?

>
> Looks like a troll who changes his address...


Said the punk? You wanna fight me, you better have a ****ing reason to,
You talkin' to me, punk?


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Preferred Size, Minimum Size, Size Jason Cavett Java 5 05-25-2008 08:32 AM
mega pixels, file size, image size, and print size - Adobe Evangelists Frank ess Digital Photography 0 11-14-2006 05:08 PM
Need standard function to do (Bool and Vector) Weng Tianxiang VHDL 2 06-21-2005 12:01 AM
Re: Convert DataRow content to bool Eliyahu Goldin ASP .Net 0 07-07-2003 01:32 PM
Re: Convert DataRow content to bool Ignacio Machin ASP .Net 0 07-07-2003 12:16 PM



Advertisments