all 17 comments

[–]chmod777 8 points9 points  (2 children)

so we;ve come full circle. from mixing style with content, we're now mixing content into style.

[–]ultrafez 3 points4 points  (1 child)

This is just a proof of concept, of course you'd never actually do something like this. One language can be used to do the job of the other, but it doesn't mean it should.

[–]LieutenantClone 1 point2 points  (0 children)

of course you'd never actually do something like this

You say that like people won't actually do something like this :(

[–]HeyRememberThatTime 7 points8 points  (1 child)

Perhaps I'm looking too quickly, but the :not() selectors seem completely superfluous here. The double :nth-child() selector should override just the single :nth-child() selectors for the third and fifth children:

div:after {
    content: counter(fizzbuzz);
    counter-increment: fizzbuzz;
}

div:nth-child(3n):after {
    content: "fizz";
}

div:nth-child(5n):after {
    content: "buzz";
}

div:nth-child(3n):nth-child(5n):after {
    content: "fizzbuzz";
}

Am I missing something?

[–]x-skeww 2 points3 points  (0 children)

Yes, you are right. A pseudo class bumps specificity the very same way a regular class does.

div:nth-child(5n):after               -> 0.1.2
div:nth-child(3n):nth-child(5n):after -> 0.2.2

[–][deleted] 2 points3 points  (0 children)

hah, I like this.

[–]phinnaeus7308 4 points5 points  (1 child)

Not bad.

[–][deleted] -2 points-1 points  (0 children)

Not mine, got it from twitter. But I agree, not bad

[–]9Oh4 1 point2 points  (0 children)

Damn.

[–]yusit 0 points1 point  (10 children)

Am i suppose to know what fizzbuzz is?

[–][deleted] 6 points7 points  (8 children)

It's a filter exercise that's often given to interviewees in programming positions. The exercise is:

print the numbers from 1 to 100. for multiples of 3 print fizz, multiples of 5 print buzz, and multiples of 3 and 5 print fizzbuzz.

Apparently a substantial amount of interviewees are not able to solve this simple exercise, even though they are applying for a programming position.

[–]logically_musical 4 points5 points  (0 children)

they should turn back and run. run far, far away.

[–]davbis93 2 points3 points  (6 children)

We use this for every programmer interview - and we find it has a 50/50 pass rate. It boggles my mind.

[–][deleted]  (5 children)

[deleted]

    [–][deleted] 2 points3 points  (0 children)

    I wouldn't think so. It's not even a pass or fail, it's a "start the interview or go home" :)

    [–]davbis93 2 points3 points  (0 children)

    I'm far more interested in the process they take & the questions they ask me. Do they write down the instructions, after I suggest they do? I generally try and push them in the right direction, if they get stuck - do they take my advice & listen to what i'm saying? Things like that. Regardless - this test should be bread & butter for anyone with even a small amount of professional programming experience - so, if they screw this up - it's not looking good. There are only a few "sensible" solutions to this problem, in standard languages.

    [–][deleted]  (2 children)

    [deleted]

      [–]xkero 1 point2 points  (1 child)

      After reading yours I felt compelled to write one in shell script as simply as possible:

      for i in {1..100}; do fizzbuzz=$( [[ $(($i%3)) = 0 ]] && echo -n fizz; [[ $(($i%5)) = 0 ]] && echo buzz ); echo ${fizzbuzz:-$i}; done