in reply to Module naming problems, or time ill spent.

Clearly there are Perlish way to do things when you code in Perl and Java'ish way to do things when you code in Java. While there might be common paradigms (we should remember that Perl is a compilation of various 'better' practices initially introduced in other languages), I feel for the most time it is best to not run across the border too much.

Having said that, I don't think it's a good idea to wrap any tiny Perl script around a bunch of OO objects. There is a time and place for every approach. Java, however, was so designed as to rely heavily on OO and work in that 'framework'. Unlike Perl, in Java existence outside an object/class is not possible. In many aspects I sympathize with this approach. On the other hand, however, the task of devising proper OO structures for every little problem/script is at times daunting.

Speaking of naming, I recall it is a norm to see Java packages named as 'so.and.so.and.such' - basically, have multiple nested packages/classes. Whereas this works for Java, I don't see this deep nesting being useful in Perl. This partly stems from the fact that in Perl the number of 'core' objects is significantly less. Instead, in Java, everywhere you look is an object. Hence, the complex package naming scheme. A similar approach in Perl is simply not warranted. The need for a similar naming convention was engineered out of Perl (it doesn't rely as heavily on objects and etc).

_____________________
# Under Construction

Replies are listed 'Best First'.
Re: Re: Module naming problems, or time ill spent.
by lachoy (Parson) on Jun 13, 2002 at 01:34 UTC

    Regarding nested packages: I've actually seen more nesting in Perl packages than in Java ones. For instance, the java.io package has a twisty maze of relationships but all the classes are in the same package.

    One of the features making java package names a little longer is that by convention they're organized so nobody will step on any other namespace. You do this by organizing your code under your reversed domain name. So I work at optiron.com; our code is all under the com.optiron hierarchy. So before you've even applied logic you're two levels deep!

    That said, IME once you get to four deep you start getting the hacker equivalent of deep sea diving pressure, forcing you back up the tree to lighter waters :-)

    Chris
    M-x auto-bs-mode