Writing Bug-Free C/D Code

Sean Kelly sean at f4.ca
Mon Mar 19 22:32:38 PDT 2007


Henning Hasemann wrote:
> 
> Are you really sure it is a good idea to have a typedef for each purpose?

Maybe not a typedef for each purpose, but more generally, a type for 
each concept.  I'm currently reading "Prefactoring" by Ken Pugh and he 
distills it nicely by saying "don't throw away information."  Most data 
have associated constraints, etc, and even if this doesn't seem 
important at the outset, it's far easier to refine an existing type 
later on than it is to try and figure out which instances of 'int' in 
your application represent a person's age, for example.


Sean



More information about the Digitalmars-d mailing list