Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: OO style question: how much information to hide?

by webfiend (Vicar)
on Jun 11, 2003 at 00:54 UTC ( #264924=note: print w/ replies, xml ) Need Help??


in reply to OO style question: how much information to hide?

The explicit delete ... if ... seems more readable to me, in a narrative sense. Somebody else taking a casual glance at the other chunk might be concerned that time was being spent deleting attributes from end tags. It wouldn't take them long to discover the truth of the matter, but it's still something in the back of their head.

On the other hand, perhaps you want a method besides as_is() for printing purposes? Maybe something like this:

sub cleaned_up { my $self = shift; $self->del_attr('font') if $self->is_start_tag; return $self->as_is; } ... print $token->cleaned_up;

Of course, this example could be modified for the realities of style and ... well ... reality :-)


Comment on Re: OO style question: how much information to hide?
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (15)
As of 2014-04-17 13:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (448 votes), past polls