How clean/elegant is Python's syntax?

rusi rustompmody at gmail.com
Thu May 30 22:59:21 EDT 2013


On May 31, 12:36 am, Steven D'Aprano <steve
+comp.lang.pyt... at pearwood.info> wrote:
>
> But even if only a minority of programmers can master languages like
> Lisp, Haskell, or Scheme, doesn't mean that *all* programmers can't learn
> something from them. Functional programming is at least 50% a philosophy:
>
> * pass arguments to functions, and return results, rather than getting
> and setting state from a variable.

Yes that's the sense in which I am using the term.
More such ideas of FP that can be used by all sorts of programmers
across the board (not just FPers) is here:
http://blog.languager.org/2012/10/functional-programming-lost-booty.html

> On Thu, 30 May 2013 10:12:22 -0700, rusi wrote:
> > On Thu, May 30, 2013 at 9:34 AM, Ma Xiaojun <damage3... at gmail.com>
> > wrote:
> >> Wait a minute! Isn't the most nature way of doing/thinking "generating
> >> 9x9 multiplication table" two nested loop?
>
> > Thats like saying that the most natur(al) way of using a car is to
> > attach a horse to it.
> >[...]
> > Likewise in the world of programming, 90% of programmers think
> > imperative/OO programming is natural while functional programming is
> > strange.  Just wait 10 years and see if things are not drastically
> > different!
>
> It won't be. Functional programming goes back to Lisp, which is nearly as
> old as Fortran and older than Cobol. There have been many decades for
> functional languages to become mainstream, but they've never quite done
> it. There's no reason to think that the next decade will see a change to
> this.

Depends on how you define your terms.

Comprehensions and lambdas have come into python. From where? [Lambdas
have even got into C++ !!]
Also LINQ in C# is inspired by comprehensions
Generics were not there in C# and Java early editions.  Now they've
been retrofitted -- Origin SML.
Almost every modern language supports garbage collection. Origin Lisp
Numpy is a rip-off of APL. [Ripping off is a tribute. Non-
acknowledgement is sad...]
TAOCP -Vol 1 is a gigantic exercise on how to do lisp without lisp.
Also called Greenspun's 10th law: http://c2.com/cgi/wiki?GreenspunsTenthRuleOfProgramming

> Some modern Functional languages are really neat, like Haskell, but I
> think the sad truth is that to really master them (and not just make do
> with a small percentage of their functionality) is beyond 90% of
> programmers. I'm not ashamed to admit that I struggle with advanced FP
> concepts.

Yes Haskell is HARD. Gets harder with each new major addition.

Which is why I suggest using Haskell core (ie minus most fancy
features) as an *ideology* rather than as a *technology*.
Which is what I am suggesting in my course proposal
https://moocfellowship.org/submissions/the-dance-of-functional-programming-languaging-with-haskell-and-python

"Think with Haskell --- Code into Python"
Want to contribute <wink>?

Well actually the last applies to anyone who is interested --
suggestions welcome!!



More information about the Python-list mailing list