Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
groby_b
on Jan 24, 2013
|
parent
|
context
|
favorite
| on:
Computer programming is somewhat like getting an i...
Seriously? An ancient programming joke, with a gratuitous off-by-one error?
chimeracoder
on Jan 24, 2013
[–]
It's not gratuitous. One jug + one dozen = 13 jugs.
mbatanian
on Jan 24, 2013
|
parent
[–]
jugs = 1; if (have eggs) { jugs = 12; }
Get a dozen, not a dozen more.
T-hawk
on Jan 24, 2013
|
root
|
parent
[–]
cart.addJugs(1); if (haveEggs) cart.addJugs(12);
Now the cart has 13 jugs.
wlesieutre
on Jan 24, 2013
|
root
|
parent
[–]
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"
pash
on Jan 24, 2013
|
root
|
parent
|
next
[–]
This is why we don't program in English.
fnordfnordfnord
on Jan 24, 2013
|
root
|
parent
|
next
[–]
And why it is so hard to write a good specification.
AndrewDucker
on Jan 25, 2013
|
root
|
parent
|
prev
[–]
"get a dozen" implies "jugs += 12"
Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: