Wither Self (shortish)

Taavi Talvik <>
Thu Sep 11 14:23:42 CEST 2003


On Wed, 10 Sep 2003, Chris Pressey wrote:

> The first issue is that I am very strongly against short (cryptic!)
> names.  (I suppose that might make me a minority in Erlang circles, but
> after working on certain legacy source code with variables with names
> like O1I1K in it, no amount of peer pressure could make me reconsider my
> stance :)  So instead of
>
>   h(X, Y, A, B, C)
>
> I would have something more like
>
>   button_pressed(Button, Window, CList, ProgressBar, FileOptions)
>
> That's bad enough; but the second issue is that, every time I have to
> pass another parameter or a different parameter to the callback, I would
> have to change the parameter list in *two* places in the source,
> compared to zero with just the fun.

What about:

	button_pressed(button_ID, [ListOfEventOptions], [ListOfUserParameters])

	where
	ListOfEventOptions = [{parent_window, WinId}, {key,value},...]
	ListOfUserParameters = [{key,value},...]

this does not work for legacy code, but for general framework it is clear
win.

best regards,
taavi




More information about the erlang-questions mailing list