develooper Front page | perl.perl5.porters | Postings from January 2008

Re: 5.11 (or 12) and strict

Thread Previous | Thread Next
Michael G Schwern
January 3, 2008 06:40
Re: 5.11 (or 12) and strict
Message ID:
Sean O'Rourke wrote:
> Strictures are a good idea in some places, like in larger
> programs, and more trouble than they're worth in others, like an
> interactive REPL.  (For Matlab users, imagine if it had strict at
> the prompt.)

I would imagine the REPL implementors would just turn strict off before
eval'ing the interactive bits.  That is and will remain trivial.

Even then, you only want to turn off one aspect of stricture, vars, as there's
no little reason for symbolic refs in a REPL and no way to post-declare a

		no strict 'vars';
		eval $code;

More pragmatically, for every line of Perl code that's implementing a REPL I'm
sure there's about one hundred thousand that isn't.

> I don't find this all that "interesting," at least not in the
> sense you seem to mean here.  Languages that force you to program
> in a particular way are crippling: OO may be "good", but Java's
> forcing everything to be an object is not.  Functional
> programming may be "good", but Haskell's mandatory purity can be
> a pain.  Perl, like Lisp, tries to let you program in as many
> ways as possible, without forcing you to program in any
> particular way.

There seems to be some sense of scale lacking here or some sort of qualitative
measurement.  Declaring variables falls anywhere near the scale of Java's
OO-only or Haskell's functional purity restrictions.  Furthermore, OO and
functional programming are generally regarded as good practice with
applicability to general programming problems.

I am somewhat preoccupied telling the laws of physics to shut up and sit down.
	-- Vaarsuvius, "Order of the Stick"

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About