more useful options | |
PerlMonks |
I feel a motto coming on...by japhy (Canon) |
on Jan 13, 2002 at 21:54 UTC ( [id://138443]=perlmeditation: print w/replies, xml ) | Need Help?? |
I'm curious what my brethren (and sisthren) feel of the motto Make Perl yours, without taking it away from others.
I came up with it after seattlejohn thanked me for my code. He said "seriously, your code does some really slick stuff to make it easier for the caller, which i really like..." This statement prompted me to think of what I'd done. I'd allowed the module to be used very simply: instead of the clunky: I'd used Perl to my advantage to create a pseudo-syntax (thanks to the "&" prototype). The code is easy to read and makes sense with little explanation. The fact that you can use the variable you're watching in the assertion-function itself is nifty. So my motto means "make things easy for yourself, while keeping them easy for other people too." Don't use convoluted syntax because you can (that doesn't mean "don't use idioms") or because it shows you're elite. Use syntax that you are proud of, and that other people can appreciate. It is to that end that I created a module (to be released soon) called Tie::Array::Unique -- it ensures the elements of an array are unique, so you don't need to keep track with a hash (it does it for you). Tie-modules are a very good example of this motto. They keep the icky internals away from the implementation, and produce a syntax that is quite normal (since it's just overloading the standard operations on data structures). So that's my motto. Any feelings? Any personal mottos out there for the sharing?
_____________________________________________________
Back to
Meditations
|
|