problem with size_t and an easy solution
ketmar via Digitalmars-d
digitalmars-d at puremagic.com
Mon Dec 8 19:28:51 PST 2014
On Mon, 08 Dec 2014 15:39:53 +0000
Ivan Kazmenko via Digitalmars-d <digitalmars-d at puremagic.com> wrote:
> 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.
that is exactly the feeling `size_t` summons. it's unnatural for D.
> 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.
i used both styles in C, one with underscores for last years. but here
i'm talking about consistency, the thing which D community tends to
ignore. having `uint`, `ulong` and `size_t` is inconsistent. it should
be either `uint_t`, `ulong_t` (and `usize_t` for that matter), or
`uint`, `ulong` and `usize`.
i really don't care if it will be '_t'-suffixed or not, i simply want
it to be consistent.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20141209/61355773/attachment.sig>
More information about the Digitalmars-d
mailing list