« Aardvark and Bandicoot, Chapte... | Home | Aardvark and Bandicoot, Chapte... »

Aardvark and Bandicoot, Chapter 18

Wed 18 May 2016 by mskala Tags used: , , , ,

In which there is an Inquiry into What Counts, and into the Aardvark's Commitment to the Cause

[first chapter] | [all in this series]

Bandicoot: Friend Aardvark, I've got the module passing the test suite now!

Aardvark: Really?

B: Yes.

A: And it's really the module passing the test suite, not one of your school chums hiding inside the computer?

B: Uh-huh. Well, almost.

A: Oh, no. We've been through this, Friend Bandicoot. Our customers really need to be able to calculate all cases of addition, and they need to do it with the computer, running our software, not some kind of misdirection.

B: Oh, my latest version of the module does that, don't worry. It's just--

A: Just what?

B: Well, it requires a bit of special hardware.

A: What kind of "special hardware" do you need to add two and two correctly?

B: You need... <dramatic pause>this!

A: I wish you wouldn't add stage directions to your lines, Friend Bandicoot. It makes me feel like we're in a zoo.

B: Sorry, Friend Aardvark. Anyway, here, just help me hook it up to Friend Computer.

A: That's an awfully large box. Are you sure it doesn't contain like half a dozen koalas equipped with abacuses and Listerine, or something?

B: No, no, I learned my lesson last time. This is just a 1.18-zettabyte external hard drive.

A: A 1.18 what?

B: A 1.18-zettabyte external hard drive.

A: I see. So, exactly how many bytes does it hold?

B: I'm certainly not going to implement an extra optional double double double double double double double double double double double double double double double double double double double double double double double double double double double double double double double double double double double double double double double double double double double double double double double double double double double double double double double double double double double double double double double double double double double double double double feature just to find out!

A: That was, what, 70 "double"s?

B: Yes.

A: So, I can infer that it's 2^70 bytes?

B: Right.

A: Why-- no, never mind that, where did you get a hard drive that size?

B: Best Buy.

A: They just keep getting bigger. And smaller.

B: Yes.

A: All right. So, what happens now?

B: We run the test suite! Friend Computer?

Computer: New hardware detected. Enter administrative password.

B: Oh, hang on, I just have to set up the driver. This will only take a minute.

A: Yeah, I'll wait.

B: There!

C: READY

B: All right, here goes. Friend Computer, "make check".

C: Test 1, passed. Test 2, passed. Test 3, passed. Test 4, passed.

A: It looks good so far.

B: Yes, all the tests pass now.

C: Test 5, passed. Test 6, passed. Test 7, passed. Test 8, 10%.

B: I hate waiting for that one.

C: 20%... 30%... 40%...

A: Well, we want to make really sure.

C: 50%... 70%... 90%...

B: Yeah. And I guess the wait makes it more exciting.

C: 100%. All tests passed.

A: Now I want to try a few cases interactively.

B: Such a suspicious mind.

A: Friend Computer, "2+2".

C: 4.

B: I knew you'd pull that one first.

A: Friend Computer, "13+6".

C: 19.

A: "31-5".

C: 26.

A: "sin(30)"

C: -0.988031624

A: I don't think that's right.

B: It's in radians.

A: Oh, of course. Friend Computer, "sin(pi/6)".

C: SYNTAX ERROR

B: Sorry. Configurable feature. Friend Computer, "sin(tau/12)".

C: 0.5.

A: Well, I think we have to change the default for that regardless of your religious beliefs, but overall, I have to admit, the module seems to be correct.

B: Great! Now, can I work on something else at last?

A: Not so fast. I'm not happy about imposing this extra hardware requirement on all our customers, that's really not going to sit well with Marketing, and I'd like you to, at the very least, explain exactly why your code now requires an implausibly huge amount of disk space just to do basic arithmetic.

B: Well. You told me that I had to add an infinite number of features, and I said that was a problem, and you told me to put on my programming trousers and do it anyway, and so I thought it over and realized that I didn't really need to do an infinite amount of work.

A: Well, I'm glad you realized that.

B: Yes! Because Friend Computer only has a finite number of bits in its registers.

A: Uh-oh.

B: When you say the module has to get the right answer for all possible cases of addition, that's not really an infinite number.

A: So you figured 32 bits for the left operand and 32 bits for the right operand...

B: Right. And another four bits to encode some information about types. That makes 2^68 cases. With a four-byte result for each, it comes to 1.18 zettabytes total.

A: It must have been a lot of work entering that many constants into the lookup table.

B: I wrote a piece of software to do it automatically.

A: So, let me get this straight. You were tasked to make the module add numbers, right?

B: It always did, but you wanted extra features.

A: Urgh... well, anyway, you decided to implement addition of 32-bit numbers by a lookup table of 2^68 entries, which requires an external hard drive that stores a little over twice the size of the entire World Wide Web as of 2009.

B: Well, the Web has gotten bigger since then.

A: Yes, and hard drives cheaper. But even so.

B: I myself have written several long Wikipedia articles this year.

A: That's not the point. Here's the thing: in order to fill in the entries for this unimaginably huge lookup table, you wrote other software, which necessarily computed those table entries, to write them to disk. Do you really see nothing wrong with this picture?

B: The module works.

A: Seriously? That's your answer? You think this counts as "working"?

B: It does work. And it also passes the test suite.

A: But if your table-writing code can do correct addition anyway, then why not just... oh, never mind. I'm not even sure I care anymore.

B: I was hoping you'd say that! Are you finally ready to stop sabotaging yourself by making extra requirements and being so picky? Accept your happiness!

A: Well, neither of us is off the hook yet. I think a 1.18-zettabyte hard drive is an extra requirement that our customers won't accept. So, listen, I'll talk it over with Marketing, but please be ready to work on this again. I think they will almost certainly demand a module that really calculates the correct answers instead of looking them up.

B: So now that you've demanded and received all the extra features that could ever exist even in principle, you're going to start arbitrarily forbidding programming techniques that might possibly be applicable to the problem, one by one until the task really is impossible. I guess you don't actually want this project to succeed after all.

Continue to Chapter 19.

0 comments



(optional field)
(optional field)
Answer "bonobo" here to fight spam. ここに「bonobo」を答えてください。SPAMを退治しましょう!
I reserve the right to delete or edit comments in any way and for any reason. New comments are held for a period of time before being shown to other users.