problem with size_t and an easy solution

Ivan Kazmenko via Digitalmars-d digitalmars-d at puremagic.com
Mon Dec 8 07:39:53 PST 2014


On Monday, 8 December 2014 at 14:31:50 UTC, ketmar via 
Digitalmars-d wrote:
> On Mon, 08 Dec 2014 13:49:30 +0000
> Ivan Kazmenko via Digitalmars-d <digitalmars-d at puremagic.com> 
> wrote:
>> Personally, when I face the need for a size_t, I usually can 
>> (and do) use auto instead.  And even if I have to spell it, I 
>> don't care too much how it's called, only whether it can be 
>> easily recognized.
> i bet that "woobooAAARGH" will be even easier to recognize than
> "size_t". as there is no other types in D with "_t" suffix, you 
> have to
> remember that anyway, so it doesn't really matter which one to 
> remember. ;-)

Now that you say it, indeed the code won't be fancy if it goes 
like
     woobooAAARGH len = name.length;
I'll go with an auto here, or yet another type alias.

Perhaps I don't have strong feelings against size_t because I 
like old_c_style_variable_names more than theNewShinyCamelCase.  
It's just a personal preference.


More information about the Digitalmars-d mailing list