Talk:FizzBuzz

From Rosetta Code
Revision as of 21:43, 15 February 2012 by MikeMol (talk | contribs) (→‎Broken up: No need to be perfect.)

FizzBuzzJazz

I wasn't satisfied with the approach most of the languages were taking, so I added a second approach to PHP, that uses the concatenation operator. I almost added a third code example as an extension of the puzzle, to demonstrate the approach.

I wanted to add a third term, "Jazz", to appear on multiples of 7. So 7 would have been "Jazz", 21/42/84 would have been "FizzJazz", 35/70 would have been BuzzJazz, and 105 (if the loop were to get that far) would have been FizzBuzzJazz. The if-else ladder approach would have needed three additional if statements to accommodate, while the concatenation approach would have needed only one.

This is probably a good time to point out that FizzBuzz is classified as a puzzle; As the header template suggests, "Multiple approaches are not discouraged." So if you've got a better way to solve the problem for a given language, let's see it! --Short Circuit 13:24, 31 October 2007 (MDT)

Puzzle talk

Why was this taken out of the puzzle category? As far as I can tell....it is a puzzle. Besides that, if it's not a puzzle, then what is it? --Mwn3d 14:03, 11 December 2007 (MST)

I removed it, since it's not a puzzle since no thinking is involved in solving it. All that it is, is writing the specification in the syntax of a language.
The thought is in how to do best do it in a given language. When the task first went up, most of the exaples used an if-elseif-else approach, which couldn't really be expanded efficiently. (See the FizzBuzzJazz comment above.) Also, compare the text of Template:Task and Template:Puzzle. Their goals differ slightly. While a normal task benefits more from syntactical and functional uniformity, a puzzle benefits from drawing out how different approaches affect efficiency. (Also...Sign your posts with --~~~~.) --Short Circuit 21:25, 11 December 2007 (MST)
I think the whole idea behind FizzBuzz is that it misleads people to think it is a puzzle, while in reality it is not. The straightforward solution with if-elseif-else is the best and easiest, but most people start to think they should do something "clever" to combine the fizz and buzz parts. Trying to do that, it is easy to make a mistake. That is why FizzBuzz has been used in testing job applicants.
--PauliKL 13:28, 20 September 2008 (UTC)
I didn't take it as a puzzle. How can you after reading through most of the other responses? But I did take it as (1) something to solve that would demonstrate how VBScript does it compared to other languages, and (2) a testbed for other ways of doing it (assuming, of course, that TIMTOWTDI) --Axtens 02:43, 17 February 2010 (UTC)
Isn't it fair to say that a trick question is analogous to a puzzle? The other side of this argument is that FizzBuzz should absolutely be over-thought for any of several reasons, the least of which being that a solution using if-elseif-else is flawed, as it is missing a test case. --Bendingoutward 07:28, 25 July 2010 (UTC)

Broken up

This page needs to be broken up. Preferably not by language, but perhaps by idomatic approach. (if-else ladder, concatenation, ternary, etc.) Rationale: The syntax highlighting for this much code takes a *long* time to process. --Michael Mol 19:55, 15 February 2012 (UTC)

The fundamental problem is that lots of languages have tackled this problem (129 at the last count). It's a problem of success (good to have!) but it's still a real problem. Breaking up by approach may well not help very much, especially as that will be taken by many as a challenge to implement both methods (and we'd have to work out for ourselves how many of the languages actually solve the problem, which can be anything from quite easy or very hard; I don't want to even try to work out what the Whitespace solution is doing). –Donal Fellows 21:09, 15 February 2012 (UTC)
I was thinking more as subpages, not separate tasks. --Michael Mol 21:21, 15 February 2012 (UTC)
We would still need to figure out the approaches of the unlabelled examples to see which subpage to put them on. Or we could just leave them here? Seems messy. --Mwn3d 21:39, 15 February 2012 (UTC)
If the approach of an example isn't clear, leaving it at FizzBuzz is fine. No need to be perfect. --Michael Mol 21:43, 15 February 2012 (UTC)