Typing system vs. Java

xauau xauau at yahoo.com.au
Sat Aug 4 09:14:08 CEST 2001


Courageous <jkraska1 at san.rr.com> writes:

> [...] I've concluded  that comprehensible tersness trumps all
> other measures of merit.

Sounds good to me, Joe.
 
> I believe that there is a sort of Occam's Razor of Coding, as it were,
> where given two different programs which execute identically, the one
> which is shorter, simpler, and easier to understand is the better
> program, notwithstanding any principles it may or may not adhere to.
>
> Various different rules which have crept up over the years such as
> "don't use global variables," and "practice strong encapsulation,"
> and so forth are all only distractions and are useless to the degree
> that in any particular context they don't satisfy Sir Occam's relentless
> blade.

I've also been thinking similar thoughts for some time. I regularly
see people going to extreme lengths to protect themselves from
themselves. It often fails because it adds unnecessary bulk and
complexity in exchange for the false sense of security that following
a method brings with it.

Take "information hiding" as one small example. In theory it's
reasonable that _some_ data should be encapsulated and accessed only
through strictly defined interfaces. In practice, though, it's often a
case of interring trivial functionality deep inside a perilously
constructed wall of cruft.

I've seen lots of C++ and Java programs that really should have been
very simple and clean. They end up being complicated because the
majority of the program consists of small pieces of simple
functionality trying desperately to contact each other through nearly
impenetrable walls of "protection". When you're not in the mood to
laugh at it, it's a truly pitiful spectacle.

-- 
         And there's a dreadful law here -- it was made
     by mistake, but there it is -- that if anyone asks
                     for machinery they have to have it
                                   and keep on using it.



More information about the Python-list mailing list