Phobos examples and auto

Tobias Pankrath tobias at pankrath.net
Tue Nov 8 10:43:43 PST 2011


Jonathan M Davis wrote:

> On Tuesday, November 08, 2011 17:25:57 Marco Leise wrote:
>> After some hacking into the keyboard layout file, I now use the alias ℕ
>> (the mathematical symbol for the non-negative integral number) everywhere
>> instead of the ugly size_t. It is even shorter than 'auto'.
>> 
>> ℕ i = 5;
>> ℕ j = i;
>> ℕ k = j;
>> ℕ l = k;
>> 
>> ;)
No need for hacking, if you use www.neo-layout.org. I've learned it last 
year. Biggest improvement of my human-computer interface for years.

> but that's really bad practice 
> if you intend anyone else to ever read your code. If it's just for you, 
then you obviously can do whatever you want, but size_t is the correct name 
> and  what others are going to expect if they ever read your code.

Only because it's an alias for an build-in type, that is unnecessary. You 
could say the same thing about every other typedef. The reason, why this is 
bad practice is, that almost no one can easily write that type with a QWERTY
keyboard.




More information about the Digitalmars-d mailing list