Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re: OO style question: how much information to hide? (allow simple code)

by tye (Sage)
on Jun 11, 2003 at 15:29 UTC ( #265077=note: print w/replies, xml ) Need Help??

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

I'd say that being able to write simpler code is a win. So:

  • Don't die nor warn (by default) on "deleting" a non-existant tag (even if there is some reason that it should be "impossible" for the tag to exist, such as the token being an end tag)
  • Have the "delete" method return what was deleted (just like delete does)
  • Have "add attribute" complain for end tags
So I could certainly see value in having an optional complaint emitted if you try to delete attributes from end tags (for those who want to detect if they are being "sloppy" in this respect as a check on the validity of their code). But I don't think that should be the default (in a module with "Simple" in the name).

                - tye
  • Comment on Re: OO style question: how much information to hide? (allow simple code)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://265077]
[davido]: I read a post or two most mornings before diving into code at work but don't post as often anymore... too much going on in life
[Corion]: Hi davido, Discipulus :)
[davido]: Howdy
[davido]: What shall we do about the Google https issue?
[davido]: Probably need to get a cert for the site to maintain our ranking, and update all generated links including in posts to https
[davido]: Make our self-referencing id:// tags generate https links for example
[davido]: Even redirect to https

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (3)
As of 2018-02-23 07:57 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (300 votes). Check out past polls.