From: Fergal Daly (fergal at domain esatclear.ie)
Date: Mon 14 Feb 2000 - 20:53:13 GMT
At 09:55 14/02/00 +0000, John McCormac wrote:
>"John P. Looney" wrote:
>>
>> On Sat, Feb 12, 2000 at 01:27:27AM +0000, Fergal Daly mentioned:
>> > use IO::Socket;
>> >
>> > $socket = IO::Socket::INET->new(
>> > PeerAddr => "ntp.maths.tcd.ie",
>> > PeerPort => 13,
>> > );
>> >
>> > exec "/usr/bin/date -s ".<$socket>;
>>
>> Meep. I think it shows that TCL really looks prettier.
>
>Yep and it displays more robustness (as in the hacker purity test
>question: programming at n hrs while pissed - did it make sense the next
>morning?) :-)
Nobody asked for pretty! Anyway, I'll take = over puts, gets and set any day.
I love the NAME => VALUE function call syntax, it's becoming more common
for perl modules and in terms of understanding what you were doing in a
drunken stupor last night which would you prefer, a self commenting
function call or something that takes n arguments and gives no hints as to
what order they're meant to be in or what they mean? It also allows you to
leave out stuff and accept the defaults, eg the above defaults to tcp, but
adding Proto => 'udp' makes this a udp socket and so it runs even quicker now.
Of course this applies to a lot more languages than tcl and there are
plenty of perl modules which still doing things the old way too. Programs
would be a lot easier to get right first time and far more readable if this
syntax could be adopted for anything with more than 3 or 4 arguments,
Fergal
This archive was generated by hypermail 2.1.6 : Thu 06 Feb 2003 - 13:05:25 GMT