Skip to content

reason #432 why I love Moose, smart = easy

Moose gives you the tools to code in a very very clean and standard manner. It does not inhibit you from being dumb, but it makes being smart very easy. Let me give you an example.

For work we have a Type for our product id’s, it is just a few lines of code but in allows us to have all our objects know before they do anything that they have a valid id. Well a co-worker noticed this morning that the validation was overly strict, we would (correctly) fail if the id included leading or trailing white space.

Not a huge problem to solve, but why have every object do it’s own cleaning? Sure you could have a central place for the code, but what I really want is to never have to worry about this at all, and we already have a central choke point. So lets head back to that type that is already being cohersed… so why not do the change there, wait there is no reason not to.

5 minutes later we’re back up and running, no muss, no fuss. Moose, a good toolkit is makes doing the right thing easy, and you end up with an OO system for free =).

Thanks again team #moose.

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*