HN user

jrmoran

28 karma

.

Posts4
Comments10
View on HN

This might be a little offtopic, but I would advise against leaving `console.log` calls in production code, even when there are checks to prevent calling it when the console object is undefined. Commenting those lines out would do the trick, since minification can remove them.

Also I went to the [calculator challenge](http://www.trybloc.com/courses/calculator#/1) and noticed this

    # add(4, 2) => 8
    def add(x, y)
    end
Needless to say the comment should read `=> 6`.

Also, since we are all geeks, here's my Clojure version

    (defn buzziffy [a b x]
	      (cond (and (zero? (mod x a)) (zero? (mod x b))) "FizzBuzz"
	            (zero? (mod x a)) "Fizz"
	            (zero? (mod x b)) "Buzz"
	            :else x))

    (println (apply str (map #(str (buzziffy 3 5 %) "\n")
	                      (range 1 100))))

I might be missing something, since I just started learning it. But instead of drawing a circle like this

    sampleSVG.append("svg:circle")
        .style("stroke", "gray")
        .style("fill", "white")
        .attr("r", 40)
        .attr("cx", 50)
        .attr("cy", 50)
        .attr("width", 100)
        .attr("height", 100);
I'd prefer to express it like this
    sampleSVG.append("svg:circle")
        .style({
            "stroke": "gray",
            "fill": "white"})
        .attr({
            "r": 40,
            "cx": 50,
            "cy": 50,
            "width": 100,
            "height": 100});
That way, I can just pass object literals as arguments to functions such as attr.