[Insight-developers] Why is m_NumberOfThreads signed?
Luis Ibanez
luis.ibanez at kitware.com
Tue May 17 10:24:19 EDT 2011
David,
Maintenance is 80% of the cost of software development.
The fact that in order to change the type used for
representing "the number of threads", you have to go
through a couple of hundred files, is an indication that
early on we made the mistake of not introducing a type
to represent this abstraction.
If we have done our job right early on, your fix should
have only required to modify *one* line of code.
The painful fix of 64 bits integers that we did recently
is an illustration of what happens when we use "implicit"
abstractions, instead of taking advantage of simple
mechanisms available in C++, such as a "typedef".
I'll fix the patch,
When using Vim, there is no fear :-)
Luis
----------------------------
On Tue, May 17, 2011 at 7:31 AM, David Doria <daviddoria at gmail.com> wrote:
> On Mon, May 16, 2011 at 9:48 PM, Luis Ibanez <luis.ibanez at kitware.com>
> wrote:
>>
>> David
>>
>> May I humbly suggest that we use a typedef for it ?
>>
>> and then use that typedef in the proper places...
>>
>> It could be something like
>>
>> typedef unsigned int ThreadIdType;
>>
>> up in itkIntTypes.h for example...
>>
>>
>> Luis
>
> I don't understand why? It should always be unsigned int, right?
>
> Also, it was quite a chore to go through all of those files and I'm not sure
> I would like to do it again...
>
> David
>
More information about the Insight-developers
mailing list