I know for the vets this has been discussed to death, but for the newer people I wanted to share. I set out yesterday to replace an if statement based on a boolean flag; I was convinced there was a better way.. And there was, but it took some mind twisting to get there. I learned a lot of really really important programing
Philosophy that I'd sort of been foggy on previously. Granted it might have been overkill but I wanted understand the concept so I was ok with the simplistic usage.
The last code block in
this first post gives a really great example of a very simplistic implementation of the idea. More importantly, I watched the Google Clean Code talk video (which is linked in the post right above the code I am referencing) and that really blew my mind. I had to watch it several times understand the specifics. Definitely worth the effort though.
Hope this is helpful to people.