Re: Question mark in variable and function names

Discussion in 'Python' started by Eric Pederson, Oct 7, 2004.

  1. Andr? N?ss wrote:

    >
    > One thing I liked about Lisp was the ability to use the question mark
    > (and the exclamation mark) in function names. I found this
    > particularily useful when checking boolean properties of a object like
    > for example myObj.isContextSet. It just feels so much more natural to
    > write myObj.contextSet?
    >
    > I also found it neat that destructive operations were clearly marked
    > with !.



    I guess any programmer who likes LISP has an extra gear in their gear box (perhaps), but I think non-alphanumeric symbols in names reduce the readability. We live in a world of text where words have letters in them, and punctuation means something different. When I see punctuation my brain goes "STOP. ABSORB SOME LOGIC BEFORE PROCEEDING."

    sorry for the caps, but to my mind's eye punctuation symbols in names is like e-mail in all caps.


    > Is there anything preventing this from being possible in Python?
    >



    Maybe the desire to have visually clean code?

    I think underneath it all some Python programmers really _miss_ the semicolon, and are dying to work more punctuation into the language to make it seem more complicated. Then it will look more impressive.

    <tongue_in_cheek />




    Eric
    :::::::::::::::::::::::::::::::::::
    domainNot="@something.com"
    domainIs=domainNot.replace("s","z")
    ePrefix="".join([chr(ord(x)+1) for x in "do"])
    mailMeAt=ePrefix+domainIs
    :::::::::::::::::::::::::::::::::::
     
    Eric Pederson, Oct 7, 2004
    #1
    1. Advertising

  2. Eric Pederson

    Paul Foley Guest

    On Wed, 6 Oct 2004 21:11:41 -0800, Eric Pederson wrote:

    > Andr? N?ss wrote:
    >>
    >> One thing I liked about Lisp was the ability to use the question mark
    >> (and the exclamation mark) in function names. I found this
    >> particularily useful when checking boolean properties of a object like
    >> for example myObj.isContextSet. It just feels so much more natural to
    >> write myObj.contextSet?
    >>
    >> I also found it neat that destructive operations were clearly marked
    >> with !.


    > I guess any programmer who likes LISP has an extra gear in their gear box (perhaps), but I think non-alphanumeric symbols in names reduce the readability. We live in a world of text where words have letters in them, and punctuation means something different. When I see punctuation my brain goes "STOP. ABSORB SOME LOGIC BEFORE PROCEEDING."


    Yes, so do I. I /hate/ that convention (of *SCHEME*, not Lisp, note!)

    [Not to mention that it's not pronounceable]

    --
    Malum est consilium quod mutari non potest -- Publilius Syrus

    (setq reply-to
    (concatenate 'string "Paul Foley " "<mycroft" '(#\@) "actrix.gen.nz>"))
     
    Paul Foley, Oct 7, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ares Lagae
    Replies:
    8
    Views:
    455
    Ares Lagae
    Sep 24, 2004
  2. Andr? N?ss
    Replies:
    27
    Views:
    2,796
    Diez B. Roggisch
    Oct 13, 2004
  3. wanwan
    Replies:
    3
    Views:
    439
    Alex Martelli
    Oct 14, 2005
  4. Cirene
    Replies:
    5
    Views:
    596
    Cirene
    May 17, 2008
  5. News123
    Replies:
    2
    Views:
    471
    John Machin
    Nov 26, 2008
Loading...

Share This Page