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

elegance vs. one-lineness (Was: quick scripting question - finding occurrence in many lines)



Douglas Tutty wrote:
> After thinking about it, yes it can all go in one line.  Its more
> elegant and doesn't use up memory space but its harder to read to
> understand what its doing.

    Depends on what you define as elegant.  I dropped Perl several years ago
in preference to Python because I found Python's verbosity and clean syntax
more elegant than Perl's ability to cram tons of stuff on a single line.
While, as this shows, Python can suffer from the same problem of one-line-itus
 it takes work to do it.  :)

    Sometimes I do lament the fact that Python is creeping into Perl's
TIMTOWDI at least in Python's case it is often a difference of a explicit
method call (if foo.has_key(bar):) and a language specific way to call that
method which reads much nicer (if bar in foo).

-- 
         Steve C. Lamb         | But who decides what they dream?
       PGP Key: 8B6E99C5       |   And dream I do...
-------------------------------+---------------------------------------------

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: