cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: s/bool/int

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 25 May 2010 22:49:42 +0200 (CEST)

On Tue, 25 May 2010, Kamil Dudka wrote:

> I would contend it's a good step to avoid further problems. I see it more
> likely as insensitive decreasing of type safety.

It isn't really doing its job at keeping type safety now. I believe the
fnmatch mistake showed that very clearly. It rather misleads us to think so.

I can see only one purpose of using 'bool' as we do in the code, and that is
to make it visible in the code that the variable is intended to only hold TRUE
or FALSE. Making such a variable 'int' makes it less clear.

However, using 'bool' as a variable type may also easily trick readers into
believing that it only can be 1 or 0, while in fact it can hold a lot of other
values as well.

This discussion made me start to think if there's instead maybe some middle
ground to aim for. I'm pausing the replacement for now at least, for further
thoughts and debating.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2010-05-25