PBP: 056 Localizing Punctuation Variables

The PBP suggests using local on any changes to one of the global punctuation variables.

This is a really good idea, because any change you make to those is probably a change any other piece of code isn’t expecting and who knows what it might do.  Your code inadvertently screwing up other code is never good.  And it isn’t the other code’s fault.

This isn’t a hard and fast rule.  Sometimes you’re messing with those variables because you want to change the behavior of the system as a whole.  You wouldn’t want to localize those.  Do that deliberately, though, and don’t just scribble all over the rest of the system carelessly.

 

Leave a Reply