My baker’s percentage script has reached the point of being quite useful, but the code is currently a mess because I was exploring the problem space as I went (“code-doodling”). The grams-to-volume conversion has shaped up nicely, after the initial hurdle of dealing with the limitations of floating-point numbers; I’d input “2 pounds”, convert it to grams, and then convert it back to “1 pound 16 ounces”. After a few failed fudge factors, I decided to simply multiply the weight by 1.0001, which is just enough to flip the right bits without skewing the results.
My solution to the excessive-precision problem (“1/3 cup + 1 tbsp + 1/2 tsp + 1/16 tsp”) was to cut it off when the residue is less than 1/16 of the total weight. That is, if you need a full cup of something, you don’t care about adding something smaller than a tablespoon. I’ve considered adding “scant”, “rounded”, and “heaping” modifiers, but then I’d have to track which ingredients are liquid, because a heaping tablespoon of olive oil is… “messy”. I also decided that 1/16 tsp is so tiny that it’s not worth printing unless it’s the only measure (which means it usually only shows up for strong powdered ingredients or scaled-down recipes).
Why convert back to volume measurements in the first place? Because they’re a lot faster, and at home bread-baking sizes, only the flour really has to be weighed for consistent results. Bulky ingredients like seeds, nuts, raisins, or chocolate chips should be weighed, but won’t break the recipe if they’re off a bit. Water and milk are fine if you actually have decent measuring cups (I replaced my hit-or-miss glass ones with OXO’s squeezable silicone cups, which are accurate and pour better).
The three remaining features I want to add are conversion to/from tangzhong/yudane, scaling to preset sizes like “six large hamburger buns”, and slightly tweaking relative proportions while keeping the total weight constant, so you don’t end up with something like 1.2 eggs. The last one is the hardest, because it breaks the currently linear flow of the script, so I’ll have to create some objects and methods to encapsulate everything.
Then comes the web version, which will initially just be a standard POSTed form with pulldown menus for ingredients. Kind of messy, since I’m up to 100 distinct ingredients, and I’ll need an option for custom ingredients. I could go all AJAX-y on it, but I’m getting better at recognizing epicycles before I start working on them.
Here’s sample output for King Arthur Flour’s Japanese Milk Bread, that uses a tangzhong starter for softness and improved shelf life. They’re definitely soft, although I’ve never had a batch last long enough to test shelf life…
Ingredients 15.0g bread flour (2 tbsp) -- tangzhong 44.4g water (3 tbsp) -- tangzhong 45.0g whole milk (3 tbsp) -- tangzhong 120.0g whole milk (1/2 cup) 56.7g unsalted butter, melted (4 tbsp) 50.0g large egg (1) 17.5g baker's dried milk (2 tbsp) 49.5g sugar (1/4 cup) 6.0g salt (1 tsp) 300.0g bread flour (2 1/2 cup) 9.3g instant yeast (1 tbsp) Type Grams Baker's Percentage ---- ----- ------------------ TOTAL 713.5 226.5% 1 pound 9 ounces flour 315.0 100.0% water 236.6 75.1% salt 6.0 1.9% yeast 9.3 3.0% (>1.5% too much?) fat 55.4 17.6% sugar 49.5 15.7% sweet (use sugar-tolerant yeast) egg 50.0 15.9% tangzhong 104.4 33.1% 4.8% of flour, 1:5.6 ratio
You can see from the comments that they significantly increased the yeast to compensate for the high sugar content. Also, despite the high hydration, this isn’t a sticky dough, nor does it produce the sort of airy, irregular crumb that you’d expect, because much of the extra liquid is captured in the tangzhong (which is the whole point).
Markdown formatting and simple HTML accepted.
Sometimes you have to double-click to enter text in the form (interaction between Isso and Bootstrap?). Tab is more reliable.