Hacker News new | ask | show | jobs
by roel_v 1092 days ago
"No! Handle units! @milk{4%cup} should be trivially convertible to liters"

No! That's silly and it's not how cooking works! This way you get stupid recipes like on American cooking Youtube channels that just run their volumetric measurements through a converter and end up with recipes that call for 234 grams of flour, 13.5 grams of this or that spice and 78 ml of whatever. Recipes are (well, should be) tuned to the measurement system they use, and packaging availability in the area it targets, so that you get recipes that use e.g. 400ml of coconut milk (because that's the most common can size around here), whole numbers in amounts of ingredients etc. Converting between units in cooking and baking is not simply using a unit conversion calculator on your phone!

(and that's not even mentioning that there are UK, Australian and US cups, tablespoons and teaspoons)

1 comments

There's a simple and obviously correct answer to this problem: the markup language should support only standard SI and conversions to weird Angloamerican units should be made from those base units.
The direction of conversion doesn't matter. If a recipe starts out with 300 gr of flour, and that gets converted into 1 3/4 cups + 2 tbsp, that's useless (or at least silly and cumbersome) for an imperial unit user. The whole recipe needs to be recalibrated to use imperial units, and that conversion needs to take culture (I should probably say 'locale', I'm not sure what the right term is here) into account, so that it would use 'sticks of butter' in the US and 'grams of butter' in Australia. I don't think this conversion can be automated.

My point is - recipes cannot be converted easily between unit systems. There is more to converting a recipe than applying a ratio table.