Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

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

by ichimunki (Priest)
on Jun 12, 2002 at 22:55 UTC ( [id://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?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://174055]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (5)
As of 2024-04-20 00:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found