What do you think of the D language?

Started by
92 comments, last by daerid 17 years, 6 months ago
Quote:Original post by Paradigm Shifter
Look at FILE* in C, no-one knows or cares about the structure or implementation of them. One of the best examples of object orientated thinking in C.
That has nothing to do with headers. Headers allow you to see interface but not implementation. People don't generally break open stdio.h when they are trying to remember how to use fopen.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
Advertisement
Yeah, that's my point. Headers allow you to see interface rather than implementation... I find languages like C#/Java where everything in a class is in the source more confusing than the FILE* example. No-one ever looks at stdio.h, that's a good thing (TM).

[EDIT: But they do look at the documentation... which is more important than the header files of course. But FILE* is an excellent example of object oriented stuff in C anyway... terminal i/o... files... sockets... memory mapped files... etc. all through same interface]
"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley
Quote:Original post by Paradigm Shifter
Yeah, that's my point. Headers allow you to see interface rather than implementation... I find languages like C#/Java where everything in a class is in the source more confusing than the FILE* example. No-one ever looks at stdio.h, that's a good thing (TM).
I still don't see how that has anything to do with headers. What you're saying only makes sense if people frequently look at stdio.h but not stdio.c (ie the compiler vendor provided backing implementation).
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
Yep I realise my argument is flawed (I have the drunkenness!). But I'd still rather glance at a header to see the core interface and then look at the docs than wade through mountain of implementation details as in a C#/Java class file say. I like the separation between the two, personally.
"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley
Quote:Original post by Paradigm Shifter
Yep I realise my argument is flawed (I have the drunkenness!). But I'd still rather glance at a header to see the core interface and then look at the docs than wade through mountain of implementation details as in a C#/Java class file say. I like the separation between the two, personally.

But why would you start with looking at the header for the core interface? Why isn't that provided directly in the docs?

Even with my own code, I rely on the Code Browswer to tell me how it all works. It could be written across fifteen different files on eight different PCs and it wouldn't matter to me.

Considering the enormous problems the reliance on header files causes with C++, using them as a form of documentation is a pretty poor excuse for keeping them around longer than needed.

CM
In VS2005 at least, you can collapse C# code to definitions so it looks exactly like a c++ header, only without the compilation annoyances and logistical hooplah.
OK I concede the point. Documentation is more important and I have been annoyed in the past by having to maintain comments and such between headers and code files.

But if there's no documentation then the first place I look is in the header file, and go from there.
"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley
If you're still not convinced, here's a simple thing you can do. Open the std::map header (that's <map>) and read it to figure out its interface. (Yes, I recognize this is a C++ flaw rather than an inherent problem with headers.)
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
Nah, I just read the MSDN (or a book) on that one. But in-house it's a different matter.
"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley
I think everyone needs a hug++
Allways question authority......unless you're on GameDev.net, then it will hurt your rating very badly so just shut the fuck up.

This topic is closed to new replies.

Advertisement