[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] Eliminating whitespace does not usefully shorten code



>>>>> "AC" == Aaron Crane <aaron.crane@pobox.com> writes:

    AC> Given that I recently wrote a brief article to FWP suggesting
    AC> a shorter version of a one-liner by John Porter, and counting
    AC> characters in his version and mine, I have to assume that
    AC> these comments are directed at least partially at me.

It was directed at large, but, yes, your post prompted me to write.

    AC> I entirely agree that production code is best optimized for
    AC> maintainability, and in almost all situations I do so as a
    AC> matter of course.  Sometimes this has the same effect as
    AC> optimizing for shorter code, but not always.

Yes. Most of the time, the simpler, more maintainable code is also
shorter.

    AC> But I would also point out that there are situations where
    AC> there is value in being obscure -- and this is precisely the
    AC> point of, say, the Obfuscated Perl contest.

It seems to me that OPC type activities are the _only_ places where
obfuscation should be used.

    AC> Now, I don't
    AC> claim to be able to write JAPHs or Obfuscated Perl entries.
    AC> But I do enjoy trying to decode them -- it's a challenging
    AC> puzzle.

I also enjoy trying to solve JAPHs and OPC entries (I also like to
have explanations of them handy when I give up ;-). They are great
exercises to test my understanding of little used (by me anyway)
language features.

    AC>   I claim that the same sort of fun can be found in
    AC> searching for another Way To Do It, especially if unusual
    AC> constraints (such as low character count) are placed on the
    AC> result of the search.  And after all, last time I checked,
    AC> this mailing list was for Fun With Perl.

One of the reasons why I like this list is precisely the fact that so
many different approaches to solving a given (usually fun) problem are
explored.  But for me, the lack of whitespace exemplified by the two
code lines in your post is just an obstacle that must be overcome
before the fun starts and the real merits of the proposed solutions
can be compared.

-- 
Luc St-Louis  <lucs@cam.org>

==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe