[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Article about GNU Guile and GOOPS
From: |
Thompson, David |
Subject: |
Re: Article about GNU Guile and GOOPS |
Date: |
Tue, 4 Mar 2014 09:03:18 -0500 |
On Tue, Mar 4, 2014 at 7:57 AM, Jan Wedekind <address@hidden> wrote:
> Hi,
> I have written a small blog post about object-oriented programming with
> GNU Guile and GOOPS [1]. Having used the Ruby programming language for some
> time, I am quite spoiled when it comes to objects ;)
> It took me a while to figure out defining constructors and dynamic
> instantiation of OO primitives. I hope it'll save somebody else some time
> one day.
> Any comments and suggestions are welcome.
>
> Regards
> Jan
>
> [1] http://wedesoft.de/oop-with-goops.html
Hi Jan,
I think it's a nice little introduction to GOOPS.
I want to discuss this particular point from the post, because it is
shared by many other people: "... one thing I don't like about Scheme
is that there are different function names for each type of arguments.
E.g. adding numbers is done with +, adding lists is done with append,
and adding strings is done with string-append."
Having spent many years now working with object oriented programming
languages, I hold the opposite opinion. I think it's awkward to have
a single '+' operator for all sorts of different operations on many
different types. Adding numbers is different than concatenating
strings or lists and using the same symbol for them leads to
confusion. Look at JavaScript for all of the crazy things that happen
when you add together different types of data: The expression 1 +
"foo" returns "1foo"! [] + {} returns "[object Object]"! WTF? Ruby
tends to be a bit more sane in this regard, but I think the point
still stands that operator overloading leads to confusion and strange
behavior.
WDYT?
- Dave
Re: Article about GNU Guile and GOOPS, Neil Jerram, 2014/03/04
Re: Article about GNU Guile and GOOPS, Andrew Gwozdziewycz, 2014/03/05