The use of :

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jeremy Bowers

    #16
    Re: The use of :

    A two-fer.

    On Mon, 29 Nov 2004 10:28:42 +0800, Isaac To wrote:
    [color=blue][color=green][color=darkred]
    >>>>>> "Greg" == Greg Ewing <greg@cosc.cant erbury.ac.nz> writes:[/color][/color]
    >[color=green][color=darkred]
    > >> The only punctuation you *need* is whitespace. See Forth[/color][/color]
    >
    > Greg> You don't even need that... see FORTRAN. :-)[/color]

    Well, I for one don't like reading large programs with no line feeds :-)
    [color=blue]
    > And you don't need everything else either... see this.
    >
    > http://compsoc.dur.ac.uk/whitespace/[/color]

    I'm pretty sure if you remove all the whitespace and you remove all the
    non-whitespace that you have indeed gotten a little too minimal :-)

    Comment

    • Paul Robson

      #17
      Re: The use of :

      On Mon, 29 Nov 2004 01:12:16 -0500, Jeremy Bowers wrote:
      [color=blue]
      > The only punctuation you *need* is whitespace. See Forth (I don't know
      > if this is perfect but I'd bet the transform is simple),[/color]

      : Announce ." Forth has a fair bit of punctuation" ;

      Comment

      • Marc 'BlackJack' Rintsch

        #18
        Re: The use of :

        In <41aa1abb$0$255 42$636a15ce@new s.free.fr>, bruno modulix wrote:
        [color=blue]
        > <please-someone-correct-me-if-i-am-wrong>
        > In fact, from a purely technical POV, the ':' could have been omitted
        > from the Python syntax, since indentation does the whole job of defining
        > blocks. It's only here for readability AFAIK.
        > </please-someone-correct-me-if-i-am-wrong>[/color]

        The ':' serves as a very good hint to "python aware" text editors to
        automagically indent the next line after hitting return.

        Ciao,
        Marc 'BlackJack' Rintsch

        Comment

        • Nick Coghlan

          #19
          Re: The use of :

          BJörn Lindqvist wrote:[color=blue]
          > Because it contains more non-significant symbols (, ), { and } that
          > "steal" the programmers attention. But consider
          >
          > def f(x, y, z)
          > print x, y, z
          >
          > to
          >
          > def f(x, y, z):
          > print x, y, z
          >
          > IMHO, the colon-less variant is more readable than the one with the colon.[/color]

          Except that it is quite acceptable to do the following:

          def f(x, y, z,
          long_func_arg_n ame):
          long_func_arg_n ame(x, y, z)


          def f(x, y, z,
          long_func_arg_n ame)
          long_func_arg_n ame(x, y, z)

          The colons do a decent job of flagging the beginning of suites, mainly because
          of Python general lack of *other* punctuation (e.g. the colon would be entirely
          ineffective at improving readability if every line ended with a semi-colon).

          Cheers,
          Nick.

          Comment

          Working...