Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Perl Advocacy > Re: Its time we...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 52 of 88
Post > Topic >>

Re: Its time we set the score straight on Perl 5 and Perl 6 and

by lembark@[EMAIL PROTECTED] (Steven Lembark) Jun 18, 2006 at 02:31 PM

-- John Adams <jadams01@[EMAIL PROTECTED]
>

> First, let me admit that I'd probably write that line like this:
>
>      open(my $fh, '<', $file) || die "The file $file could not be
opened:
> $!";
>
> The parens around the argument to die adds neither meaning nor ease of
> comprehension; the parens around the arguments to open do add to ease of
> comprehension. (I think. It'd be nice to see an actual experiment
> performed to evaluate my opinion.)

Then why not require them around die?

One advantage to perl's syntax in this area is that you
can avoid heavily-nested parens -- where determining the
nesting level actually takes away from the meaning.

Why would:

    open my $fh, '<', $path
    or die "Roadkill: $! ($path)""

be all that confusing?

> although I could make an argument for it. What I am saying is that "it's
> easier for me" is a bogus argument.

Up to the point where the syntax-load interferes with
people writing code.

One advantage to Perl's syntax is that the paren's can
be included where necessary -- or edited in later if
anyone finds that refactoring useful. The difference
with Perl over most of, say, Python is that someone
has the freedom to make decisions. Obviously, working
in a group requires negotiating. But if people don't
take the time to agree on coding standards then that
is not a fault of Perl.



-- 
Steven Lembark                                       85-09 90th Street
Workhorse Computing                                Woodhaven, NY 11421
lembark@[EMAIL PROTECTED]
                                     1 888 359 3508




 1 Posts in Topic:
Re: Its time we set the score straight on Perl 5 and Perl 6 and
lembark@[EMAIL PROTECTED]  2006-06-18 14:31:32 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu May 15 1:24:15 CDT 2008.