'For the things we have to learn before we can do them,

Posted by Karl Benbeneck on November 12, 2019

we learn by doing them.’ -Aristotle

As I struggle to find a comfortable learning environment, I’m holding onto my goal of designing my own program that will make it easy for vegan-curious users to experiment. I also envision this program being able to generate templates for targeted plant consumption with specific nutrients and absolute balance in mind. I am talking about shopping lists and meal planning.

With my current novice understanding of coding, I can begin to conceptualize my nutritional program by considering inheritance. Every gram of food contains a proportionate amount of calories. One could write a NutritionalFacts class that contains methods to convert grams of nutrients to calories and daily value percentages.

Now imagine a CookingAffects class that contains methods that consider estimated vitamin loss during the cooking process. This class could contain a boil method that returns an updated diminished vitamin quantity. Maybe a Synergies class could highlight positive pairings in each meal. When meals contain a minimum amount of vitamin C and iron, the method could put “Consuming foods rich in vitamin C amplify iron absorption.”

Because diets are forever evolving, my program would need to be adjustable. Pretend one wanted to follow the Mediterranean diet. The users target macronutrient ratios would aim to equal 40% fats, 20% protein and 40% carbohydrates. A MediterraneanDiet class would inherit the NutritionalFacts behaviors but it would then overwrite daily value percentages for said macronutrients.

I am not at the point where I can execute such a program, but my gears are turning as I reacquaint myself with learn.co. I am a believer that there is always an easier or more refined approach, but I need to better grasp the fundamentals. Continuing to find a practical, real world use for coding is going to elevate my skills to the next level and I am up for the challenge.