Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

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 :-)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://264924]
and the daffodils sway...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2018-03-24 18:50 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (299 votes). Check out past polls.