D Ranges

Jonathan M Davis jmdavisProg at gmx.com
Fri Sep 13 19:49:23 PDT 2013


On Saturday, September 14, 2013 04:10:09 Jesse Phillips wrote:
> Anyway, my recommendation isn't to build up a class structure
> just because that is what you would do in another language.
> Figure out if the usability provided by inheritance is what you
> want, if not struct with helper functions seems to be simplest in
> development and maintenance. Destroy.

I find that I use classes very rarely in D. Once in a while, I need 
polymorphism, and in that situation, I use classes, but at least in the types 
of programs that I've usually been writing, polymorphism has rarely made much 
sense. Structs deal with most everything just fine.

Classes definitely have their uses, but IMHO, they should not be the first tool 
to pull out of your toolbox when writing a D program. Just use them when you 
actually need them.

- Jonathan M Davis


More information about the Digitalmars-d mailing list