Standard Library Concerns (Phobos / Tango)

Dan murpsoft at hotmail.com
Thu Feb 7 16:06:23 PST 2008


bearophile Wrote:

> Sebastian Beschke:
> > Which is pretty much the point of OO.

The point of OO is to not know what you're doing?  Maybe that's why I'm so averse.

> 
> I agree, but the lesson here is probably that some people don't understand OO well, or they don't want to use it everywhere, or it doesn't go well with their mindset, or they need to go faster and they want to program in a more C-style, etc. 

It's the mindset, apparently.  I have no preference for syntax.  It's what's inside that counts IMHO, and with OO you have no idea what's inside.

>Java has OOP only, but D allows other kinds of programming too, so maybe it may be better to not have a std lib that is fully OOP, so it can be used when you program differently (like functional-style). Tango doesn't need to be perfect for everyone, but probably there are ways to modify its structure enough to make it look good enough for most people :-)

Agreed, but I'm continuing to use Phobos as long as it's better for me, and at the moment it still is.

> I know very little about Tango still, but I have seen there are lot of people that think some changes may be in order before making it the D std lib :-)
> 
> > If you want to understand something in Tango, you can still read the source code.

Yes, if I want to understand anything in Tango, I need to study.  I already understand Phobos because it's similar to what I already know.

You say that Tango presents better GC and IO?

I couldn't possibly allocate 16 consoles and iterate through them without an undefined number of cache misses - because I can't control where they exist.

I couldn't possibly define classes and use copy-on-write semantics to expand them during runtime; something that was key to my thinking in the Walnut 2.x project.

I couldn't possibly be informed about the memory footprint of my program, or understand how many mispredicted? branches are taken because of the possibly painful multiple-constructor system.  I also cannot partially instantiate an object if I only need part of it for some rare case.

I can keep going on the limitations of OO.

But essentially the point is that unless it's beautiful inside, I don't care how convenient your notation is.  If the insides on which your library is built is "don't look!" then I have trouble believing they're beautiful unless you have a whole slew (like, hundreds) of benchmarks to show me.

Regards,
Dan



More information about the Digitalmars-d mailing list