Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Is this a simple, robust, and maintainable design?

by arkturuz (Curate)
on Feb 03, 2011 at 09:15 UTC ( #885929=note: print w/replies, xml ) Need Help??


in reply to Is this a simple, robust, and maintainable design?

I'd also appreciate some suggestions for improving the system.

I would suggest reversing the logic of variable names starting with 'NOT_'. It can be quite confusing to follow the logic once the whole system becomes pretty complex. So, why not name your states like 'CHECKED', 'VERIFIED', etc. and functions like 'is_checked', 'is_verified', etc. It's much easier to follow the reasoning, IMO. Notice that you don't have variables like 'NOT_BROKEN' or 'NOT_COMPLETE'.

  • Comment on Re: Is this a simple, robust, and maintainable design?

Replies are listed 'Best First'.
Re^2: Is this a simple, robust, and maintainable design?
by GrandFather (Sage) on Feb 03, 2011 at 19:56 UTC

    'Negating' the NOT states actually implies the next state. The negation of NOT_CHECKED to CHECKED actually makes CHECKED semantically the equivelent of NOT_VERIFIED. I'd change the sense by changing NOT_CHECKED to NEEDS_CHECK to retain the state but to avoid the seeming double negatives scattered through the code.

    True laziness is hard work
      That's pretty insightful. It would be a relatively easy change that would make everything much clearer.
Re^2: Is this a simple, robust, and maintainable design?
by neodon (Novice) on Feb 03, 2011 at 19:35 UTC
    I absolutely agree with you on this. Having negated attributes and then negating them again in conditions is pretty confusing. Thanks for pointing it out!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://885929]
help
Chatterbox?
[marto]: see Super Search
[MidLifeXis]: Project Admin, a while ago: "No, I would prefer you didn't close that ticket yet confirming $vendor's support process yet. Continue to periodically check back to see if it has changed."...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (9)
As of 2017-01-19 12:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (170 votes). Check out past polls.