Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

(ichi) Re: Module naming problems, or time ill spent.

by ichimunki (Priest)
on Jun 12, 2002 at 22:55 UTC ( #174055=note: print w/replies, xml ) Need Help??

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

I've been spending a lot more time programming in Ruby lately, but I have OO Perl (and merlyn's 'perlboot' intro) to thank for having a hope in heck of doing OO anything. In Ruby or Perl, if my classes are specific to the application at hand, I would make that my namespace and then group functions or objects accordingly. Say my application was a tool for writing books, I'd make package names like BookMaster::TOC (for managing tables of contents), BookMaster::Chapter (for managing chapters), and BookMaster::DB (for interfacing with a DB).

Now, if I found that I had some general utility function that was important to me-- suppose I were making a linked list class to make it so I could store each paragraph in a chapter in a list that would be more efficient to insert and delete items from than a vanilla array, then I might look on CPAN and see if there is a fitting namespace, like List::* and then call my class List::Linked.

And just to soothe your naming concerns, there is a whole big section on naming variables and stuff in "Code Complete". So you're not the first person to take it seriously. :)

  • Comment on (ichi) Re: Module naming problems, or time ill spent.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://174055]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (7)
As of 2018-06-21 16:52 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (118 votes). Check out past polls.