Professional Web Applications Themes

Parentheses - PERL Beginners

OK, is there a general concensus on when it is OK to omit parentheses and when it is not? I prefer skipping parentheses as often as possible, but I'm not quite sure when I may run into trouble and when it is OK. nikolai -- ::: name: Nikolai Weibull :: aliases: pcp / lone-star / aka ::: ::: born: Chicago, IL USA :: loc atm: Gothenburg, Sweden ::: ::: page: [url]www.pcppopper.org[/url] :: fun atm: gf,lps,ruby,lisp,war3 ::: main(){printf(&linux[" 1%six

2

Thread: Parentheses

"],(linux)["have"]+"fun"-97);}...

  1. #1

    Default Parentheses


    OK, is there a general concensus on when it is OK to omit parentheses
    and when it is not? I prefer skipping parentheses as often as possible,
    but I'm not quite sure when I may run into trouble and when it is OK.
    nikolai

    --
    ::: name: Nikolai Weibull :: aliases: pcp / lone-star / aka :::
    ::: born: Chicago, IL USA :: loc atm: Gothenburg, Sweden :::
    ::: page: [url]www.pcppopper.org[/url] :: fun atm: gf,lps,ruby,lisp,war3 :::
    main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}

    Nikolai Weibull Guest

  2. #2

    Default Re: Parentheses

    Hi,

    In message "Parentheses"
    on 03/10/16, Nikolai Weibull <ruby-talkpcppopper.org> writes:

    |OK, is there a general concensus on when it is OK to omit parentheses
    |and when it is not? I prefer skipping parentheses as often as possible,
    |but I'm not quite sure when I may run into trouble and when it is OK.

    foo 1,2,3 # this is OK (top level)
    a = foo 3 # this is not recommended (part of expression)

    matz.

    Yukihiro Matsumoto Guest

  3. #3

    Default Re: Parentheses


    When you omit parenthesis's doesn't that degrade readability of the code?
    I'm just curious
    what others have to say since I've seen a few folks say they like to omit
    them.

    -Zach


    Zach Dennis Guest

  4. #4

    Default Re: Parentheses


    --=-F4TCyoiWYmMbddmAQ6/u
    Content-Type: text/plain
    Content-Transfer-Encoding: quoted-printable

    On Wed, 2003-10-15 at 10:21, Zach Dennis wrote:
    > When you omit parenthesis's doesn't that degrade readability of the code?
    > I'm just curious
    > what others have to say since I've seen a few folks say they like to omit
    > them.
    I'm definately in favor of omitting: I p like natural language, not
    like a machine.

    Ari


    --=-F4TCyoiWYmMbddmAQ6/u
    Content-Type: application/pgp-signature; name=signature.asc
    Content-Description: This is a digitally signed message part

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.2.3 (GNU/Linux)

    iD8DBQA/jXSrtP09exA3hooRAj8vAKCmCqKbxZRZ1DIgANvFxoXef7dhxQ Cffuic
    CqU+A7H1eYklpb5pXu+/4+U=
    =xAep
    -----END PGP SIGNATURE-----

    --=-F4TCyoiWYmMbddmAQ6/u--


    Aredridel Guest

  5. #5

    Default Re: Parentheses

    * Yukihiro Matsumoto <matzruby-lang.org> [Oct, 15 2003 18:20]:
    > |OK, is there a general concensus on when it is OK to omit parentheses
    > |and when it is not? I prefer skipping parentheses as often as possible,
    > |but I'm not quite sure when I may run into trouble and when it is OK.
    >
    > foo 1,2,3 # this is OK (top level)
    > a = foo 3 # this is not recommended (part of expression)
    OK, thanks. Did this change in 1.8.0 in any way?
    nikolai

    --
    ::: name: Nikolai Weibull :: aliases: pcp / lone-star / aka :::
    ::: born: Chicago, IL USA :: loc atm: Gothenburg, Sweden :::
    ::: page: [url]www.pcppopper.org[/url] :: fun atm: gf,lps,ruby,lisp,war3 :::
    main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}

    Nikolai Weibull Guest

  6. #6

    Default Re: Parentheses

    * Aredridel <aredridelnbtsc.org> [Oct, 15 2003 18:30]:
    > > When you omit parenthesis's doesn't that degrade readability of the code?
    > > I'm just curious
    > > what others have to say since I've seen a few folks say they like to omit
    > > them.
    >
    > I'm definately in favor of omitting: I p like natural language, not
    > like a machine.
    yeah, i feel the same way often.
    nikolai



    --
    ::: name: Nikolai Weibull :: aliases: pcp / lone-star / aka :::
    ::: born: Chicago, IL USA :: loc atm: Gothenburg, Sweden :::
    ::: page: [url]www.pcppopper.org[/url] :: fun atm: gf,lps,ruby,lisp,war3 :::
    main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}

    Nikolai Weibull Guest

  7. #7

    Default Re: Parentheses

    I prefer the parentheses.

    Parens are an 'ambiguity reducing notation' - without the parens, you have
    to ask (from time to time) - "What is the precedence of these operators in
    this language".

    Less ambiguity means clearer (human) code.

    BobG


    Nikolai Weibull wrote:
    >* Aredridel <aredridelnbtsc.org> [Oct, 15 2003 18:30]:
    >> > When you omit parenthesis's doesn't that degrade readability of the code?
    >> > I'm just curious
    >> > what others have to say since I've seen a few folks say they like to omit
    >> > them.
    >>
    >> I'm definately in favor of omitting: I p like natural language, not
    >> like a machine.
    >yeah, i feel the same way often.
    > nikolai
    Bob Gustafson Guest

  8. #8

    Default Re: Parentheses

    Aredridel wrote:
    > On Wed, 2003-10-15 at 10:21, Zach Dennis wrote:
    >
    >>When you omit parenthesis's doesn't that degrade readability of the
    code?
    >>I'm just curious
    >>what others have to say since I've seen a few folks say they like
    to omit
    >>them.
    > I'm definately in favor of omitting: I p like natural language,
    not
    > like a machine.
    I don't, and use them where I would have used them in most c-like
    languages. Maybe it's because I come from a C/C++/perl/java
    background.

    I dislike ambiguity.


    __________________________________
    Do you Yahoo!?
    The New Yahoo! Shopping - with improved product search
    [url]http://shopping.[/url]

    Michael Campbell Guest

  9. #9

    Default Re: Parentheses

    Bob Gustafson said:
    > I prefer the parentheses.
    >
    > Parens are an 'ambiguity reducing notation' - without the parens, you have
    > to ask (from time to time) - "What is the precedence of these operators in
    > this language".
    >
    > Less ambiguity means clearer (human) code.
    I think that it depends.

    #1
    -----
    dbh.select_all sql do |row|
    media_list.push QMedia.new *row
    end
    -----

    #2
    -----
    dbh.select_all(sql) do |row|
    media_list.push(QMedia.new(*row))
    end
    -----

    I think that #1 is easier to read than #2. However, consider:

    #3
    -----
    dbh.select_all sql,client.idx do |row|
    media_list.push QMedia.new me.idx,row[0],row[1]
    end
    -----

    #4
    -----
    dbh.select_all(sql,client.idx) do |row|
    media_list.push QMedia.new(me.idx,row[0],row[1])
    end
    -----

    If there are multiple arguments, I prefer to use parens to group them and
    help make it clearer to my eyes where the groupings are.


    Kirk Haines


    Kirk Haines Guest

  10. #10

    Default Re: Parentheses

    This message is in MIME format. Since your mail reader does not understand
    this format, some or all of this message may not be legible.

    ------_=_NextPart_001_01C39348.7FAE6AB2
    Content-Type: text/plain; cht="iso-8859-1"

    I like Kirk's criteria for deciding when to use parens. The ability to omit
    them is one of the reasons I prefer Ruby syntax over Java syntax. The less
    noise, the better.
    > -----Original Message-----
    > From: Kirk Haines [mailto:khainesenigo.com]
    > Sent: Wednesday, October 15, 2003 1:00 PM
    > To: [email]ruby-talkruby-lang.org[/email]
    > Subject: Re: Parentheses
    >
    >
    > Bob Gustafson said:
    > > I prefer the parentheses.
    > >
    > > Parens are an 'ambiguity reducing notation' - without the
    > parens, you have
    > > to ask (from time to time) - "What is the precedence of
    > these operators in
    > > this language".
    > >
    > > Less ambiguity means clearer (human) code.
    >
    > I think that it depends.
    >
    > #1
    > -----
    > dbh.select_all sql do |row|
    > media_list.push QMedia.new *row
    > end
    > -----
    >
    > #2
    > -----
    > dbh.select_all(sql) do |row|
    > media_list.push(QMedia.new(*row))
    > end
    > -----
    >
    > I think that #1 is easier to read than #2. However, consider:
    >
    > #3
    > -----
    > dbh.select_all sql,client.idx do |row|
    > media_list.push QMedia.new me.idx,row[0],row[1]
    > end
    > -----
    >
    > #4
    > -----
    > dbh.select_all(sql,client.idx) do |row|
    > media_list.push QMedia.new(me.idx,row[0],row[1])
    > end
    > -----
    >
    > If there are multiple arguments, I prefer to use parens to
    > group them and
    > help make it clearer to my eyes where the groupings are.
    >
    >
    > Kirk Haines
    >
    >

    ------------------------------------------------------------------------------------------
    A.G. Edwards & Sons' outgoing and incoming e-mails are electronically
    archived and subject to review and/or disclosure to someone other
    than the recipient.

    ------------------------------------------------------------------------------------------

    ------_=_NextPart_001_01C39348.7FAE6AB2
    Content-Type: text/html; cht="iso-8859-1"
    Content-Transfer-Encoding: quoted-printable

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
    <HTML>
    <HEAD>
    <META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; cht=3Diso-8859-=
    1">
    <META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version 5.5.2655.35">
    <TITLE>RE: Parentheses</TITLE>
    </HEAD>
    <BODY>

    <P><FONT SIZE=3D2>I like Kirk's criteria for deciding when to use parens.&n=
    bsp; The ability to omit them is one of the reasons I prefer Ruby syntax ov=
    er Java syntax.&nbsp; The less noise, the better.</FONT></P>

    <P><FONT SIZE=3D2>&gt; -----Original Message-----</FONT>
    <BR><FONT SIZE=3D2>&gt; From: Kirk Haines [<A HREF=3D"mailto:khainesenigo.=
    com">mailto:khainesenigo.com</A>]</FONT>
    <BR><FONT SIZE=3D2>&gt; Sent: Wednesday, October 15, 2003 1:00 PM</FONT>
    <BR><FONT SIZE=3D2>&gt; To: [email]ruby-talkruby-lang.org[/email]</FONT>
    <BR><FONT SIZE=3D2>&gt; Subject: Re: Parentheses</FONT>
    <BR><FONT SIZE=3D2>&gt; </FONT>
    <BR><FONT SIZE=3D2>&gt; </FONT>
    <BR><FONT SIZE=3D2>&gt; Bob Gustafson said:</FONT>
    <BR><FONT SIZE=3D2>&gt; &gt; I prefer the parentheses.</FONT>
    <BR><FONT SIZE=3D2>&gt; &gt;</FONT>
    <BR><FONT SIZE=3D2>&gt; &gt; Parens are an 'ambiguity reducing notation' - =
    without the </FONT>
    <BR><FONT SIZE=3D2>&gt; parens, you have</FONT>
    <BR><FONT SIZE=3D2>&gt; &gt; to ask (from time to time) - &quot;What is the=
    precedence of </FONT>
    <BR><FONT SIZE=3D2>&gt; these operators in</FONT>
    <BR><FONT SIZE=3D2>&gt; &gt; this language&quot;.</FONT>
    <BR><FONT SIZE=3D2>&gt; &gt;</FONT>
    <BR><FONT SIZE=3D2>&gt; &gt; Less ambiguity means clearer (human) code.</FO=
    NT>
    <BR><FONT SIZE=3D2>&gt; </FONT>
    <BR><FONT SIZE=3D2>&gt; I think that it depends.</FONT>
    <BR><FONT SIZE=3D2>&gt; </FONT>
    <BR><FONT SIZE=3D2>&gt; #1</FONT>
    <BR><FONT SIZE=3D2>&gt; -----</FONT>
    <BR><FONT SIZE=3D2>&gt; dbh.select_all sql do |row|</FONT>
    <BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp; media_list.push QMedia.new *row</FONT>
    <BR><FONT SIZE=3D2>&gt; end</FONT>
    <BR><FONT SIZE=3D2>&gt; -----</FONT>
    <BR><FONT SIZE=3D2>&gt; </FONT>
    <BR><FONT SIZE=3D2>&gt; #2</FONT>
    <BR><FONT SIZE=3D2>&gt; -----</FONT>
    <BR><FONT SIZE=3D2>&gt; dbh.select_all(sql) do |row|</FONT>
    <BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp; media_list.push(QMedia.new(*row))</FONT>
    <BR><FONT SIZE=3D2>&gt; end</FONT>
    <BR><FONT SIZE=3D2>&gt; -----</FONT>
    <BR><FONT SIZE=3D2>&gt; </FONT>
    <BR><FONT SIZE=3D2>&gt; I think that #1 is easier to read than #2.&nbsp; Ho=
    wever, consider:</FONT>
    <BR><FONT SIZE=3D2>&gt; </FONT>
    <BR><FONT SIZE=3D2>&gt; #3</FONT>
    <BR><FONT SIZE=3D2>&gt; -----</FONT>
    <BR><FONT SIZE=3D2>&gt; dbh.select_all sql,client.idx do |row|</FONT>
    <BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp; media_list.push QMedia.new me.idx,row[0=
    ],row[1]</FONT>
    <BR><FONT SIZE=3D2>&gt; end</FONT>
    <BR><FONT SIZE=3D2>&gt; -----</FONT>
    <BR><FONT SIZE=3D2>&gt; </FONT>
    <BR><FONT SIZE=3D2>&gt; #4</FONT>
    <BR><FONT SIZE=3D2>&gt; -----</FONT>
    <BR><FONT SIZE=3D2>&gt; dbh.select_all(sql,client.idx) do |row|</FONT>
    <BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp; media_list.push QMedia.new(me.idx,row[0=
    ],row[1])</FONT>
    <BR><FONT SIZE=3D2>&gt; end</FONT>
    <BR><FONT SIZE=3D2>&gt; -----</FONT>
    <BR><FONT SIZE=3D2>&gt; </FONT>
    <BR><FONT SIZE=3D2>&gt; If there are multiple arguments, I prefer to use pa=
    rens to </FONT>
    <BR><FONT SIZE=3D2>&gt; group them and</FONT>
    <BR><FONT SIZE=3D2>&gt; help make it clearer to my eyes where the groupings=
    are.</FONT>
    <BR><FONT SIZE=3D2>&gt; </FONT>
    <BR><FONT SIZE=3D2>&gt; </FONT>
    <BR><FONT SIZE=3D2>&gt; Kirk Haines</FONT>
    <BR><FONT SIZE=3D2>&gt; </FONT>
    <BR><FONT SIZE=3D2>&gt; </FONT>
    </P>

    <CODE><FONT SIZE=3D3><BR>
    <BR>
    ---------------------------------------------------------------------------=
    ---------------<BR>
    A.G. Edwards & Sons' outgoing and incoming e-mails are electronically<BR>
    archived and subject to review and/or disclosure to someone other <BR>
    than the recipient.<BR>
    <BR>
    ---------------------------------------------------------------------------=
    ---------------<BR>
    </FONT></CODE></BODY>
    </HTML>
    ------_=_NextPart_001_01C39348.7FAE6AB2--

    Volkmann, Mark Guest

  11. #11

    Default Re: Parentheses


    "Kirk Haines" <khainesenigo.com> schrieb im Newsbeitrag
    news:60989.148.78.249.33.1066240635.squirrelenigo .com...
    > Bob Gustafson said:
    > > I prefer the parentheses.
    > >
    > > Parens are an 'ambiguity reducing notation' - without the parens, you
    have
    > > to ask (from time to time) - "What is the precedence of these operators
    in
    > > this language".
    > >
    > > Less ambiguity means clearer (human) code.
    >
    > I think that it depends.
    >
    > #1
    > -----
    > dbh.select_all sql do |row|
    > media_list.push QMedia.new *row
    > end
    > -----
    >
    > #2
    > -----
    > dbh.select_all(sql) do |row|
    > media_list.push(QMedia.new(*row))
    > end
    > -----
    >
    > I think that #1 is easier to read than #2. However, consider:
    Hm, I found #2 easier to read, since it's immediately obvious what belongs
    to the argument list. But maybe that's just while reading email: my editor
    would have colored the "do" differently...
    > #3
    > -----
    > dbh.select_all sql,client.idx do |row|
    > media_list.push QMedia.new me.idx,row[0],row[1]
    > end
    > -----
    >
    > #4
    > -----
    > dbh.select_all(sql,client.idx) do |row|
    > media_list.push QMedia.new(me.idx,row[0],row[1])
    > end
    > -----
    >
    > If there are multiple arguments, I prefer to use parens to group them and
    > help make it clearer to my eyes where the groupings are.
    I'd even spent some spaces, at least after the ",":

    dbh.select_all(sql, client.idx) do |row|
    media_list.push QMedia.new(me.idx, row[0], row[1])
    end

    Often I do:

    dbh.select_all( sql, client.idx ) do |row|
    media_list.push QMedia.new( me.idx, row[0], row[1] )
    end

    My internalized rule of thumb on the parentheses seems to be, that I use
    them whenever there are more than two method invocations in a line. I find

    if foo( bar ) && baz( foz )

    more readable than

    if foo bar && baz foz


    Regards

    robert

    Robert Klemme Guest

  12. #12

    Default Re: Parentheses

    Hi,

    In message "Re: Parentheses"
    on 03/10/16, Michael Campbell <michael_s_campbell> writes:

    |I dislike ambiguity.

    Me too. But I still like to drop parentheses for some cases.
    Omitting parentheses does not always introduce ambiguity.

    matz.

    Yukihiro Matsumoto Guest

  13. #13

    Default Re: Parentheses

    Yukihiro Matsumoto wrote:
    > |I dislike ambiguity.
    >
    >
    >
    > Me too. But I still like to drop parentheses for some cases.
    > Omitting parentheses does not always introduce ambiguity.
    True enough. Maybe I've just been conditioned this way, but I have
    found that the cases where that doesn't happen to not be worth the
    inconsistency [when writing my own code].


    __________________________________
    Do you Yahoo!?
    The New Yahoo! Shopping - with improved product search
    [url]http://shopping.[/url]

    Michael Campbell Guest

  14. #14

    Default Re: Parentheses

    On Thursday, October 16, 2003, 5:31:55 AM, Michael wrote:
    > Yukihiro Matsumoto wrote:
    >> |I dislike ambiguity.
    >>
    >>
    >>
    >> Me too. But I still like to drop parentheses for some cases.
    >> Omitting parentheses does not always introduce ambiguity.
    > True enough. Maybe I've just been conditioned this way, but I have
    > found that the cases where that doesn't happen to not be worth the
    > inconsistency [when writing my own code].
    Do you use parens for 'puts'?

    Gavin


    Gavin Sinclair Guest

  15. #15

    Default Re: Parentheses

    Hi!

    * Nikolai Weibull; 2003-10-15, 21:32 UTC:
    > OK, is there a general concensus on when it is OK to omit
    > parentheses and when it is not?
    The answer depends on what 'OK' means. The obvious answer is: "You
    can drop any parentheses unless doing so breakes the program." That
    doesn't help you a lot, does it?

    A better approach seems to be "Remove or add non-essential
    parentheses unless the code 'feels good'". What 'feels good'? This
    depends on the problem you face: The following can 'feel good' if it
    means 'compute a sum, divide it by a value then divide it by a
    quotient':

    (1.1 + 2.2) / 3.3 / ((2.2 + 3.3) / (1.0 + 0.1))

    but if the same computation is done meaning 'compute a fraction and
    then divide it by another fraction' one should rather write

    ((1.1 + 2.2) / 3.3) / ((2.2 + 3.3) / (1.0 + 0.1))

    This is the techical side of 'feels good'. The other side is the
    programmer. Many programmers are 'parameter-centered' while many
    others are 'option-centered'.

    One can see h.delete in two ways: As a function that takes a
    parameter or as a command that understands a numerical option.
    Depending on how your interpretation of h.delete is, you either
    prefer using parentheses or not.

    irb(main):001:0> a = [3, 1, 4, 1, 5]; b = [3, 1, 4, 1, 5]
    => [3, 1, 4, 1, 5]
    irb(main):002:0> a.delete(1)
    => 1
    irb(main):003:0> b.delete 1
    => 1
    irb(main):004:0> a
    => [3, 4, 5]
    irb(main):005:0> b
    => [3, 4, 5]
    > I prefer skipping parentheses as often as possible, but I'm not
    > quite sure when I may run into trouble and when it is OK.
    Corollary of "Remove or add non-essential parentheses unless code
    'feels good'": "Don't remove parentheses that feel like trouble, add
    parentheses where white space feels like trouble".

    Please take notice of signature! / Bitte Signature beachten!

    Josef 'Jupp' Schugt
    --
    db Wenn sie mir ohne meine Einwilligung geschickt wurde, db
    dpqb wird eine E-Mail > 100 kB ungelesen entsorgt dpqb
    dp::qb If you send me an e-mail > 100 kB without my dp::qb
    dp::::qb consent it will be silently discarded dp::::qb

    Josef 'Jupp' SCHUGT Guest

  16. #16

    Default Re: Parentheses

    >
    >
    >>True enough. Maybe I've just been conditioned this way, but I have
    >>found that the cases where that doesn't happen to not be worth the
    >>inconsistency [when writing my own code].
    >>
    >>
    >
    >Do you use parens for 'puts'?
    >
    >Gavin
    >
    >
    I have. Generally I don't. I don't claim perfection, only that I
    /generally/ use parens and I dislike poetry mode. Some claim it reduces
    noise, to me it is overly ambiguous and reduces the rate at which I am
    able to read and write code.






    Michael campbell Guest

  17. #17

    Default Re: Parentheses

    Gavin Sinclair wrote:
    >On Thursday, October 16, 2003, 5:31:55 AM, Michael wrote:
    >...
    >Do you use parens for 'puts'?
    >
    >Gavin
    >
    >
    I frequently do. It's nice to not need to, but usually I include them.
    OTOH, I've been writing code where parens around arguments were required
    for multi-decades. But it makes it easier to figure out what the
    interpreter will decide to do. Actually, in most languages I will use
    parens as opposed to remembering the operator precedence hierarchy, even
    among simple arithmetic operations. Because it's easier.



    Charles Hixson Guest

  18. #18

    Default Re: Parentheses

    Since I started the question I might as well add my 2 cents in.

    I prefer the use of parenthesis's in most cases because it increases the
    readability of the code for me. I believe more in refactoring code then
    write once, read never code. Although in certain statements in Ruby
    I do omit them. These are typically the puts and the print statement.

    Just my 2 cents,

    -Zach





    Zach Dennis Guest

  19. #19

    Default Re: Parentheses

    Charles Hixson wrote:
    > Gavin Sinclair wrote:
    >
    >> On Thursday, October 16, 2003, 5:31:55 AM, Michael wrote:
    >> ...
    >> Do you use parens for 'puts'?
    >>
    >> Gavin
    >>
    >>
    > I frequently do. It's nice to not need to, but usually I include
    them.
    > OTOH, I've been writing code where parens around arguments were
    required
    > for multi-decades. But it makes it easier to figure out what the
    > interpreter will decide to do. Actually, in most languages I will
    use
    > parens as opposed to remembering the operator precedence hierarchy,
    even
    > among simple arithmetic operations. Because it's easier.

    yeah, he said it better than I did. =)


    __________________________________
    Do you Yahoo!?
    The New Yahoo! Shopping - with improved product search
    [url]http://shopping.[/url]

    Michael Campbell Guest

  20. #20

    Default Re: Parentheses


    > Tom Kinzer wrote:
    > >
    > > as a matter of style, i think always having them is nice for
    > > maintenance/readability.
    >
    > I may be wrong, but I think most Perl programmers would disagree.
    >
    > It may be nice for maintenance if your program is to be maintained
    > by a herd of Prolog programmers, but readability is certainly
    > reduced by redundant punctuation.
    >
    > while (<>) { print unless /^#/ }
    >
    Yeh, and the "that's two extra characters to type" police will get you
    too, not that I have been deputized into their gang. I don't like their
    mascot, $_, anyways....

    [url]http://danconia.org[/url]

    --
    Boycott the Sugar Bowl! You couldn't pay me to watch that game.
    Wiggins D Anconia Guest

Page 1 of 2 12 LastLast

Similar Threads

  1. format numbers with parentheses
    By Rob in forum ASP.NET Data Grid Control
    Replies: 0
    Last Post: November 4th, 05:00 PM
  2. Substitution and Text Within Parentheses
    By Addy in forum PERL Miscellaneous
    Replies: 2
    Last Post: August 26th, 01:15 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •