Monday, February 18, 2008

 

Self Printing JavaScript Literals

We Eiffel programmers often take a lot for granted, things that other languages just struggle with:

Are you ever sick of seeing Object get printed out when you try to output a variable to your console.

We Eiffel programmers just say:
  object.out
It's that easy.

Friday, February 08, 2008

 

CDD Extension for EiffelStudio

The CDD extension for EiffelStudio is an ETH Zurich project which adds support for unit testing to EiffelStudio 6.1. The current status is "beta 2", and it's released for Linux and Windows. Features include:
Two further features are particularly interesting. Testing can be configured to occur in the background, and is described as "undisruptive to the developer". If an unexpected exception is thrown, a new test case is automatically created to reproduce the exception. Features like these can make the difference between a testing system that is useful as opposed to one that is merely usable.

Tuesday, February 05, 2008

 

Opening black boxes, and Eiffel games

For many years Bertrand Meyer and others have advocated teaching object oriented programming by using objects as "black boxes" then progressively opening up those black boxes to see how they work. This is "inverted" compared to the traditional curriculum which starts with the lowest level of raw constructs and builds progressively more sophisticated constructs from them.

One way to motivate students is to let them design computer games. James McKim was using Eiffel for that in the early 1990s, and the topic regularly came up at the "Eiffel in Education" conferences.

At ETH Zurich, first-year computer science students are combining these ideas, using a high-level Eiffel game library to design games. The library is EiffelMedia, started by Till Bay and developed and maintained by students under his oversight, and now exceeding 500,000 lines of code.

EiffelMedia is comprehensive, covering 2D graphics, text, sound, sprites, collision detection, 3D graphics, networking, high-score tracking, game-oriented widgets, game saving, level management, error reporting and peripheral interfacing.

EiffelMedia, its use, and some of the games developed with it, are described in an article at the Journal of Object Technology: "A production-quality multimedia library and its application to game-based teaching". This code snippet (adapted from that article) shows the high-level use of the sound library:
if audio_subsystem.is_enabled then
audio_subsystem.mixer.open
create player.make_with_file("hello.ogg")
player.set_repeat(true)
player.play
end
EiffelMedia and many of the games written for it (such as AntWorld, shown above) are freely downloadable. EiffelMedia itself won second prize in the 2005 Eiffel Struggle competition. According to the article, the prize money is used for release parties.

This page is powered by Blogger. Isn't yours?