As far as I understand a type is global. Wouldn't this become a problem when using tens of libraries from other ppl, and even in big projects of your own?
Often enough I see solutions here where a lot of types are involved, even for simple things. A typical example is a type like:
TColor (with r,g,b fields)
All nice 'n stuff, but what if something creates a type like this in his own lib/include which I'm using, while *I* otoh already have a TColor with different fields/methods? (one could store RGB values from 0..255, and one could store them as floats or doubles from 0.0 .. 1.0)
If you create some unique specialist type wich such a unique name that you can safely assume there won't be another one (soon) then I can see little harm. It's different however when people start creating types that are so fundamental and generic, like TColor, TPixel, TSprite, TParticle, etc. Then interference is only a matter of time. It's almost like abducting reserved keywords.. :P
So, am I seeing things wrong here or what? :-)
Often enough I see solutions here where a lot of types are involved, even for simple things. A typical example is a type like:
TColor (with r,g,b fields)
All nice 'n stuff, but what if something creates a type like this in his own lib/include which I'm using, while *I* otoh already have a TColor with different fields/methods? (one could store RGB values from 0..255, and one could store them as floats or doubles from 0.0 .. 1.0)
If you create some unique specialist type wich such a unique name that you can safely assume there won't be another one (soon) then I can see little harm. It's different however when people start creating types that are so fundamental and generic, like TColor, TPixel, TSprite, TParticle, etc. Then interference is only a matter of time. It's almost like abducting reserved keywords.. :P
So, am I seeing things wrong here or what? :-)