<unlurk> Hmm, I did NOT post the stuff below even though my name is showing up as the poster... I think I'll have a chat with Scott (I know the founders of eGroups).
I can't wait to see that Self running on Linux though!
Best, Kyle </unlurk>
Original Article: http://www.egroups.com/list/self-interest/?start=84
9901251236.aa150658-@ix wrote: Original Article: http://www.egroups.com/list/self-interest/?start=83
For an excellent example of what can happen if you don't have optional parameters in a language, take a look at the Java's GridBagConstraints object. Its a total mess. To set the constraints on an object you have about 4-6 lines of code per Component of a window- it should have been a single line. That's bound to negatively impact reliability- there's just loads more things that can go wrong.
Shouldn't interfaces be built with GUIs?
I personally haven't had much experience with those- I can see that they may well give much better performance.
Take a look at TCL also- buttons take a single line to create... it takes 3x more code in Java. Self is closer to Java in this respect.
Why not clone an existing Button and modify it?
Do you have any data to show that this is quicker? There is data that shows that TCL is 2-3x quicker to write for many applications than say Java, but no quicker/slower for others. It also shows that Java is about 3x quicker than C++ for a lot of things...
(My personal experience seemed to show that Self is slower than Java to write in for me. Perhaps that's me.)
BTW, I've been using python, which has optional named parameters with defaults and I've yet to see it used for any good purpose. Mostly people use them to make huge initializers (which I, and the writers of _Writing Smalltalk with Style_ think is poor coding practice).
Maybe. However I am reminded of the sole British competitor at a winter Olympics in ski jumping 'Eddie the eagle', who inspite of 'terrible style' jumped further than some with good style- inspite of rather significant lack of practice/skill. (His skis were at about 60 degrees to each other, whereas other competitors kept them together.)
The judges marked him down rather severely- and he came last but one. There was also talk of him not being suitable material for entering the competition in the first place.
However the next Olympics the winners adopted his style- due to its aerodynamic advantages...
I do think handling variable arguments is important for certain kinds of applications though, like implementing proxies.
Yeah. Look at any Unix/Dos command. Ask yourself how you would implement such a command in Self/Java/C++/C etc. with only fixed parameters. Then ask yourself 'would I have to check the documentation to use this command' then add 3 minutes to your coding for each such call.
Lua has a more elegant way of dealing with these than python.
------------------------------------------------------------------------ eGroup home: http://www.eGroups.com/list/self-interest Free Web-based e-mail groups by eGroups.com