Re: [GD-General] Eiffel
Brought to you by:
vexxed72
From: Brian H. <bri...@py...> - 2001-12-23 01:16:48
|
t 04:04 PM 12/22/2001 -0800, Jesse Jones wrote: >I don't think templates stink. The syntax is awkward and there's not >enough support for template meta-programming, but having what amounts to a >separate language at compile time is a very powerful feature that lets C++ >do stuff that Java, C#, and Eiffel can't touch. Oddly enough, after intensely studying programming language design for the past few days (originally sparked by my interest in Eiffel), I'm coming back around to Java as a half-way decent intermediate that's also pseudo-portable (modulo JVM issues). Obj-C still has quite a few features I prefer though. Anyway, back to the point -- how does C++'s templates provide genericity that is better than Eiffel's? After looking at Eiffel, it seems like it supports generic programming in a much more open and friendly fashion and without all the compile time weirdness that C++ jams down our throat. >dynamism in the language. Pascal and Modula-2 were the first real >languages I used so I like the concept of compile-time type checking, but >a dynamic language really can make some important things simpler. This is another aspect of Obj-C I like -- you can have typed or untyped variables. If you send a message to an untyped object ("id") the it works as untyped language. But if you send a message to a typed object then it can do a compile time check for you. That you can send any arbitrary message to any arbitrary object is immensely powerful, especially when it comes to prototyping or using distributed objects. No need to even know the interface, you can test an object to see if it can handle a message, and if it can, send it on through. This is what makes delegation so practical in Obj-C (whereas to achieve the same effect in C++ you have to use MI). >Right now I think a language like Dylan where you can have both types and >untyped variables is the way to go, but perhaps I'll change my mind after >I get more experience with Ruby. My biggest concern with Ruby right now is performance. Looking at the benchmarkst at the GCLS, it looks like Ruby is pretty far behind the other languages, including Lua (which I would guess is Ruby's primary competitor -- Python, Ruby and Lua seem to be accomplishing much the same thing). >But the biggest problem with C++ might be that it simply requires too much >time and study to become proficient in the language and aware of all the >pitfalls. I would put this another way: C++ was trying to be idiom-neutral and provide all the tools for any kind of programming style. Because of this, you can become very proficient in one tiny aspect of C++. I feel I know C++ very well for my purposes, but because I purposefully have avoided templates, exception handling, MI and many other things that I consider more problematic than worthwhile, I can't say I "know" C++. In fact, I'm not sure many people can say they know the whole language since the whole language is overkill for any specific framework design. I would even argue that any framework that uses EVERY element of C++ is probably a disaster. Which goes back to my complaints about STL =) Brian |