Sunday, April 02, 2006

 

Eiffel and the Paris pavement cafe

Over on the ISE Eiffel mailing list there has been a lively discussion of naming conventions for local variables and formal arguments.

Andrew Lyall moved the discussion on to a linguistic convention for Eiffel comments. His post was so good that I think it deserves a wider audience:

Guys,

As there is so much interest in conventions for variable naming, I wonder if you would be interested in my ideas on a linguistic convention for Eiffel comments.

I an an ardent Francophile; I go to France for my holidays and every other time I can; French cuisine is the best, and who else knows how to make wine and cheese? (BTW, I am a great fan of new-world wines and promote them as hard as I can because it means that if other people drink them, there will be more French wine for me to drink!) To me Eiffel exudes, style, chic, lan, and all those other things that world admires France for. Java and C++ are burgers to Eiffels Boeuf-Bourguignon; they are coca-cola to Eiffels Hermitage!

As a committed acolyte of Eiffel and indeed all things French, I have thought long and hard about how to introduce Eiffel to the wider programming community, although I a am, of course, very aware of the risk of casting pearls before swine! It seems to me that a comment style that emphasizes the essential Gallic nature of Eiffel might be what is required.

It so happens, that, almost certainly because of my interest in all that is French, I am also a great fan of Peter Sellers as Inspector Clouseau, and by diligent study I have taught myself to speak Clouseauese. Now, it seems to me that if the Eiffel community were to adopt Clouseauese as the default `style' for comments it might help to promote Eiffel and the Eiffel method.

Below is a code fragment taken from a real production program of mine, which gives a feel for what I have in mind. I apologize in advance for the crass coding, but would crave your indulgence and instead ask you to concentrate on the comments.

When I read comments like this, I am taken immediately to a Parisian pavement caf on a warm summer evening, with a glass of an humble but well made vintage in my hand and an according playing in the background. Clouseau is sitting the opposite me at the other side of table, his conversation acting as a delightful counter-point to the accordion, but I am not listening to him, instead I am thinking about the menu and what I shall be having supper.

Anyhow, I would be interested to know what you guys think:
is_ok_massage (flag, prompt, default: STRING) is
-- check ze flag and ensure zat ze `elp massage, she is mak-ed

local massage: STRING

do
-- ze flag, make sure, she is not, 'ow you say, h-ambiguous!
if flag /= void then is_flag_unique (flag) end

-- make an 'elp massage and make sure she is sav-ed
create massage.make_empty
if flag /= void then massage.append (Flag_Char.out + Flag) end
if prompt /= void then massage.append (" <" + prompt + ">") end
if default /= void then massage.append (" def=" + default) end
if massage /= void then massage_list.force (massage) end
end -- massage ok ;-)!
All the best

Andrew

Comments: Post a Comment



<< Home

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