|
From: Joe N. <3ne...@pr...> - 2000-01-10 16:50:18
|
> 2. Is corelinux based on templates? > I read the blurb on the use of templates. Static type checking is a really > nice feature to have. Yet, if you look at a language like java, where all > classes inherit from a superclass Object, non static type checking has its > benefits.. Ie. the ability to stick almost anything in a hashtable. I see > how this could be resolved using templates and a strict java-like class > heirarchy.. The lack of genericity is a weakness of Java, not a strength. Sticking all kinds of things into a hashtable is a hack and causes all kinds of nightmares. First of all, why would you want to stick lots of unrelated data into a hashtable? That would certainly reflect a poor design decision somewhere in your code. But if the data are related to each other, why aren't they in a class together? If they're in a class, you can store a collection of these classes with templates, thus preserving type safety and more clearly showing yourself and others your coding intentions. --Joe |