Towards less side-effects

C++ has very little protections against side effects in programming. You’ve got const and that’s about it. And const doesn’t survive through pointers so there’s nothing to stop you from modifying other objects as you please. I like things that stop you from making mistakes. So I thought about how to introduce more things that would make it more difficult to have side-effects in your programming.

I’ve found that you can reduce the side effects in your code by being careful about which pieces of code get dt, and by making all globals const, so that you have to manually pass non-const refs around and make them conscious decisions.

Read the rest of this entry »