Y
Hacker News
new
|
ask
|
show
|
jobs
by
mbatanian
4896 days ago
jugs = 1; if (have eggs) { jugs = 12; }
Get a dozen, not a dozen more.
1 comments
T-hawk
4896 days ago
cart.addJugs(1); if (haveEggs) cart.addJugs(12);
Now the cart has 13 jugs.
link
wlesieutre
4896 days ago
I'd say that "get a dozen" implies "jugs = 12" and not "jugs += 12". If you wanted to get a dozen more, you'd say "get a dozen more"
link
pash
4896 days ago
This is why we don't program in English.
link
fnordfnordfnord
4896 days ago
And why it is so hard to write a good specification.
link
AndrewDucker
4896 days ago
"get a dozen" implies "jugs += 12"
link