If you’ve done any work – or even any reading – on object-oriented programming, then you’ve likely come across the idea of immutability. That is the idea of something being unchanging.
Sometimes you can have immutable values, and sometimes you can have immutable objects (at least after they are instantiated).

The opposite of immutable (but he was my favorite ninja turtle, anyway).
The thing is, the more I work with object-oriented code, the less I tend to work with immutable variables. Sure, I’ll use constants as defined in a configuration file, but you’re not likely to find me storing values within a class as a const.
That probably implies something about me and my abilities, but it’s true. Thankfully, code reviews are great at helping you see opportunities on where to leverage strategies you normally wouldn’t. And such is the case with immutable values in WordPress plugins.
Of course, this is one of those things that was brought to my attention by a friend when reviewing my code.



