1. 17

  2. 7

    Interesting post, thanks.I think the Jazz Standard concept is useful to programming but that may just be because I play the trumpet. I don’t agree that Fizzbuzz is a standard, though.

    The value of standards comes from establishing enough rules & structure that others can productively work with you towards a common goal. So I would say the closest analogy to programming is that a standard is a type signature. A type is an approximation of a program and likewise the chord changes of the song are its type signature. Types allow constraining inputs of functions and provide guarantees such as memory safety, and chord changes constrain the set of notes playable and provide guarantees such as song won’t be overly dissonant.

    If you see it like I do, calling Fizzbuzz a standard is a category error. I would classify Fizzbuzz as a meme. When my friends talk about getting Fizzbuzz at an interview we laugh about it. Fizzbuzz is in Fizzbuzz Standard Edition because its funnier like that. A team of programmers isn’t gonna get together and say “alright lets riff on Fizzbuzz” unless its followed by “haha nah, but seriously”. However, they might start by establishing what interfaces they want their parts to satisfy so they can collaborate without stepping on each others toes.

    1. 2

      Interesting distinction! I would like to respond; I am going to think on that for a while. Thanks for reading!

    2. 3

      Actually, a 3:5 polyrhythm isn’t typically a jazz rhythm. I mean, listen to this. That’s not jazz.

      1. 1

        hahahahahaha awesome I love this

      2. 2

        I was given an interesting variation on FizzBuzz recently.

        The first half of the question was a stage, a slightly extended version of the problem: Fizz when N % 0 == 5, or when N in base 10 contains the digit 5. Likewise Buzz on N % 7 == 0, or contains the digit 7 – and the expected confluence for both.

        The second half of the question was to implement a test-case generator - a function to enumerate the smallest number for each of the 16 possible combinations of properties. 16 could theoretically be hard-coded, but if one were to add a third condition (i.e divisible by or containing 3) the number of cases becomes infeasible to enumerate manually.