Thread: Design of STL was RE: [GD-General] Eiffel
Brought to you by:
vexxed72
From: Brian H. <bri...@py...> - 2001-12-24 19:01:33
|
> Behalf Of Kent Quirk > > I *really* have to disagree here. > > The DESIGN of the STL is absolutely gorgeous. I didn't mean to comment on STL's design, only the practical implications involved with its implementation (both in terms of choice of language and the actual implementations such as Microsoft's). A paper on genericity in C++ vs. Eiffel: http://www.elj.com/eiffel/ij/templates/ > variable names, etc. But I have found that idiomatic use of > the STL drastically reduces both the amount of code I have to > write and the number of errors I make in that code. Compared to writing that code yourself, or not using those data structures at all, or what? When I started using STL I decided I liked it simply because all too often when I was in a hurry I would do stupid things like linear searches instead of taking the time to dig up a proper class that did binary searches or whatever. So I thought STL was cool simply because it forced me to use appropriate algorithms when I was too lazy to implement them ("I'll fix it later"). But now that I've written my own, I find I'm much happier with own implementation instead of using STL's. > One of my frustrations with Java is the lack of ability to > write anything like the STL in it. It's a frustration because > I otherwise like it a great deal. I'm coming back around to liking Java. Since it lacks true generic programming, it uses a SmallTalk/Obj-C style of container where casting is required. However, this is not fundamentally a bad thing unless you're religious about static type checking (in which case, Eiffel seems to be a better philosophical match than C++). I happen to like Obj-C and Java's introspection mechanisms since you can code a lot of very powerful stuff without forcing it all to be generated at compile time. You can also change your generic code WITHOUT FORCING A RECOMPILE OF ALL CLIENTS. This is just, well, huge, in my book. I don't want to export my code to everyone that is using my class libraries; and I sure don't want them to have to recompile just because some implementation detail has changed. Brian |
From: Patrick M D. <pa...@wa...> - 2001-12-24 19:49:30
|
On Mon, 24 Dec 2001, Brian Hook wrote: > I'm coming back around to liking Java. Since it lacks true generic > programming, it uses a SmallTalk/Obj-C style of container where casting > is required. However, this is not fundamentally a bad thing unless > you're religious about static type checking (in which case, Eiffel seems > to be a better philosophical match than C++). You don't need full genericity to support container classes without casting. Parametric polymorphism is sufficient for that. It's relatively easy to implement and does not suffer from any code bloat. There are a number of proposed extensions to Java that include this style of polymorphism. From what I understand, there are plans to add this add at some point. I'd also like to claim that type checking isn't a religious issue - formalizing type disciplines is the best promising method to achieve a higher level of software correctness. Some key issues when analyzing a type system are: Generality - are meaningful programs rejected? Accuracy - what kind of properties can be described? Decidability - is it possible to determine if an expression is well-typed? Brevity - how much information must be provided by the programmer? how much can be inferred by the compiler? Elegance - how easy is the system to understand? is adequate feedback given in case of a type error? Efficiency - how much time is spent analyzing types? (note that this list comes from some course notes by Frank Pfenning - likely to appear in a book he is working on called Computation and Deduction). Java's container classes support generality, but are weak in accuracy, decidability, brevity, elegance, and efficiency. I agree that this doesn't make it fundamentally a bad feature, but we can certainly hope to do better. Patrick |
From: Tom S. <tsp...@mo...> - 2001-12-24 22:50:22
|
> But now that I've written my own, I find I'm much happier > with own implementation instead of using STL's. This may work well in smaller environments, but when you have to work in larger teams having a standard that is well documented is absolutely necessary. Do you want to teach new hires your custom collections classes or do you simply look for programmers with experience with STL? To me it's about being more productive in order to make a better games... not building technology because you don't like underscores. =) Not that it is the case here, but it's an all too common thing. Tom ----- Original Message ----- From: "Brian Hook" <bri...@py...> To: <gam...@li...> Sent: Monday, December 24, 2001 1:01 PM Subject: Design of STL was RE: [GD-General] Eiffel > > Behalf Of Kent Quirk > > > > I *really* have to disagree here. > > > > The DESIGN of the STL is absolutely gorgeous. > > I didn't mean to comment on STL's design, only the practical > implications involved with its implementation (both in terms of choice > of language and the actual implementations such as Microsoft's). > > A paper on genericity in C++ vs. Eiffel: > > http://www.elj.com/eiffel/ij/templates/ > > > variable names, etc. But I have found that idiomatic use of > > the STL drastically reduces both the amount of code I have to > > write and the number of errors I make in that code. > > Compared to writing that code yourself, or not using those data > structures at all, or what? > > When I started using STL I decided I liked it simply because all too > often when I was in a hurry I would do stupid things like linear > searches instead of taking the time to dig up a proper class that did > binary searches or whatever. So I thought STL was cool simply because > it forced me to use appropriate algorithms when I was too lazy to > implement them ("I'll fix it later"). But now that I've written my own, > I find I'm much happier with own implementation instead of using STL's. > > > One of my frustrations with Java is the lack of ability to > > write anything like the STL in it. It's a frustration because > > I otherwise like it a great deal. > > I'm coming back around to liking Java. Since it lacks true generic > programming, it uses a SmallTalk/Obj-C style of container where casting > is required. However, this is not fundamentally a bad thing unless > you're religious about static type checking (in which case, Eiffel seems > to be a better philosophical match than C++). I happen to like Obj-C > and Java's introspection mechanisms since you can code a lot of very > powerful stuff without forcing it all to be generated at compile time. > You can also change your generic code WITHOUT FORCING A RECOMPILE OF ALL > CLIENTS. This is just, well, huge, in my book. I don't want to export > my code to everyone that is using my class libraries; and I sure don't > want them to have to recompile just because some implementation detail > has changed. > > Brian > > > > _______________________________________________ > Gamedevlists-general mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-general |