thinkle / gourmet

Gourmet Recipe Manager
GNU General Public License v2.0
339 stars 137 forks source link

Unit Conversion Inaccuracies and User Notification #148

Open ockham opened 11 years ago

ockham commented 11 years ago

Converted from SourceForge issue 2544498, submitted by SourceForge user dimethicone on 2009-01-29 02:54:12 UTC.

Gourmet can translate imperial measurements to metric. In conversion it says that "1 cups" = 236.52 mL". Recipes are usually more about ideas than exacting directions; this may be baking a loaf of bread, not synthesizing rocket fuel. Still, someone in England may use a recipe that calls for five cups of flour, convert it to metric, and sees the unqualified American 1182.6mL of flour. An English recipe is more likely to be using the 284mL "cup" unit, which would lead to 1420mL than the American unit. A difference of 237mL here makes that just over six cups of flour instead of five. Such a mistake would likely be encountered in baking, and that missing cup of flour or adding one extra would likely ruin a baking recipe. I use the "cup" exemplar since it is a difficult relevant unit since it differs in the USA versus the UK (250mL), as well as the Imperial 284mL unit. This occurs often in these measurements. The teaspoon was originally 3.55mL, but is now standard in India/Australia/Canada/NewZealand/UK as 5mL, and is 5mL by law in the USA (21CFR101.9(b)(5)(viii), mentioned in the Wiki for Teaspoon). Gourmet converts 1 tsp to the traditional American 4.93mL without mentioning the vagueness of the measurement itself.

We clearly don't need perfect mathematical precision in recipes. As shown in the cups example though, the current imprecision can easily be significant enough to ruin a recipe. Since Gourmet currently converts measurements within recipes permanently, requiring the change be saved before the recipe card will show the updated value, this imprecision can then ruin recipes permanently. It makes any unit conversion problematic. My suggestion is that Gourmet should notify the user of the vagueness of the measurement conversion, and could add the option of using the (obsolete) English units for conversion, the traditional American ones, or the modern standard redefinitions of the traditional terms. An option could set this permanently, such as a simple "Always assume: traditional American units / traditional English units / Modern units", or such an option enabled per recipe, or through some sort of recipe origin tag (this last one is overly complex unless it has other uses). Lots of applications implement such options well with "Don't ask again" type checkboxes. If asked on every vague conversion, the notification would be annoying, but a single one is informative, potentially crucial for success, and knowledge is power.

ockham commented 11 years ago

Submitted by SourceForge user dimethicone on 2009-01-29 04:57:35 UTC.

I'm told by Thomas Hinkle that "these things are all defined in the defaults_XX file for a given locale. Simply by using a British locale, etc., you should be able to get the right units for your locality". Gourmet then is aware of the vague measurements, but I still think the user isn't.

In Windows or Linux, if Gourmet checks the systemwide region option and acts accordingly, that's great. I've never personalized that setting, but it is a good practice to respect the system setting. Still, Windows at least offers the setting to change "how some programs format numbers" rather than change what the numbers are.

I live in Canada (my system is set to English United States out of laziness). My ancestors were immigrants from Europe, so their recipes use pre-metric British Imperial units. After metrification in the 70's (also effective in the USA industry, outside the public view), Canadians still use American Imperial (and now post-metric imperial) measurements in cooking because of the influence of American culture, though recipes from companies offer metric units as well. I mostly learned metric in school (and some Imperial so that I wouldn't understand either system), but all modern recipes I get are usually American Imperial, while my stacks of old recipes are often British Imperial. Definitions of old units are still being redefined, as in the teaspoon example (eg. is it an imperial teaspoon, pre-metric american teaspoon, or 2004 American teaspoon). This all affects me directly in cooking, since it's a nightmare and I don't know what I'm doing ;-)

In the cups example, the conversion error can be significant. Since a person may have recipes from multiple locales, from multiple times, and the nonmetric unit amounts are still in flux, I don't believe the locale setting is sufficient or even noticeable. I had no clue that any non-MSOffice program respected it, especially not for altering calculations, but even then I can't use a single locale to accommodate various recipes. It's awesome that the functionality is hidden there already, but I can't make use of it. On the Internet, people share recipes daily from all over the world and from every locale, so I think this is relevant to everyone even though it's boring. If we could tell one recipe to convert entirely from Imperial British to Metric (as I would in feature suggestion #2544516), while telling another to convert from American units, there couldn't be inaccuracies. If implementation is just too difficult or annoying, an asterisk and note somewhere during conversion could save some recipes. I don't think many people know that the old measurements have different sizes around the world and are changing. Other than occasionally redefining units to physical/mathematical constants with infinitesimally minuscule differences (eg. the meter and second units), metric units aren't changing and are the same everywhere.