Earlier quoted context omitted.
Me: Really? Is that really a business requirement? Any other requirements you need done? I landed a graduate assistantship in 1992 as "the computer guy's assistant" at my school's physical plant. My first assignment was to generate a fixed format file with one phone number per line. The file was to range from 1-900-0000 to 1-900-999-9999 and was needed by the campus telephone system to block all premium rate calls. T…
I know people who spent at least 40 hours/month just updating dates in monthly/weekly excel reports. Edit: and had 6 figure salaries.
A non-programmer’s solution to “Fizz Buzz”
31–40 of 58 posts
Re: A non-programmer’s solution to “Fizz Buzz”
#32Earlier quoted context omitted.
Marketing: That's great, but can we change it so that it says now with 25% more buzz? And also get anyone who reads FIZZBUZZ to sign up for our newsletter?
Sales: Yeah, our nerds just completed this new platform called FIZZBUZZ we want you to buy. What's that? Of course it's a fully-featured CMS/CRM/DataWarehouse/SocialMediaAggregator, the developers just have to make a few tweaks...they should be finished in a day or two at most.
Re: A non-programmer’s solution to “Fizz Buzz”
#33Earlier quoted context omitted.
To be fair when doing front end work you sometimes need to make pretty patterns that do something like "print this table but apply this css class to every other row and one of these other classes to this row if a certain flag is set depending on what the previous class was".
And this is the problem I have with CSS selectors. What you just described is ridiculously fragile and will send shudders down the spine of any developer experienced with wrangling projects that have tangles of inappropriate coupling, but in many cases, there simply isn't a more elegant solution. Your options are: 1. Implement a sane (albeit less powerful) view hierarchy system, foregoing basically all of the CSS sel…
Re: A non-programmer’s solution to “Fizz Buzz”
#34Earlier quoted context omitted.
And this is the problem I have with CSS selectors. What you just described is ridiculously fragile and will send shudders down the spine of any developer experienced with wrangling projects that have tangles of inappropriate coupling, but in many cases, there simply isn't a more elegant solution. Your options are: 1. Implement a sane (albeit less powerful) view hierarchy system, foregoing basically all of the CSS sel…
Or add classes during output generation.
Re: A non-programmer’s solution to “Fizz Buzz”
#35He tackled the problem on a "meta" level, but didn't grasp the math. He could have saved a lot of time by seeing if the number was divisible by 15.
Re: A non-programmer’s solution to “Fizz Buzz”
#36Boss: I need you to write me a program to print the numbers from 1 to 100 Me: Really? Is that really a business requirement? Any other requirements you need done? Boss: Yes, it's your number 1 priority. No, just 1 to 100 Me: Done. Give it a review and I'll push it live. Boss: No! I said 1 to 100 and everything divisible by 3 should be replaced by "FIZZ". Why didn't you do that? Me: I'm pretty sure you didn't ask for…
Marketing: That's great, but can we change it so that it says now with 25% more buzz? And also get anyone who reads FIZZBUZZ to sign up for our newsletter?
Re: A non-programmer’s solution to “Fizz Buzz”
#37I don't wish to complain but does that look like an infinite loop to you? Programs are just algorithms, a flow diagram is just a different programming language
There's probably a lot more to say about programs that doesn't fit within the "just algorithm" view.
Re: A non-programmer’s solution to “Fizz Buzz”
#38What's very interesting here is the SICP-style recursive looping, combined with the fact that the non-programmer doesn't expect to be able to pass variables but rather expects to make stateful queries. That is, the infrastructure expected (here written in JS) is: var query = {}; function print(x) { console.log(x); if (typeof x === "number") { query = {last_num: x, time_since: 1}; } else { query.time_since += 1; } } A…
var output_state = {};
function print(x) {
console.log(x);
if (typeof x === "number") {
output_state = {last_num: x, time_since: 1};
} else {
output_state.time_since += 1;
}
}
function fizzbuzz() {
switch(output_state.last_num) {
case undefined:
print(1);
break;
default:
var a = output_state.last_num;
var b = output_state.time_since;
var number = a + b;
if (number % 5 !== 0) {
if (number % 3 === 0) {
print("Fizz");
} else {
print(number);
}
} else {
if (number % 3 === 0) {
print("FizzBuzz");
} else {
print("Buzz");
}
}
}
fizzbuzz();
// Or, correctly: if (number Re: A non-programmer’s solution to “Fizz Buzz”
#39I like how instead of giving a procedure to produce the whole answer he created an induction-style algorithm that, given part of an answer, produces the next output. Looks like "The mathematician's solution to Fizz Buzz"
Is this really an "induction-style" algorithm? (I haven't actually heard that term before.) I usually associate induction with taking some large input and shrinking it at each step until you hit some base case. This is really the opposite of induction--it starts with a base case (1) and grows the output, which makes this sound a bit more like co-induction. Another way to think about it would be that he defined a litt…
Is it a common FP technique to do local-state-less looping like that? I would expect a tail-recursion solution to pass the next or previous value rather than re-deriving it from reading the output.
Re: A non-programmer’s solution to “Fizz Buzz”
#40Boss: I need you to write me a program to print the numbers from 1 to 100 Me: Really? Is that really a business requirement? Any other requirements you need done? Boss: Yes, it's your number 1 priority. No, just 1 to 100 Me: Done. Give it a review and I'll push it live. Boss: No! I said 1 to 100 and everything divisible by 3 should be replaced by "FIZZ". Why didn't you do that? Me: I'm pretty sure you didn't ask for…
Marketing: That's great, but can we change it so that it says now with 25% more buzz? And also get anyone who reads FIZZBUZZ to sign up for our newsletter?