Integer conversions too pedantic in 64-bit

spir denis.spir at gmail.com
Tue Feb 15 06:26:21 PST 2011


On 02/15/2011 02:36 PM, Steven Schveighoffer wrote:
> On Mon, 14 Feb 2011 20:58:17 -0500, Nick Sabalausky <a at a.a> wrote:
>
>> "Jonathan M Davis" <jmdavisProg at gmx.com> wrote in message
>> news:mailman.1650.1297733226.4748.digitalmars-d at puremagic.com...
>>> On Monday, February 14, 2011 17:06:43 spir wrote:
>>>>
>>>> Rename size-t, or rather introduce a meaningful standard alias? (would
>>>> vote
>>>> for Natural)
>>>
>>> Why? size_t is what's used in C++. It's well known and what lots of
>>> programmers
>>> would expect What would you gain by renaming it?
>>>
>>
>> Although I fully realize how much this sounds like making a big deal out of
>> nothing, to me, using "size_t" has always felt really clumsy and awkward. I
>> think it's partly because of using an underscore in such an otherwise short
>> identifier, and partly because I've been aware of size_t for years and still
>> don't have the slightest clue WTF that "t" means. Something like "wordsize"
>> would make a lot more sense and frankly feel much nicer.
>>
>> And, of course, there's a lot of well-known things in C++ that D
>> deliberately destroys. D is a different language, it may as well do things
>> better.
>
> Hey, bikeshedders, I found this cool easter-egg feature in D! It's called
> alias! Don't like the name of something? Well you can change it!
>
> alias size_t wordsize;
>
> Now, you can use wordsize instead of size_t in your code, and the compiler
> doesn't care! (in fact, that's all size_t is anyways *hint hint*)

Sure, but it's not the point of this one bikeshedding thread. If you do that, 
then you're the only one who knows what "wordsize" means. Good, maybe, for 
app-specific semantic notions (alias Employee[] Staff;); certainly not for 
types at the highest degree of general purpose like size_t. We need a standard 
alias.

Denis
-- 
_________________
vita es estrany
spir.wikidot.com



More information about the Digitalmars-d mailing list