[Tutor] (OT) Flame wars

Chris Hengge pyro9219 at gmail.com
Mon Nov 6 23:33:22 CET 2006


I may have just missed the point to your attempt to derail this conversation
=P

However..

Why do all that when you can just

str = "Hello World"
print str * 2

(Maybe I missed some concept that this small example doesn't accuratly
reflect)

On 11/6/06, Danny Yoo <dyoo at hkn.eecs.berkeley.edu> wrote:
>
>
> > Wow... I had to click this e-mail just because I saw the first posts on
> the
> > mentioned thread and could see it turning for the worst..
>
> Hi everyone,
>
> So let's try to squash this one now.  There are more interesting problems
> to solve.  Or other flame wars to fight.
>
>
> Let me see if we can do something constructive.  I've been doing a
> shallow, superficial study of the Ruby language at the moment.  One of the
> things I've been impressed about is that they've managed to make lambdas
> look non-threatening to people with their syntactic sugar of "code
> blocks".
>
> For example,
>
> ## Ruby #####################
> def twice
>      yield
>      yield
> twice { puts "hello world" }
> #############################
>
> This prints out "hello world" twice in a row: the twice() function takes
> in an implicit "code block", which it can later call by using their
> 'yield' statement.  What the Ruby folks are doing is trying to make the
> use of higher-order procedures look really simple.  In fact, most of the
> encouraged idiom style I've seen so far extensively uses this code style
> pervasively (especially for iteration), and that's very admirable.
>
>
> The exact functionality can be done in Python, but it does look a little
> more intimidating at first:
>
>      ## Python
>      def twice(f):
>          f()
>          f()
>      twice(lambda: sys.stdout.write("hello world\n"))
>
> This does the same thing, but it looks a little scarier because the
> concepts needed to grasp his are superficially harder than that in the
> Ruby code.
>
>
> Anyway, let's derail off this regex flamewar and get us back to talking
> about code and about stuff that actually matters, like learning how to use
> functions well.. *wink*
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20061106/609386ee/attachment.html 


More information about the Tutor mailing list