State of Mind

Thursday 7 January 2016 at 08:30 GMT

On 30th December, I started a diet and exercise plan, because what the hell, it's New Year's and I'd been pigging out for the entire month on barbecue and beer Down Under. It's really simple, but there's a bit of a twist.

The plan is as follows:

  1. No sweets or processed sugar.
  2. No bread or pasta.
  3. No meat.
  4. Exercise a little bit every day.
  5. Run, climb or cycle a couple of times a week.

Simple, right? I'm using The Johnson & Johnson Official 7 Minute Workout app to give me an 8–10 minute workout in the mornings, and next week I'm gonna start on step #5, as this one, for family reasons, is pretty packed and I'm not spending much time at home.

The reason it's a little different is because I don't mind failing. I had a sandwich for lunch on Sunday, I've had fish a few times and I'm sure I'll cave and eat a chocolate bar at some point soon. Plus, it's my birthday in a few days and if you think I'm going to step away from cake, you're joking.

Failing isn't the problem. Not picking yourself up and trying again is.

It reminds me of object calisthenics. I fully recommend clicking the link and reading the entire document, but to summarise, object calisthenics are a set of rules to apply in order to write object-oriented code. They are:

  1. One level of indentation per method
  2. Don't use the else keyword
  3. Wrap all primitives, including strings
  4. First-class collections
  5. One dot per line
  6. Don't abbreviate
  7. Keep all entities small
  8. No classes with more than two instance variables
  9. No getters/setters/properties

If you've tried them, you'll know that writing anything while following these rules takes forever and ends up with fairly ugly code. However, if you opt to break them in a couple of situations, you'll find that your code is very easy to understand.

The point of object calisthenics, after you've tried it a few times, is not to be set of rules you must follow. It's to help you understand when you're following object-oriented principles and when you're not. Now, when I write a getter in Java code, an alarm goes off in my mind, and I seriously consider removing it again until I can come up with a good reason.

Object calisthenics isn't a set of rules. It's a state of mind.

So this is what I'm trying to achieve with my new year's resolutions. The point is not to follow them to the letter. The point is to internalise them to the point that when I see chocolate, I don't think "Yum!" because it only takes a quarter of a second for it to be in my mouth, but "huh, chocolate… maybe tomorrow". When I wake up, I want to think, "time to work out", not "time to go back to sleep". If I mess up once or twice, it doesn't matter. More to the point, if I actively decide that I want some chocolate, that's not a problem. The next day, it won't affect my mentality.

I don't expect to stop this diet or exercise regime at some point. I expect to get to the point where I don't think about it any more.


If you enjoyed this post, you can subscribe to this blog using Atom.

Maybe you have something to say. You can email me or toot at me. I love feedback. I also love gigantic compliments, so please send those too.

Please feel free to share this on any and all good social networks.

This article is licensed under the Creative Commons Attribution 4.0 International Public License (CC-BY-4.0).