x.sizeof vs typeid(x)

bearophile bearophileHUGS at lycos.com
Fri Feb 8 08:21:41 PST 2008


Tomasz Stachowiak:
>You've also stated that the programmer doesn't have to understand what's going on inside a standard lib (as long as it reads well and is consistent across its span).<

I think all I have said was "I agree" :-) So I can explain a bit better.

I like to understand what's inside the std lib, because I think that if you want to use a system well, you have to know something about the layer just below the one you are using (C if you use Python, assembly/CPU if you use C, the GC and the std Lib and the assembly/CPU if you use D, etc). I have found problems in using D (to built some collection data structures) because I have yet to understand how the heck the Phobos GC actually behaves.

Some kinds of languages (and their communities) like Java think that having opaque objects is better. Other languages like Python think that's not always a good thing, and the usual coding style is different. I think both views of the situation have their merits and disadvantages, I like both styles, and I think they are fit for the languages they are used in, and the typical situations they are used in. If you want I can offer more details.

Bye,
bearophile



More information about the Digitalmars-d mailing list