Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 06 Apr 2010 11:36:12 -0700
From:      Chuck Swiger <cswiger@mac.com>
To:        "Randal L. Schwartz" <merlyn@stonehenge.com>
Cc:        FreeBSD - <freebsd-questions@freebsd.org>
Subject:   Re: perl qstn...
Message-ID:  <66F97B7C-9D27-452B-BCC8-30C960599AE0@mac.com>
In-Reply-To: <86k4sk1mle.fsf@red.stonehenge.com>
References:  <4BB8108A.9080104@FreeBSD.org> <1270371713.5861.98.camel@tao.thought.org> <86aatjnsts.fsf@red.stonehenge.com> <861vevnsow.fsf@red.stonehenge.com> <j2ya14066a01004040945z39191770k2f025752317fb14a@mail.gmail.com> <20100404163353.GA15198@guilt.hydra> <20100404201442.b456044e.freebsd@edvax.de> <o2oa14066a01004041148zd4ef8167q32b04d58daec8f9f@mail.gmail.com> <4BB9A5ED.3040309@infracaninophile.co.uk> <20100405173632.739a0c42@gumby.homeunix.com> <20100406015544.GA21119@guilt.hydra> <20100406132049.641b9edf@gumby.homeunix.com> <86wrwkiunp.fsf@red.stonehenge.com> <2EE33758-C39C-41DC-B6A8-B34CF6B3B25A@mac.com> <86k4sk1mle.fsf@red.stonehenge.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Apr 6, 2010, at 11:07 AM, Randal L. Schwartz wrote:
>> "Chuck" == Chuck Swiger <cswiger@mac.com> writes:
> Chuck> Let's suppose you want to display one message if debugging is
> Chuck> enabled, and a shorter message if it is not.
> 
> Then you wouldn't have used this construct.

If the construct isn't a good idea considering the most obvious change one might make to the code, I would conclude that it's probably never going to be a good idea to use such a thing.

Surely Perl source code shouldn't be considered as write-once, modify-never?

>>> If you don't like all this freedom, there's always Python. :)
> 
> Chuck> Yes, Perl lets you innovate a remarkable number of ways of
> Chuck> solving the same problem using syntax that varies from clean and
> Chuck> maintainable to constructs which even the original author won't
> Chuck> understand without effort a few months later.  It seems to be
> Chuck> uncommon for one to write unreadable Python code; I'm not sure
> Chuck> additional freedom to write obfuscated code would be as
> Chuck> beneficial as one may assume....
> 
> I call shenanigans: False dichotomy.

I agree: the assertion you've made that Python lacks freedom is a false dichotomy.  As we all know, any language which is adequately expressive can be used to write arbitrary code; much less languages which permit callouts or extension mechanisms to invoke native C/assembler/etc code.

If you really find an advantage in obfuscated syntax and regard it as representing more freedom, I won't argue that opinion with you directly, but instead ask that you demonstrate that this supposed freedom results in better code, ease of maintainability, etc:

> Perl has *many* options that are all clear and readable, and some
> that aren't.  Python has a *few* options that are all clear and
> readable, and some that aren't.

...and an example or two would be?

> You may not appreciate that freedom.  Others do.  With freedom comes
> responsibility.  If that's not for you, Perl's not for you.

I would suggest that good software not only allows the user the full freedom to do anything which is possible, it should also avoid asking the user about choices which are impossible/invalid/wrong/etc.  This can be input field validation, middleware logic, this can be determining the present state and greying out options which are not currently applicable, etc.

Regards,
-- 
-Chuck




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?66F97B7C-9D27-452B-BCC8-30C960599AE0>