4 ms·
It says "true" for any ingredient it doesn't have in its list (I tried lamb, goats milk, and sausage – all are reported to be vegan). It would make more sense
by callumlocke 9y ago
It says "true" for any ingredient it doesn't have in its list (I tried lamb, goats milk, and sausage – all are reported to be vegan).
It would make more sense to just release the JSON list of known non-vegan ingredients. People can use Array#filter and Array#some themselves.
EDIT: it says these are all vegan too: steak, bacon, ham, pheasant, venison, cheddar, mozzarella, ghee, lactic acid, sour cream.
- masklinn 9y ago> t says "true" for any ingredient it doesn't have in its list (I tried lamb, goats milk, and sausage – all are reported to be vegan). Hence the title specifically noting it uses a blacklist.
- callumlocke 9y agoThe HN post says uses the word blacklist, but the library itself works like this: isVegan.isVeganIngredient('ham'); // true
- travisjungroth 9y agoSeems like a pretty glaring test case...
- hmontazeri 9y agoham is a product. pork would be the ingredient which is on the list...
- contravariant 9y agoAccording to the website they're linking to, ham can also be an ingredient. Although technically I couldn't find a reference to 'HAM', but rather 'HAM (CURED WITH HONEY, SALT, SUGAR, WATER, DEXTROSE, LACTIC ACID STARTER CULTURE, SODIUM ASCORBATE, SODIUM NITRITE)' [0] [0]:https://ndb.nal.usda.gov/ndb/foods/show/82389 https://ndb.nal.usda.gov/ndb/foods/show/82389
- masklinn 9y agoYes, because it has a blacklist: it has a list of non-vegan ingredients and assumes everything else passes. If it had a whitelist, it might tell you that spinach is not vegan instead. With both, it might tell you that both spinach and ham are ?.
- callumlocke 9y agoI know what a blacklist is. Nothing wrong with a blacklist. The problem is that the function is called "isVeganIngredient", and it returns true for "ham".
- ytog 9y agoYes, and that is because of the blacklist. A blacklist can only answer if something is on the list. One could either claim that the function should never return true or that returning true is correct, but the accuracy is unknown.
- masklinn 9y ago> I know what a blacklist is. Nothing wrong with a blacklist. The problem is that the function is called "isVeganIngredient", and it returns true for "ham". If you "know what a blacklist is", how can you fail to understand that it returns true for ham because it's a blacklist and thus assumes any missing item is OK? Even if they add "ham" to the list, you'll always be able to find stuff that's not on the blacklist, because that's how blacklists work. Hákarl? Not on the blacklist, will be marked as vegan. Whale? Not on the blacklist, will be marked as vegan. Pizzle? Not on the blacklist, will be marked as vegan. A blacklist means you'll have false negatives (items will pass which should not), and a whitelist means you'll have false positives (items will be flagged which should not). If you can't actually test properties, the only question you're left with is which failure mode is preferrable, but it's one or the other. And in my opinion, things which have to do with health or safety are the latter (you'd rather avoid something which turns out to be safe than allow something which is not).
- callumlocke 9y ago
- deleted 9y ago[deleted]
- upvotinglurker 9y agoIt looks like someone is paying attention to this thread, since all these terms are on the blacklist now. However, I had wondered if the author's original intention mainly was to help cooks make a determination about non-obvious ingredients. Anyone with a basic grasp of the concept of veganism probably already knows that steak, bacon, ham, pheasant, venison, cheddar, mozzarella, ghee, lactic acid, sour cream aren't vegan. Not so "isopropyl myristate" or "laneth-10" (to pick a couple of random ones from the list), and that seems like the tool's area of greatest potential utility.