Eiffel As a Learning Language?
SnowSquirrel asks: "My second year university comp sci class is using Eiffel as the programming language. I won't start the class for a couple of days yet, so I don't know much about the language, other than the fact that I had never heard of it until a month ago. I wouldn't mind some opinions from the relevant masses on whether Eiffel is a good language to use for 2nd year college courses (the 1st year we used Java)."
One of the first languages I learned in College was Logo (on a 512k Mac no less). I haven't used Logo since, but I sure learned a lot about recursion. While my contemporaries were struggling with it in CS I, II, and III, I was wondering why they didn't "get it".
I've read about Eiffel in Bertrand Meyers' book "Object Oriented Software Construction". It's a great book, but I didn't/don't have time to learn Eiffel; I wish I did.
In college I used to whine about having to learn apparently useless things. Having been in the 'real world' for a while I've found that adapability is key. The fundamental principles don't change even though the languages and details do. Sure, right now Java is a hot thing to have on a resume, but quite frankly, you can pick up Java pretty quickly if you understand OO and have programmed in some other OO language. I would rather hire someone who is good at OO and then train them on Java or whatever technology my company happens to be using, rather than have a mediocre Java programmer that doesn't understand OOP.
"But actually trying to use m4 as a general-purpose langage would be deeply perverse" --ESR
Eiffel was one of the "gee, I can do better than Stroustrup" languages of the late 1980s and early 1990s, pretty much contemporary with Objective C. It may have suffered from insisting, before people were ready for it, on automatic memory management (garbage collection).
... there were *so* many languages trying to catch on, and only a very few (C++, Perl, VB, eventually Java) could gather a critical mass. Part marketing, part competition, part survival of the fittest, part pure luck.
Most interesting aspect, to my mind: You can add assertions about the state of an object. (Imagine a complex number in polar notation. The radius is always non-negative, the angle is in a certain range, if the radius is zero than the angle is too, if only by convention.) This is more then assert() from C/C++, since that state must be maintained by *any* publicly visible function. The compiler enforces this.
This in turn supports "programming by contract": insisting that certain conditions must be true in a valid program (e.g., square root function is never passed a negative number), but that as a result, certain other conditions are guaranteed to be satisfied. This isn't automated programming proof (the pipe dream of programming languages in the late 1970s), but it works very well with formal correctness proof (supports the style both at design/code time and run time, instead of claiming testing is irrelevant).
It didn't catch on in a big way, because
Stupid job ads, weird spam, occasional insight at
Yes, I can say that eiffel is a fantastic language for teaching the principles of object-oriented programming.
I've done a lot of C/C++ programming, and a little bit of Java, but I haven't seen a clearer or more well-defined language. (We're studying it as a first year programming subject)
The features offered by Eiffel include:
* clean, english-like code
* promotes documentation of code, through commenting
* promotes standard of design (some Perl programmer would say this is limiting, but it's great for beginners)
* incredibly simple OO approach - even complex ideas like multiple inheritance and generic classes are implemented cleanly.
In short, I'd say Eiffel is the ideal language to teach beginner programmers, since the OO approach is the industry standard. Perhaps it wouldn't be suitable after studying Java, but what you don't learn in Java about the principles of good design, you can learn with Eiffel.
A final note: Based on the two distributions of Eiffel I've tried, there is a marked difference in standard syntax, even for basic I/O. I use SmallEiffel, and have found that the most consistent, and fully-featured.
Good luck!
-- Matt Ryall
There are two essentially different ways of approaching the problem of learning to program.
Philosophy #1 says, "In the ever-changing world of technology, you should leave college knowing all of the most cutting-edge technologies." Programs that emphasize this tend to have courses in specific programming languages and tools, e.g. "Advanced C++".
Philosophy #2 says (I think rightly), "Technology is such a large world and is changing so fast, any languages or tools you learn now will be useful for somewhere between five years and three seconds. What's really important is that students are able to learn and adapt quickly, and solve problems creatively." These programs tend to have much more theoretical curricula, which emphasize extensive and somewhat open-ended projects.
Programs of the #2 ilk take a lot of abuse: "Why do I have to learn this dumb language (Scheme/SML/Eiffel/whatever) that I'll never use?" Such complaints miss the Big Secret of Programming: for all the vast differences in quality and popularity, most languages and software tools are essentially the same, and when you know one, it's easy to pick up another. The best programmers are the ones who can adapt quickly and be creative, not the ones who know the top 10 hottest languages. Smart companies know this, and will be much more impressed with your ability to catch on quickly than your textbook knowledge of their favorite language. It's trite but overwhelmingly true: in programming, ideas are more important than facts, and imagination is more important than knowledge.
If your program is using Eiffel, they're probably leaning toward Philosophy #2. Whether Eiffel is useful to you depends a lot on how you approach the program. If you expect school to be a practice run for your job...forget it! That's what internships are for. If you get excited about the ideas, and constantly look for ways to challenge yourself, bend the assignments around, and just have fun with everything you can get your hands on...well, now you're in business!