Re: A style question
- From: Vassil Nikolov <vnikolov+usenet@xxxxxxxxx>
- Date: 27 Feb 2007 19:46:24 -0800
On Tue, 27 Feb 2007 22:30:06 -0500, job-271842874@xxxxxxxxxxxxxx said:
| Ken Tilton wrote:
| ...
|| I would object to using cond to implement if, and the redundant code
|| testing for (mod i 3) and associating it with Fizz.
| I agree. I expect mod is fast, but I don't like to repeat myself.
But this isn't about the speed of MOD (after all, we can justifiably
expect the compiler to arrange for the respective call to be made
no more than once), but---to reuse the expression---about getting
thrown out of the interview because of introducing the DIVISIBLE-BY-3,
DIVISIBLE-BY-5, and ANY-NUMBER classes, and doing it with method
combination to address these concerns:
|| Otherwise, I am bothered by the spec. Is the FizzBuzz on 15 tied to it
|| factoring to 3 and 5 and those substitutions, or is that coincidental?
|| ie, Could an RFE come thru for 15 to translate to Bang? Also, is this
|| list expected to expand? If so, will the test always be even divisibility?
|| This is how I get thrown out of most tech interviews.
---Vassil.
--
mind mate, n.
One of two persons mentally compatible with each other (cf. soul mate).
.
- References:
- A style question
- From: job-271842874
- Re: A style question
- From: Paul Wallich
- Re: A style question
- From: Ken Tilton
- Re: A style question
- From: job-271842874
- A style question
- Prev by Date: Re: A style question
- Next by Date: Re: A style question
- Previous by thread: Re: A style question
- Next by thread: Re: A style question
- Index(es):