merits of Lisp vs Python
Alex Mizrahi
udodenko at users.sourceforge.net
Sat Dec 9 05:06:38 EST 2006
(message (Hello 'Steven)
(you :wrote :on '(Sat, 09 Dec 2006 20:02:06 +1100))
(
SD> It is a good thing that when Fred decides to stop contributing to an
SD> open source project (or leave the company), other people can read his
SD> code without having to learn his Uber-Special Custom Macro Extended
SD> Language. Even if Fred's USCMEL ran 35% faster (and thus saved an
SD> entire four seconds on an average run with typical data!) the five or
SD> six weeks of reduced programmer productivity when somebody else has to
SD> maintain his code outweighs that.
have you ever faced this problem?
it's not a problem at all.
and it's possible to write unmaintanable code in any langauge. for example,
Bram Cohen's BitTorrent (written in Python)
has a constructors with 21 positional parameters
class Rerequester:
def __init__(self, url, interval, sched, howmany, minpeers,
connect, externalsched, amount_left, up, down,
port, ip, myid, infohash, timeout, errorfunc, maxpeers,
doneflag,
upratefunc, downratefunc, ever_got_incoming):
and here's how it called:
rerequest = Rerequester(response['announce'],
config['rerequest_interval'],
rawserver.add_task, connecter.how_many_connections,
config['min_peers'], encoder.start_connection,
rawserver.add_task, storagewrapper.get_amount_left,
upmeasure.get_total, downmeasure.get_total, listen_port,
config['ip'], myid, infohash, config['http_timeout'], errorfunc,
config['max_initiate'], doneflag, upmeasure.get_rate,
downmeasure.get_rate,
encoder.ever_got_incoming)
i think it might be a bit hard to non-autist to remember order of parameters
in such constructor. (and it's not the only one such place in BitTorrent)
and that guy teaches us how to write maintanable code!
http://advogato.org/article/258.html
thus, you don't need macros to write unmaintanable code -- functions are
enough for this. and with macros you can make it more maintanable, actually
)
(With-best-regards '(Alex Mizrahi) :aka 'killer_storm)
"People who lust for the Feel of keys on their fingertips (c) Inity")
More information about the Python-list
mailing list