January 11, 2016

Get Fit with CLJS - Calculate Your BMR

Over the holidays, I read John Sonmez's book "Soft Skills: The software developer's life manual". It was a great summary of a lot of familiar ideas I've read about in other personal development books. And it was neat that it was specifically geared toward software developers.

In the book, John devotes an entire section to Fitness. He gives excellent reasons that software developers should work to improve their health and fitness.

I feel that Fitness and Health are very important aspects of life and by spending some conscious effort, you can make a positive impact on your physical health.

One good place to start is to know how many calories your body will burn in a day. The first step to estimating this, is to calculate your Basal Metabolic Rate (BMR).

Basal Metabolic Rate (BMR)

The amount of energy (in the form of calories) that the body needs to function while resting for 24 hours is known as the basal metabolic rate, or BMR. This number of calories reflects how much energy your body requires to support vital body functions if, hypothetically, you were resting in bed for an entire day [1].

There are a few ways to calculate your BMR, one of which is called the The Mifflin St Jeor Equation. Here are the equations:

  For men: BMR = 10 x weight (kg) + 6.25 x height (cm) – 5 x age (years) + 5
For women: BMR = 10 x weight (kg) + 6.25 x height (cm) – 5 x age (years) – 161

Now, of course, I could just reuse one of the dozens of calculators found on the Internet. But why would I do that when there's clojurescript! Here's the working calculator that I built using clojurescript and devcards, try it out yourself:

The Mifflin St Jeor BMR Calculator

For more details, check out this page for a deep dive into the actual source code that is powering that calculator.


[1] http://dailyburn.com/life/health/how-to-calculate-bmr

Tags: clojure software clojurescript