class declaration shortcut

MonkeeSage MonkeeSage at
Sat Mar 3 01:17:47 CET 2007

On Mar 2, 5:48 pm, "Luis M. González" <luis... at> wrote:
> Thanks for your detailed reply!
> So after all, the code is not a fair comparison.
> Because the c# code shows a class definition, and the ruby code shows
> a struct definition, which is not equivalent to a class.
> Is that right?

Well c sharp has a struct type, but it's basically just a class, so in
that sense the comparison is accurate. But I don't think the ruby code
is supposed to be a one to one comparison (you could write a similar
Struct class in c sharp too). I assume that what the author there was
trying to say was that ruby is a higher-level language / has more
syntactic sugar than c sharp many times. The same can be said of
python as well, though python is a bit more reserved about adding
sugar (ruby is more aligned with perl in TMTOWTDI, python is more like
"There should be one -- and preferably only one -- obvious way to do


More information about the Python-list mailing list