Re: Its time we set the score straight on Perl 5 and Perl 6 and debunk our own self generated FUD.
[email protected] (Steven Lembark)
| Newsgroups | perl.advocacy |
|---|---|
| Message-ID | <8024CF0F775D93516D8DBAD1@[192.168.1.2]> |
-- John Adams <[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 [email protected] 1 888 359 3508