Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2001:
[Freeciv-Dev] Re: curiosity
Home

[Freeciv-Dev] Re: curiosity

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Alan Schmitt <alan.schmitt@xxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: curiosity
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 2 Dec 2001 10:58:25 +0100
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Sun, Dec 02, 2001 at 10:32:06AM +0100, Alan Schmitt wrote:
> * Vasco Alexandre Da Silva Costa (vasc@xxxxxxxxxxxxxx) wrote:
> > basic:              no functions or procedures, game over. GOSUB? no thanks.
> > logo:               need i say anything? good for teaching programming and 
> > nothing
> >             else.
> > pascal:             too strict, you end up typing way too much. for loops 
> > are much
> >             less flexible. i find it too contraining and limited.
> 
> But local function declaration, which can be useful.
> 
> > modula-2:   nicer than pascal, but still has most of its problems.
> > c:          fast, flexible, easy to shoot your foot with, really hard
> >             to debug, has virtually universal support.
> > x86 asm:    not portable.
> > smalltalk:  its dead what can i say?
> > c++:                nearly as fast as c, flexible, horribly complex syntax,
> >             unreadable code, mixes implementation with interfaces, you
> >             can easily interface to c, STL sucks, needs a bigger API,
> >             inheritance and templates are nice, as hard to debug as c.
> > lisp:               several built-in data types, flexible, code is more
> >             unreadable because of prefixed notation, code is more
> >             elegant because of prefixed notation, slow, crap compilers,
> >             crap garbage collection, lousy interface to c, has OO
> >             support.
> > prolog:             i doubt this can be a general purpose language.
> > caml:               obfuscated function declaration syntax.
> 
> Although I agree Ocaml syntax is not perfect, how about comparing the
> identity function:
> 
> let id x = x
> 
> and
> 
> void* id(void* x){
>   return x;
> }
> 
> OK, I cheated, I used polymorphism and type reconstruction to make C
> look bad. How about the incr function:
> 
> let incr x = x + 1
> 
> and
> 
> int incr(int x){
>   return (x+1);
> }

Just for the record: python

  def incr(x): return x+1
or
  incr=lambda x: x+1

Even nicer is this:

add=lambda x,y: x+y

add(3,4) = 7
add("hello", "world") = "helloworld"
add([3,4], [5,6]) = [3, 4, 5, 6]
add(4+5j, 6+8j) = 10+13j

Ok I stop here.

Andrew: the same in C++?? ;)

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "Many of my assistants were fans of Tolkien, who wrote 'Lord of the Rings'
  and a number of other children's stories for adults.  The first character
  alphabet that was programmed for my plotter was Elvish rather than Latin."
    -- from SAIs "life as a computer for a quarter of a century"


[Prev in Thread] Current Thread [Next in Thread]