Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: The Law of Inconsistent Assumptions

by Corion (Patriarch)
on Oct 19, 2004 at 11:50 UTC ( [id://400567]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to The Law of Inconsistent Assumptions

Just a note - I prefer the sprintf-style notation of string interpolation in Python, but there are also other, less cumbersome ways:

print "Hello",foo,"." # not quite the same output but close enough print "Hello %s." % (foo) # printf-style interpolation

Manually concatenating strings is soo low-level :-)

Replies are listed 'Best First'.
Re^2: The Law of Inconsistent Assumptions
by SpanishInquisition (Pilgrim) on Oct 20, 2004 at 16:02 UTC
    Obligatory Ruby example:

    puts "This post was brought to you by the number #{ x + 75 / y} and th +e letter #{q}";

    Arbitrary code execution, variables, anything.

    If you want printf, Perl has a nicer printf than the example Python syntax. Why? It looks like printf and is therefore nice and short :)

    Regardless, a language is not about keystrokes, it's about style. Python is too wordy for me, and not automagical enough.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://400567]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.